Return to Snippet

Revision: 67491
at September 28, 2014 17:46 by AndreyZarembo


Initial Code
#!/bin/bash    
bN=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
bN=$((0x$bN)) 
bN=$(($bN + 1)) 
bN=$(printf "%X" $bN)
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $bN" "$INFOPLIST_FILE"

Initial URL
http://stackoverflow.com/questions/10091310/heres-how-to-auto-increment-the-build-number-in-xcode

Initial Description
1. Click on the **Build Phases** tab. 
2. Click on **Add Build Phase** (at the lower right corner) and choose **Add Run Script**. 
4. Drag the **Run Script** section to **2nd** position from the top, just below Target Dependencies.
5. **Add snippet code**
6. Ensure, that **Run script only when installing** is __not checked__
7. **Rename** it

Initial Title
XCode Autoincrement build number script

Initial Tags
script

Initial Language
Bash