Created
April 10, 2012 18:04
-
-
Save gdavis/2353296 to your computer and use it in GitHub Desktop.
XCode Project Build Number Auto Increment Script
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
# Auto Increment Version Script | |
# This script will increment the build number by 1 | |
# when running a configuration other than Debug and Release | |
# while not on intel architecture | |
arch=${ARCHS:0:4} | |
conf=${CONFIGURATION} | |
if [ "$conf" != "Debug" ] && [ "$conf" != "Release" ] && [ "$arch" != "i386" ] | |
then | |
buildPlist=${INFOPLIST_FILE} | |
buildVersion=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" $buildPlist) | |
buildVersion=$(($buildVersion + 1)) | |
echo "Incrementing build version" | |
echo " New build number is: $buildVersion" | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildVersion" $buildPlist | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Make sure to run this script before the "Copy Bundle Resources" build phase.