Ad

Android: Whitelabel App With A Debug Directory Per Each Flavor

- 1 answer

I am creating some app with multiple branding variations. One of the requirements is that we deliver 2 environments per client, so I need to have one release build per client for debug and release.

The code in build gradle file is

android {
...
 buildTypes {
    release {
        minifyEnabled false
    }
    debug {
        applicationIdSuffix ".debug"
    }
}
flavorDimensions "branding"
productFlavors {
    mainCompany {
        dimension "branding"
        applicationIdSuffix  ".mainCompany"
    }
    client1 {
        dimension "branding"
        applicationIdSuffix  ".client1"
    }
    client2 {
        dimension "branding"
        applicationIdSuffix  ".client2"
    }
    client3 {
        dimension "branding"
        applicationIdSuffix  ".client3"
    }
}

The directory structure tree is:

.
├── androidTest
│   └── java
├── client1
│   └── res
├── client2
│   └── res
├── client3
│   └── res
├── debug
│   └── res
├── main
│   ├── AndroidManifest.xml
│   ├── java
│   └── res
├── mainCompany
│   └── res
└── test
    └── java

And the question is, how do I create a debug folder per client? Such folder should have just the app icon and the strings with only the app title

Ad

Answer

It seems this was a stupid question. At the end, I found the solution in the android docs. Problem was I didn't know how to search this correctly :(

Here is the piece of doc that answers my question.

And the folders in my case should be called:

client1Debug

client2Debug

client3Debug

mainCompanyDebug

And this works exactly as I expected

Ad
source: stackoverflow.com
Ad