Keeping Multiple Build Types on Same Device

October 14, 2017 Android

It’s not uncommon to run both debug and release builds on your device. It’s impossible by default because package names are the same. This can be fixed by setting a custom application ID suffix in app/build.gradle for a build type or a flavor.

buildTypes {
    debug {
        applicationIdSuffix ".debug"
    }
    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

Now your debug build type has a .debug suffix and can be installed side-by-side with the release one.

comments powered by Disqus