Cordova: Is it possible to have different app IDs for android and ios platforms?

谁说胖子不能爱 提交于 2019-11-28 07:30:10

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-common/src/ConfigParser/ConfigParser.js#L99

ingaham

Yes, you can do that. There is more option for them, it's depends on how do you build your Android application (how do you create your apk).

If you create the apk using cordova, first you have to decode your apk:

apktool d <apkname>.apk <directory to decode>
e.g: 
apktool d your.apk decodedir

Change the package="com.StackOverflowExample.MyQuestion" string in AndroidManifest.xml.

Encode your apk:

apktool b <directory> <new apk name>
e.g:
apktool b testdir/ your.repacked.apk

If you create the apk using any Android developer tools, you can change the id in the appropriate xml file (AndroidManifest.xml), and build the app.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!