Skip to content

Instantly share code, notes, and snippets.

@jnutting
Created August 29, 2013 12:30
Show Gist options
  • Save jnutting/6377458 to your computer and use it in GitHub Desktop.
Save jnutting/6377458 to your computer and use it in GitHub Desktop.
Automatically update the build number every time anyone hits build
#!/bin/bash
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
buildNumber=$((0x$buildNumber))
buildNumber=$(($buildNumber + 1))
buildNumber=$(printf "%X" $buildNumber)
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment