How to generate android apk with different package name using ionic cordova build android

We have an application that has same code but different apks for different countries.

As of now I am Changing id in config.xml then removing and adding android platform to generate a build. I want to make such automated system like i can make multiple apks from the existing parent code with different package names and version codes.I want to make such a script that when i run it on command line i will be able to build a new apk from the parent code just by package name.

<widget id=“com.p.stg.ApplicationName” …> will be default package name.

com.proj.stg.ApplicationName another is com.proj.ws.stg.ApplicationName.

What approach should I use to change package name dynamically?

1 Like

One approach is described here: https://stackoverflow.com/questions/46345603/cordova-config-xml-environment-variables

Haven’t tested it yet myself…