cordova-android
cordova-android copied to clipboard
build variants
Feature Request: Build Variants
Motivation Behind Feature
I would like the ability to create a development test version of my app. The dev version of the app should be able to be installed on devices alongside the latest release version. To allow this, I must change the app id to something unique. I also want to change the name to "appname-dev" to distinguish it from the release version on the user's app launcher.
Native Android has variants: https://developer.android.com/studio/build/build-variants
Native iOS has targets: https://developer.apple.com/library/archive/documentation/ToolsLanguages/Conceptual/Xcode_Overview/WorkingwithTargets.html
I searched and found some other people expressing similar interest: https://stackoverflow.com/questions/35731142/build-variants-with-ionic-cordova https://stackoverflow.com/questions/53521813/manage-multiple-build-variants-using-cordova-ionic-android-prject
Feature Description
I want to be able to specify a build variant (or target?) on the CLI.
cordova build android --variant=dev
That would change the built app's widget id to "com.myco.appname_dev" and the name to "appname-dev".
To make this feature more general-purpose, perhaps the variants are defined in a file and each selects a separate config.xml.
Alternatives or Workarounds
Currently I am editing config.xml by hand to change the id and name properties. But it is error-prone and tedious. Also, each time I change the ID, it seems I have to remove and re-add the platforms to avoid build errors.