XCode Autoincrement build number script


/ Published in: Bash
Save to your folder(s)

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


Copy this code and paste it in your HTML
  1. #!/bin/bash
  2. bN=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
  3. bN=$((0x$bN))
  4. bN=$(($bN + 1))
  5. bN=$(printf "%X" $bN)
  6. /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $bN" "$INFOPLIST_FILE"

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.