Compile Android projects from CLI

  1. Install java:
sudo pacman -S jdk8-openjdk jre8-openjdk jre8-openjdk-headless
  1. Install Android SDK:
sudo pacman -S snapd
sudo snap install androidsdk
  1. Configure your SDK location in your ~/.bash_profile or ~/.bashrc:
export ANDROID_SDK_ROOT=~/snap/androidsdk/current/AndroidSDK/
  1. Install the platform tools for your target android version:
androidsdk "platform-tools" "platforms;android-28"
  1. Compile the project. This will install all dependencies, make sure to accept licenses when prompted.
./gradlew assembleDebug
  1. If you haven’t done already, then Enable ‘Developer options’ on your phone

  2. Connect your phone and install the debug APK

adb install ./app/build/outputs/apk/debug/app-debug.apk