我在settings.bundle中添加“Version Detail”.什么是设置该标识符的更好方法,我看到很少通过代码使用Plistbuddy的运行脚本来完成.
是这样的,如果你使用plistbuddy,它会立即显示更新版本的详细信息,即使你没有打开应用程序.从应用程序版本更新后.商店?
如果通过代码完成,则必须打开应用程序.在设置中查看更新.
解决方法
这是一个PlistBuddy示例:
# buildPlist="Info.plist" settingsPlist="Settings.bundle/Information.plist" # Get the existing buildVersion and buildNumber values from the buildPlist buildVersion=$(/usr/libexec/PlistBuddy -c "Print CFBuildVersion" $buildPlist) buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBuildNumber" $buildPlist) # Increment the buildNumber buildNumber=$(($buildNumber + 1)) # Set the version numbers in the buildPlist /usr/libexec/PlistBuddy -c "Set :CFBuildNumber $buildNumber" $buildPlist /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildVersion.$buildNumber" $buildPlist # Set the version numbers in the settingsPlist /usr/libexec/PlistBuddy -c "Set :PreferenceSpecifiers:1:DefaultValue $buildVersion.$buildNumber" $settingsPlist
希望有所帮助!
@H_301_30@