Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio: Build type release /debug - what relevance does this have?

I just created an apk via android studio and it gave me an option of creating my own key, which i did but then asked me what type of build it is i.e. debug or release. Also list of flavours, which none exists.

Where is this information setup, in the gradle file ?

So if I leave build type set to Release, what relevance does this have.

I am having problems sourcing any documentation on this.

Any ideas?

like image 513
Martin Avatar asked Jan 09 '15 13:01

Martin


1 Answers

The difference between debug and release builds is for example, that you can get the log output from the debug build but not from the release build.

Debug builds can be signed with the default keystore, the release builds have to be signed with your created keystore.

You can define the buildTypes in your App's module gradle. Here's an example:

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

Also you can define different flavors, like this:

productFlavors {
    pro {
        applicationId = "xx.xxx.xxx.pro"
        signingConfig signingConfigs.Pro
    }
    lite {
        applicationId = "xx.xxx.xxx.lite"
        signingConfig signingConfigs.Lite
    }
}

This system makes it easier to create different apks from one Codebase (free or paid version, etc.)

like image 136
carstenbaumhoegger Avatar answered Sep 21 '22 10:09

carstenbaumhoegger