Manual install APK to Android Emulator for faster builds.

January 08, 2019

Sometimes Android Studio can add a lot of overhead and you may want an easy way to generate an app's APK via the command line. Maybe you're using a CI and don't have Android studio installed, this snippet will help you generate APKs for your apps.

Navigate to your project's root directory (where the project build.gradle is) and run:

Windows:

gradlew assemble

Mac/Linux:

./gradlew assemble

Install to the connected emulator:

adb install <module>/build/outputs/apk/myapp-debug.apk

Extras

Build for specific variant:

Windows:

gradlew assembleDebug

Mac/Linux:

./gradlew assembleDebug