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?
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).
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.
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.
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.
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
}
}
[...]
}
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With