Created
October 22, 2013 18:57
-
-
Save mingsai/7106123 to your computer and use it in GitHub Desktop.
Below is a simple bash script that uses the PlistBuddy executable on MacOSX to generate an auto increment versioning script. To use: Open Xcode 5 Select Project > Build Phases Click Menu: Editor > Add Build Phase > Add Run Script Build Phase Click into White Text Box Below Run Script and Paste Contents of Gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Auto Increment Version Script | |
buildPlist=$INFOPLIST_FILE | |
echo $buildPlist | |
CFSVString=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "$buildPlist") | |
CFBundleVersion=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$buildPlist") | |
BUILD_NR=${CFBundleVersion##*.} | |
BUILD_NR=$(($BUILD_NR + 1)) | |
#echo $BUILD_NR | |
CFBundleVersion=$CFSVString".0."$BUILD_NR | |
#echo $CFBundleVersion | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $CFBundleVersion" "$buildPlist" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment