How to auto increment build number in Xcode [close

2019-03-18 00:46发布

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

0条回答
登录 后发表回答