Cordova使用Config.xml文件更改AndroidManifest [英] Cordova Change AndroidManifest using Config.xml file

查看:1010
本文介绍了Cordova使用Config.xml文件更改AndroidManifest的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将一些标签添加到

I am in need to add some tags to the AndroidManifest.xml file which is found under

platforms\android\AndroidManifest.xml

我已经阅读了AndroidManifest.xml文件,该文件是即时生成的,因此不建议对其进行编辑.

As I have read the AndroidManifest.xml file gets generated on the fly and it is not advisable to edit it.

那么有没有一个我可以使用的插件,可以使用我在config.xml文件中提供的值来修改AndroidManifest.xml文件?

So is there a plugin that I can use that will modify the AndroidManifest.xml file for me with the values that I give it in the config.xml file?

推荐答案

由于最近您可以使用 <edit-config> 中的标签即可完成此操作,而无需第三方插件.例如:

Since the recent release of cordova@6.4.0 you can use the <edit-config> tag in config.xml to do this without requiring a 3rd party plugin. For example:

<edit-config file="AndroidManifest.xml" target="/manifest/uses-sdk" mode="merge">
    <uses-sdk android:minSdkVersion="16" android:maxSdkVersion="23" />
</edit-config>

这篇关于Cordova使用Config.xml文件更改AndroidManifest的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆