Skip to content

Instantly share code, notes, and snippets.

@orgmir
Created September 8, 2017 00:28
Show Gist options
  • Save orgmir/dbe98a80c715fb3792aa1b0e34dfd64d to your computer and use it in GitHub Desktop.
Save orgmir/dbe98a80c715fb3792aa1b0e34dfd64d to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleVersion</key>
<string>31</string>
</dict>
</plist>
#!/bin/sh
BUILD_NUMBER_PLIST="BuildNumber.plist"
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PROJECT_DIR}/$BUILD_NUMBER_PLIST")
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/$BUILD_NUMBER_PLIST"
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/${INFOPLIST_FILE}"
@orgmir
Copy link
Author

orgmir commented Sep 8, 2017

Create a "Run Script" in XCode Build Phases and add the increment-build-number.sh to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment