What is the difference between gradlew build and gradlew assembleRelease

Amey Jahagirdar picture Amey Jahagirdar · Oct 24, 2016 · Viewed 25.7k times · Source

I want to build apk from command line with the help of gradle. Which command should I use to build apks for only release flavours?

Answer

Alessandro Verona picture Alessandro Verona · Oct 24, 2016

Debug

./gradlew

Release

./gradlew assembleRelease

your gradle file should contains:

android {
   [...]
signingConfigs {
        release {
            storeFile file("../keystore.jks")
            storePassword "pwd"
            keyAlias "alias"
            keyPassword "pwd"
        }
    }

    buildTypes {

        release {
            signingConfig signingConfigs.release
        }
    }


   [...]
}