我的 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
问题是我有一个“可执行文件的签名无效。” 在设备上安装应用程序时出错。
我猜这是因为在被编辑后,权利文件不再对应于配置文件中包含的权利。
你知道是否有办法做我想做的事吗?使用 fastlane、shell 脚本或任何东西......(我有 40 个目标,所以我真的很想为所有这些目标获取一个权利文件)