xcode plist 包版本值
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1784209/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
plist bundle version values
提问by Brian Postow
I want to set the Bundle Version in my plist. However, it appears that the value that is actually LOOKED at by finder to put the version when you look at more info is "bundle versions string, short" Editing this, however, requires opening the plist file, rather than just editing the "version" in the target settings.
我想在我的 plist 中设置捆绑版本。但是,当您查看更多信息时,finder 实际查看的用于放置版本的值似乎是“bundle versions string, short”编辑此内容,但是,需要打开 plist 文件,而不仅仅是编辑“版本” "在目标设置中。
Is there a way to either a) make the bundle version always equal the bundle version short, b) make finder look at the bundle version instead of the short string or c) make the short version appear in the edit target settings window?
有没有办法a)使捆绑版本始终等于捆绑版本短,b)让finder查看捆绑版本而不是短字符串或c)使短版本出现在编辑目标设置窗口中?
Or, is there some better way I should be dealing with this?
或者,有没有更好的方法来处理这个问题?
thanks.
谢谢。
回答by Ken Aspeslagh
Yes, you can use ${VARIABLE}
style macros the Info.plist file.
是的,您可以${VARIABLE}
在 Info.plist 文件中使用样式宏。
We make a user-defined setting in the project called APP_VERSION
, and then use ${APP_VERSION} in the CFBundleGetInfoString
(Get Info string), CFBundleShortVersionString
(Bundle versions string, short) and CFBundleVersion
(Bundle version) keys. At build time, the variable gets filled in with the correct version.
我们在名为 的项目中进行用户自定义设置APP_VERSION
,然后在CFBundleGetInfoString
(Get Info string)、CFBundleShortVersionString
(Bundle versions string, short) 和CFBundleVersion
(Bundle version) 键中使用 ${APP_VERSION} 。在构建时,变量会填充正确的版本。
Watch out though because sometimes a clean build is necessary for Xcode to update the Info.plist file as it does not do dependency checking against the variables.
不过要小心,因为有时 Xcode 需要一个干净的构建来更新 Info.plist 文件,因为它不会对变量进行依赖性检查。