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?
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
}
}
[...]
}