Using Gradle is very simple. Here is an excerpt from one of my Gradle files:
android { // ... defaultConfig { resValue "string", "app_name", "<app name>" // ... } buildTypes { release { // ... } debug { resValue "string", "app_name", "<app name> (debug)" applicationIdSuffix ".debug" // ... } } }
The key part for another installation is to use the applicationIdSuffix installed in the debug assembly. Under the hood, this basically does the same as suggested by the force; it changes the application id of your application.
Setting resValue app_name allows us to have different application names, this greatly simplifies keeping track of which installation is the one that (since both applications will get the same name otherwise).
Remember to remove app_name from your strings.xml and fill in your own application name instead of <app name> if you decide to set the application name in the Gradle file, as I did above.
Marcus
source share