Skip to content

Instantly share code, notes, and snippets.

@gdavis

gdavis/gist:2353296

Created Apr 10, 2012
Embed
What would you like to do?
XCode Project Build Number Auto Increment Script
# 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
@gdavis

This comment has been minimized.

Copy link
Owner Author

@gdavis gdavis commented Apr 10, 2012

Make sure to run this script before the "Copy Bundle Resources" build phase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.