gpt4 book ai didi

ios - 通过 Cordova config.xml 添加条目到 iOS .plist 文件

转载 作者:IT王子 更新时间:2023-10-29 07:31:21 27 4
gpt4 key购买 nike

我是 Cordova CLI 的新手。

我需要通过 Cordova 以编程方式执行以下步骤。

  1. 在项目.plist中添加一个新行
  2. 在新行中输入以下值:
  3. Key:GDLibraryMode Type:String(默认) Value:GDEnterpriseSimulation

我想我需要在项目根目录(或者可能是“平台”文件夹中的文件)的 config.xml 文件中执行此操作。

有人可以向我解释如何通过 config.xml 添加条目,以便在编译时添加上述条目吗?

我使用的是 Cordova 3.3.1-0.42(我知道它不是最新的)。我已经完成了我的项目,一切都很好,我只需要将这个条目添加到 pList。


编辑:2/8/21根据对这个问题的评论:

For anyone coming late to this, setting values in the project plist is now supported by Cordova CLI 7 and above

最佳答案

我不认为你可以直接通过 config.xml 来做到这一点修改。至少,我没有在文档中看到任何提及:http://cordova.apache.org/docs/en/3.3.0/config_ref_index.md.html

我认为您必须创建一个插件,因为它们可以插入 plist 条目:http://docs.phonegap.com/en/3.3.0/plugin_ref_spec.md.html#Plugin%20Specification

请参阅“配置文件元素”部分。这是关于 plugin.xml 的相关部分的猜测看起来像:

<platform name="ios">
<config-file target="*-Info.plist" parent="CFBundleURLTypes">
<array>
<dict>
<key>GDLibraryMode</key>
<string>GDEnterpriseSimulation</string>
</dict>
</array>
</config-file>
</platform>

然后就可以安装插件了:cordova plugin add <your plugin name or file location>

关于ios - 通过 Cordova config.xml 添加条目到 iOS .plist 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22769111/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com