在Cordova中,如何为ios和android指定不同的包名? [英] In Cordova, how can I specify different package names for ios and android?

查看:1786
本文介绍了在Cordova中,如何为ios和android指定不同的包名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于遗留因素,Android和iOS应用程式的套件名称不同。目前Cordova似乎在构建时将config.xml中的widget id属性注入两者。有没有办法自定义这个?如果我直接编辑AndroidManifest.xml,我期望它很快就会被覆盖。



谢谢。



在你的config.xml文件中 -



示例:

 < widget 
android-packageName =com.example。 android
ios-CFBundleIdentifier =com.example.ios>

资料来源:



https://github.com/apache/cordova-lib/blob/ master / cordova-lib / src / configparser / ConfigParser.js#L92


Due to legacy factors, the package names of my Android and iOS apps are different. Currently Cordova seems to be injecting the widget id attribute from config.xml into both when building. Is there no way to customize this? If I edit the AndroidManifest.xml directly, I expect it will get overwritten pretty soon.

Thanks.

解决方案

This is now built into CLI (finally):

In you your config.xml file-

Example:

<widget
    android-packageName="com.example.android"
    ios-CFBundleIdentifier="com.example.ios">

Source:

https://github.com/apache/cordova-lib/blob/master/cordova-lib/src/configparser/ConfigParser.js#L92

这篇关于在Cordova中,如何为ios和android指定不同的包名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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