Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between gradlew build and gradlew assembleRelease

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?

like image 290
Amey Jahagirdar Avatar asked Oct 24 '16 13:10

Amey Jahagirdar


People also ask

What is gradlew bundleRelease?

Run the following in a terminal: cd android. ./gradlew bundleRelease. Gradle's bundleRelease will bundle all the JavaScript needed to run your app into the AAB (Android App Bundle).

What is the difference between assembleRelease and bundleRelease?

Usage. I use assembleRelease to build an apk that I want to share with other people. I use installRelease when I want to test a release build on a connected device. I use bundleRelease when I am uploading my app to the Play Store.

What does gradlew assembleRelease do?

build - Assembles and tests this project. If you want a specific flavor or buildtype use: assembleDebug - Assembles all Debug builds. assembleRelease - Assembles all Release builds.

What is gradlew build?

Gradle is a build system. This gradle-wrapper is kind of the primary interface to to build Android projects. It the part of Gradle-build-system and does some primary check if gradle in installed or not. gradlew. bat - its a batch file used on Windows.


2 Answers

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
        }
    }


   [...]
}
like image 100
Alessandro Verona Avatar answered Oct 21 '22 09:10

Alessandro Verona


You can run these commands:

assemble - Assembles all variants of all applications and secondary packages.
build - Assembles and tests this project.

If you want a specific flavor or buildtype use:

assembleDebug - Assembles all Debug builds.
assembleRelease - Assembles all Release builds.

In your case use:

./gradlew assembleRelease
like image 42
Gabriele Mariotti Avatar answered Oct 21 '22 07:10

Gabriele Mariotti