Created
June 28, 2012 13:38
-
-
Save boyvanamstel/3011433 to your computer and use it in GitHub Desktop.
Automatically increase build number in Xcode4 project
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
# Via: http://blog.suda.pl/2012/01/auto-increment-build-number-in-xcode-4-2-fixed/ | |
# Just add “Run Script” build phase with this script (remember to move it before | |
# “Copy Bundle Resources” phase) and set your CFBundleVersion to an integer. | |
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" ${PROJECT_DIR}/${PROJECT_NAME}/${PROJECT_NAME}-Info.plist) | |
buildNumber=$(($buildNumber + 1)) | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" ${PROJECT_DIR}/${PROJECT_NAME}/${PROJECT_NAME}-Info.plist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment