Created
May 3, 2013 19:27
-
-
Save ejdyksen/5513145 to your computer and use it in GitHub Desktop.
Auto-increment build numbers in Xcode
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
# 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