In Cordova, how can I specify different package names for ios and android?

smoyth picture smoyth · Oct 10, 2014 · Viewed 9.1k times · Source

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.

Answer

tabrindle picture tabrindle · Jan 9, 2015

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

Edit: (Cordova-Lib has since been moved)

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