Build from command line

Gradle Tasks

We mentioned in the section Install Gradle about gradle tasks. The task that we are interested here is to be able to build, compile and output .apk file - which falls under the category of gradle tasks viz. Build tasks.

Gradle clean assembleDebug

  • The "clean" task will clean the build folder within the project
  • The "assembleDebug" gradle task will follow the build process as mentioned in the architecture view in the section Build Android App

Below is how the process would look when building an app

A successful build should look as below

apk file - debug mode

The output we are interested in is the .apk file generally found in the relative folder path /app/build/outputs/apk

The debug app is generally named "app-debug.apk"

apk file - release mode

./gradlew assembleRelease (puts the apk in app/output/apk/release)

Note: To build app in release mode, we will need to sign the app in release mode with keystore and private keys as detailed here

Another Note: We will be using app built for debug mode in this book

results matching ""

    No results matching ""