Skip to content

Instantly share code, notes, and snippets.

@c0diq
Created March 27, 2012 07:02
Show Gist options
  • Save c0diq/2213492 to your computer and use it in GitHub Desktop.
Save c0diq/2213492 to your computer and use it in GitHub Desktop.
Automatic CFBundleVersion increment Build Pre-Action Scheme
#!/bin/bash
if [[ $CONFIGURATION == *Adhoc* ]]; then
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" ${PROJECT_DIR}/${INFOPLIST_FILE})
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" ${PROJECT_DIR}/${INFOPLIST_FILE}
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment