Skip to content

Instantly share code, notes, and snippets.

@tadpol
Last active March 29, 2016 20:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tadpol/28988edd77a37ee7772313014f45594d to your computer and use it in GitHub Desktop.
Save tadpol/28988edd77a37ee7772313014f45594d to your computer and use it in GitHub Desktop.
Xcode Build Phase scripts for setting build number
# This goes at the end of the Build Phases
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion DEVEL" "${PROJECT_DIR}/${INFOPLIST_FILE}"
# This goes at the beginning. (or near to)
buildNumber=$(git rev-list --count HEAD)
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/${INFOPLIST_FILE}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment