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:
Install to the connected emulator:
adb install <module>/build/outputs/apk/myapp-debug.apk
Build for specific variant: