Last active
August 29, 2015 14:20
-
-
Save jordansirwin/6160d267cf3073397445 to your computer and use it in GitHub Desktop.
Xcode Build Script: Auto Increment BundleVersion
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
# only increments on a "Release" build | |
if [ "${CONFIGURATION}" = "Release" ]; then | |
#!/bin/bash | |
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE") | |
buildNumber=$(($buildNumber + 1)) | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE" | |
# optional: requires adding BuildDate (Date or String) to info.plist | |
buildDate=$(date) | |
/usr/libexec/PlistBuddy -c "Set :BuildDate $buildDate" "$INFOPLIST_FILE" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment