Skip to content

Instantly share code, notes, and snippets.

@bananafish911
Created January 28, 2018 11:58
Show Gist options
  • Save bananafish911/3a52880b4a79ca8e0675e33b602a4758 to your computer and use it in GitHub Desktop.
Save bananafish911/3a52880b4a79ca8e0675e33b602a4758 to your computer and use it in GitHub Desktop.
[CFBundleVersion]++ when installing
if [ $CONFIGURATION == Release ]; then
echo "Bumping build number..."
plist=${PROJECT_DIR}/${INFOPLIST_FILE}
# increment the build number (ie 115 to 116)
buildnum=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${plist}")
if [[ "${buildnum}" == "" ]]; then
echo "No build number in $plist"
exit 2
fi
buildnum=$(expr $buildnum + 1)
/usr/libexec/Plistbuddy -c "Set CFBundleVersion $buildnum" "${plist}"
echo "Bumped build number to $buildnum"
else
echo $CONFIGURATION " build - Not bumping build number."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment