Skip to content

Instantly share code, notes, and snippets.

@ejdyksen
Created May 3, 2013 19:27
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 ejdyksen/5513145 to your computer and use it in GitHub Desktop.
Save ejdyksen/5513145 to your computer and use it in GitHub Desktop.
Auto-increment build numbers in Xcode
# Get the path to the already-built info.plist
buildPlist="${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
# Construct our version string (in this case, date+git commit)
date=`date -u +"%Y-%m-%dT%H:%M:%SZ"`
rev=`git rev-parse --short HEAD`
buildString="$date-$rev"
# Replace CFBundleVersion with our string
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildString" "$buildPlist"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment