Created
October 15, 2015 08:06
-
-
Save benvium/b78bc7ceceb4ac6b01ee to your computer and use it in GitHub Desktop.
Script to update the build number stored in the plist file for an iOS project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # | |
| # SETUP INSTRUCTIONS | |
| #----------------------- | |
| # | |
| # Add this file to a folder called 'scripts' at the same level as your xcodeproj file | |
| # Open XCode | |
| # Select Project on left-hand view | |
| # TARGETS / your target | |
| # Select 'Build Phases' | |
| # Add Run Script phase BEFORE 'compile sources' | |
| # P | |
| plist=$1 | |
| buildnum=$(/usr/libexec/Plistbuddy -c "Print CFBundleVersion" "$plist") | |
| if [ -z "$buildnum" ]; then | |
| exit 1 | |
| fi | |
| buildnumplus=$(expr $buildnum + 1) | |
| /usr/libexec/Plistbuddy -c "Set CFBundleVersion $buildnumplus" "$plist" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment