How to auto increment build number in Xcode [closed]

最后都变了- 提交于 2020-01-01 01:40:12

问题


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:

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

来源:https://stackoverflow.com/questions/18163396/how-to-auto-increment-build-number-in-xcode

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!