androidandroid-gradle-pluginandroid-keystoreandroid-build-type

Sign custom buildtype with a generic debug keystore


Is it possible to create a custom buildtype and use the debug's keystore to sign it?

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

    debug {
        debuggable true
        // debug specific configs here
    }

    staging {
        // staging specific configs here
    }
}

I tried setting debubbable true for my staging but did not work. I cannot use the initWith config because debug configs could interfere with my staging configs. I know I can create a signingConfig but this involves creating a separate key. I am looking at using the debug's default keystore.

Help please.


Solution

  • You could try this:

    staging {
        signingConfig signingConfigs.debug
        ...
    }