本文介绍了plist捆绑软件版本值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的plist中设置捆绑版本.但是,看起来当您查看更多信息时,查找程序将放置该版本的实际上查找到的值是捆绑版本字符串,短".但是,编辑此文件需要打开plist文件,而不仅仅是编辑版本"在目标设置中".

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.

是否可以以下方式之一:a)使捆绑软件版本始终等于捆绑软件版本短,b)使查找器查看捆绑软件版本而不是短字符串,或者c)使简短版本出现在编辑目标设置窗口中?

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?

或者,有什么更好的方法应对这个问题吗?

Or, is there some better way I should be dealing with this?

谢谢.

推荐答案

是的,您可以在Info.plist文件中使用${VARIABLE}样式宏.

Yes, you can use ${VARIABLE} style macros the Info.plist file.

我们在名为APP_VERSION的项目中进行用户定义的设置,然后在CFBundleGetInfoString(获取信息字符串),CFBundleShortVersionString(捆绑版本字符串,简称)和CFBundleVersion中使用$ {APP_VERSION} (捆绑版)键.在构建时,变量将使用正确的版本填充.

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.

请注意,因为有时Xcode需要一个干净的版本来更新Info.plist文件,因为它没有对变量进行依赖检查.

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.

这篇关于plist捆绑软件版本值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 01:12