【发布时间】:2017-09-19 18:42:37
【问题描述】:
我有一个 iOS 应用程序,它使用 Agentry 框架来定义要连接的 Agentry 服务器 URL。根据 SAP 规范,agentryServerURL 参数包含在单独的 branding.plist 文件中。我想要做的是将不同环境的 iOS 方案绑定到预构建操作,以更改代理 URL 值。
这是我当前的脚本,但它不起作用。
#!/bin/sh
plist=$SRCROOT"/branding.plist"
if [ ${CONFIGURATION} = "DEV" ]; then
/usr/libexec/PlistBuddy -c "Set :agentryServerURL https://smpdevURL" "$plist"
if [ ${CONFIGURATION} = "QA" ]; then
/usr/libexec/PlistBuddy -c "Set :agentryServerURL https://smpqaURL" "$plist"
if [ ${CONFIGURATION} = "Release" ]; then
/usr/libexec/PlistBuddy -c "Set :agentryServerURL https://smpprodURL" "$plist"
fi
这是我第一次编写预构建脚本,所以它可能与我的语法有关
【问题讨论】:
标签: ios xcode sh pre-build-event