从Info.plist中删除没有数据的密钥

问题描述 投票:1回答:1

我有一个iOS应用程序,在Info.plist中有以下键

<key>UISupportedExternalAccessoryProtocols</key>
    <array>
        <string>$(MYAPP_EXTERNAL_ACCESSORIES)</string>
    </array>

我们有应用程序的客户端和商家版本,只有后者获得此处指定的值(蓝牙打印机)。归档客户端时,我们在上传到iTunes Connect的过程中收到以下错误:

ERROR ITMS-90110: "This bundle is invalid. The key UISupportedExternalAccessoryProtocols in the Info.plist file must be an array of non-empty strings."

我找到了使用脚本(添加/删除现有密钥中的内容)来更改Info.plist的方法,但没有找到如何为某些构建配置完全删除密钥,或者如果它是空的。

什么是最好的解决方案?

谢谢。

swift xcode plist
1个回答
1
投票

您表明您已经知道如何使用构建脚本。您要在脚本中使用的工具是plutil

plutil -insert <keypath> -<type> <value> <path_to_file>

要么

plutil -remove <keypath> <path_to_file>
© www.soinside.com 2019 - 2024. All rights reserved.