简体   繁体   English

从.xcconfig 文件中读取内部版本号,例如 Xcode 中的版本号

[英]Read Build number from .xcconfig file like Version number in Xcode

i created this Release.xcconfig :我创建了这个Release.xcconfig

SB_APP_NAME = Test
SB_APP_VERSION = 0.5
SB_APP_BUILD = 5
SB_APP_BUNDLE_ID = com.test.ios

and now i can use SB_APP_VERSION in info.plist like this:现在我可以像这样在info.plist中使用SB_APP_VERSION

在此处输入图像描述

but i can't find any key for build number in plist file to replace it from my xcconfig file.但是我在plist文件中找不到任何内部build number的密钥来从我的xcconfig文件中替换它。

as you can see, we have Version and Build in General tab of project.如您所见,我们在项目的General选项卡中有VersionBuild i want to read this number from xcconfig我想从xcconfig中读取这个数字

在此处输入图像描述

If we see in info.plist file, we can find Bundle version string (short) and Bundle version .如果我们在info.plist文件中看到,我们可以找到Bundle version string (short)Bundle version so:所以:

Bundle version string (short) => App Version ( in general tab ) ( like 5.3.1 ) Bundle version string (short) => App Version (在一般选项卡中)(如 5.3.1)

Bundle version => App Build ( in general tab ) ( like any int number ) Bundle version => App Build (在一般选项卡中)(就像任何整数一样)


So we can replace Bundle Version value as $(SB_APP_BUILD)所以我们可以将Bundle Version值替换为$(SB_APP_BUILD)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM