Skip to content

Instantly share code, notes, and snippets.

@chourobin
Last active December 20, 2015 01:09
Show Gist options
  • Select an option

  • Save chourobin/6047370 to your computer and use it in GitHub Desktop.

Select an option

Save chourobin/6047370 to your computer and use it in GitHub Desktop.
My custom bump build number script
# Using HEX builds (e.g. 1A12)
#!/bin/sh
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
dec=$((0x$buildNumber))
buildNumber=$(($dec + 1))
hex=$(printf "%X" $buildNumber)
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $hex" "$INFOPLIST_FILE"
# Using numerical builds
#!/bin/sh
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
buildNumber=$(($buildNumber + 1))
/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