Created
August 7, 2015 10:24
-
-
Save quentinhayot/ecd73b0aa18e8a63df69 to your computer and use it in GitHub Desktop.
[Xcode] Increment build number on each release builld
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
##Build phases > Run Script | |
##Shell: /bin/bash | |
if [ "${CONFIGURATION}" = "Release" ]; then | |
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}") | |
buildNumber=$(($buildNumber + 1)) | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE" | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment