Skip to content

Instantly share code, notes, and snippets.

@boyvanamstel
Created June 28, 2012 13:38
Show Gist options
  • Save boyvanamstel/3011433 to your computer and use it in GitHub Desktop.
Save boyvanamstel/3011433 to your computer and use it in GitHub Desktop.
Automatically increase build number in Xcode4 project
# 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