Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Mobile Development
  3. Android
  4. What is the right technique to automate Android builds from command line with gradlew command?

What is the right technique to automate Android builds from command line with gradlew command?

Scheduled Pinned Locked Moved Android
androidjavahelpquestionannouncement
1 Posts 1 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Prahlad Yeri
    wrote on last edited by
    #1

    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
    compileReleaseUnitTestSources

    Build 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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups