How to Add Xcode Bot Integration Number Into Build Script(如何将 Xcode Bot 集成编号添加到构建脚本中)
问题描述
我正在使用 Settings.bundle 文件创建一个 iPad 应用程序.我正在编写构建脚本来显示应用程序版本号和 xcode bot 集成号(不是捆绑构建号).我在网上搜索并找不到任何解决方案.这是我得到的:
I'm creating an iPad application with a Settings.bundle file. I'm writing build scripts to display the application version number and the xcode bot integration number (not the bundle build number). I've searched the web and couldn't find any solution. Here's what I got yet:
-- Add the app version number
cd $PROJECT_DIR
cd "$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.app"
RELEASE_VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" Info.plist)
/usr/libexec/PlistBuddy -c "Set :PreferenceSpecifiers:1:DefaultValue $RELEASE_VERSION" Settings.bundle/Root.plist
-- Add the build version number
BUILD_NUMBER=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" Info.plist)
/usr/libexec/PlistBuddy -c "Set :PreferenceSpecifiers:2:DefaultValue $BUILD_NUMBER" Settings.bundle/Root.plist
在构建版本号中,我想将 CFBundleVersion 替换为 xcode bot 集成号.
In the build version number, I would like to replace the CFBundleVersion with the xcode bot Integration number.
推荐答案
我在我的 Xcode 项目中使用 Shell 脚本构建阶段 实现了这个.在我的例子中,我使用集成号来设置我构建产品的内部版本.我的脚本如下所示:
I implemented this using a Shell Script Build Phase in my Xcode project. In my case, I used the integration number to set the internal version of my built product. My script looks like this:
if [ "the$XCS_INTEGRATION_NUMBER" == "the" ]; then
echo "Not an integration build…"
xcrun agvtool new-version "10.13"
else
echo "Setting integration build number: $XCS_INTEGRATION_NUMBER"
xcrun agvtool new-version "$XCS_INTEGRATION_NUMBER"
fi
注意 XCS_INTEGRATION_NUMBER 默认存在于 Xcode Server 构建环境中.如果您想模拟集成构建(出于此脚本的目的),您只需将其作为自定义变量添加到构建设置中即可.
Note that XCS_INTEGRATION_NUMBER exists by default in the Xcode Server build environment. If you want to simulate an integration build (for the purposes of this script), you can simply add it to your build settings as a custom variable.
这篇关于如何将 Xcode Bot 集成编号添加到构建脚本中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何将 Xcode Bot 集成编号添加到构建脚本中
基础教程推荐
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- iOS4 创建后台定时器 2022-01-01
