Posted By

AndreyZarembo on 09/28/14


script build xcode

Versions (?)

XCode Autoincrement build number script

 / Published in: Bash


  1. Click on the Build Phases tab.
  2. Click on Add Build Phase (at the lower right corner) and choose Add Run Script.
  3. Drag the Run Script section to 2nd position from the top, just below Target Dependencies.
  4. Add snippet code
  5. Ensure, that Run script only when installing is not checked
  6. Rename it
  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"

Report this snippet  

You need to login to post a comment.