美文网首页
Increase build num

Increase build num

作者: Albert新荣 | 来源:发表于2019-05-24 10:58 被阅读0次

1.TARGETS -> [your project] -> Build Phases -> +
2.Select New Run Script Phase
3.Copy this entire script in the provided blank space.

buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}")
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/${INFOPLIST_FILE}"

4.Check the Run script only when installing item. If you want this script to increment build number only while archiving project.
5.Uncheck the Run script only when installing item. If you want to increment build number every time you run the project.

相关文章

网友评论

      本文标题:Increase build num

      本文链接:https://www.haomeiwen.com/subject/hdtgzqtx.html