What is the right technique to automate Android builds from command line with gradlew command?
-
I want to build my Android Studio project from command line as opening it consumes too much RAM. Besides, my app is "WebView heavy", most of the work happens in HTML/JS/CSS inside of the webview, so it makes sense to build the APK/AAB directly from command line for testing. So far, I'm able to generate bunlde with the below command after setting the JAVA_HOME to `\path\to\android-studio\jre\jre` gradlew bundle However, this generates only the bundle file (*.aab) and that too the unsigned or debug version. What I want to generate is: 1. Signed *.aab to release on Play Store. 2. Unsigned *.apk for testing. When I list the tasks using `gradlew tasks` command, it gives me the below. What should I do to achieve these objectives? I already tried some other tasks (build and assemble) as parameters but they result in error. **EDIT:** OK, found some helpful information [here](https://developer.android.com/build/building-cmdline). The second one (debug APK) I managed with the `assembleDebug` task. The first one (signing the aab) is still a constraint.
> Task :tasks
Tasks runnable from root project
Android tasks
androidDependencies - Displays the Android dependencies of the project.
signingReport - Displays the signing info for the base and test modules
sourceSets - Prints out all the source sets defined in this project.Build tasks
assemble - Assemble main outputs for all the variants.
assembleAndroidTest - Assembles all the Test applications.
build - Assembles and tests this project.
buildDependents - Assembles and tests this project and all projects that depend on it.
buildNeeded - Assembles and tests this project and all projects it depends on.
bundle - Assemble bundles for all the variants.
clean - Deletes the build directory.
cleanBuildCache - Deletes the build cache directory.
compileDebugAndroidTestSources
compileDebugSources
compileDebugUnitTestSources
compileReleaseSources
compileReleaseUnitTestSourcesBuild Setup tasks
init - Initializes a new Gradle build.
wrapper - Generates Gradle wrapper files.Cleanup tasks
lintFix - Runs lint on all variants and applies any safe suggestions to the source code.
Help tasks
buildEnvironment - Displays all buildscript dependencies declared in root project 'Python MCQ'.
components - Displays the components produced by root