本文介绍了Xcode项目的“Build number”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是内置编号及其用途?
是否与版本号相同?

What is a Build number and what is its use?Is it the same as version number?

推荐答案

此外,如果您将CFBuildDate添加为字符串而将CFBuildNumber添加为字符串进入你的info.plist,以下shell脚本(当添加到你的运行脚本构建阶段/ bin / bash时会自动更新你的构建号和日期:

Additionally, if you add CFBuildDate as a string and CFBuildNumber as a string into your info.plist, the following shell script (when added to your run script build phase /bin/bash will automatically update your build number and date:

    # Auto Increment Version Script
buildPlist=${INFOPLIST_FILE}
CFBuildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBuildNumber" $buildPlist)
CFBuildNumber=$(($CFBuildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBuildNumber $CFBuildNumber" $buildPlist
CFBuildDate=$(date +%Y%m%d%H%M%S)
/usr/libexec/PlistBuddy -c "Set :CFBuildDate $CFBuildDate" $buildPlist

这篇关于Xcode项目的“Build number”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 19:17