我在我的Xcode项目中有几个目标,每个目标都有一个相关的域,但是有一个不同的域。

我希望我的所有目标都有相同的授权文件,并使用PListBuddy脚本来更改域的值。
我已经有了一个在构建阶段启动的脚本,可以正确地编辑文件:
case $TARGET_NAME in
"EN6") fireBaseUrl="FOO.app.goo.gl";;
"ES5") fireBaseUrl="BAR.app.goo.gl";;
"SVT-C4") fireBaseUrl="FOOFOO.app.goo.gl";;
"PC5") fireBaseUrl="BARBAR.app.goo.gl";;
*) fireBaseUrl="FOOBAR.app.goo.gl";;
esac
# Universal links used by Firebase
associatedDomainKey="com.apple.developer.associated-domains"
/usr/libexec/PlistBuddy -c "delete ${associatedDomainKey}" app.entitlements
/usr/libexec/PlistBuddy -c "add :${associatedDomainKey} array" -c "add :${associatedDomainKey}:0 string applinks:${fireBaseUrl}" app.entitlements问题是我有一个“可执行文件是用无效的权利签名的”。在设备上安装应用程序时出错。
我猜这是因为编辑后的授权文件不再与配置配置文件中包含的授权相对应。
你知道有没有办法做我想做的事?使用快速通道、shell脚本或其他任何东西。(我有40个目标,所以我真的希望所有目标都只有一个授权文件)
发布于 2018-08-22 23:26:17
在签署你的应用程序之前,Xcode会创建一个包含你的权限的.xcent。您可以添加一个运行脚本阶段,作为使用PlistBuddy修改它的最后一步,如下所示:
echo "Updating ${TARGET_TEMP_DIR}/${FULL_PRODUCT_NAME}.xcent"
/usr/libexec/PlistBuddy -c "add com.apple.developer.icloud-container-environment string Production" "${TARGET_TEMP_DIR}/${FULL_PRODUCT_NAME}.xcent" || exit 1https://stackoverflow.com/questions/43231878
复制相似问题