Reputation: 4551
I currently have this as a script to auto-increment the build number in my Xcode project:
#!/bin/bash
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE"
What this script does is incrementing from let's say 1285
to 1286
.
What I want to do is have it on components: Increase it from 1.0.4523
to 1.0.4524
The reason I need this is because Fabric and iTunes Connect's Testflight use different notation systems for detecting a separate version and this way I can combine the two and not edit it manually always when doing a build for one and a build for the other.
Any help would be greatly appreciated! Thanks in advance!
Upvotes: 1
Views: 1509
Reputation: 1830
Simpler to keep app version and build number separately and use Apple versioning
After add run script link this:
This script will update your build number during each build for all targets.
Dont forget to setup Apple versioning:
Upvotes: 2
Reputation: 122381
Hold the version information outside of the Info.plist
file in a separate version file. This file is kept under source control.
You then:
major
.minor
.buildnum
and write that to the Info.plist
file.I do something similar in this script, however I use Python, rather than shell script, as it's much more powerful.
Upvotes: 1