16

I found many solutions and scripts on this site, but the easiest solution to increase the build number in Xcode is:

Go to Build Phases in your TARGETS section and add Run Script Build Phase:

Auto increment build numbers in xcode

Change Shell to /bin/bash and insert the following script:

#!/bin/bash
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE"

Have fun! :)

I found this tutorial on Cocoa Factory

seinfeld
  • 1,686
  • 1
  • 17
  • 18
  • Thanks! Works like a charm for me. For those who don't know how to add the script, the **Add Run Script Build Phase** is located at Editor > Add Build Phase. – mro Nov 13 '13 at 10:43
  • 3
    This should be posted as a question, with the solution posted as an answer below. – Bill the Lizard Nov 13 '13 at 16:59
  • Actually this question is a duplicate of this: http://stackoverflow.com/questions/9258344/xcode-better-way-of-incrementing-build-number – trojanfoe Jan 14 '14 at 13:04

0 Answers0