I have a multi-project (~10 modules) of which building takes about 20-30 seconds each time. When I press Run in Android Studio, I have to wait every time to rebuild the app,
A trivial change (to a resoruce xml) still took 10 minutes.
As @rivare says in his answer, a command line build is mutch faster (took this down to 15 seconds).
Here are some steps to at least make a trivial build fast from the command line for Windows.
Go to your projects root (where the gradlew.bat is):
cd c:\android\MaskActivity
execute the build:
gradlew assembleDebug
uninstall the apk from the phone directly (drag it to uninstall).
When the build is finished, kill the BIG java process using Windows Task Manager.
OR if you have unix tools on your Windows machine:
ps
"pid" 's are shown:
kill -9
Now install your apk:
adb -d install C:\Android\MaskActivity\app\build\outputs\apk\app-debug.apk