How to start the Android Emulator from the terminal command line. It‘s helpful if you want to automate Android testing on an emulator locally on your Mac machine. Add below commands to a shell script and then just run your Android Espresso tests.

Script starts emulator, runs gradle command $gradle cAT, then shuts down emulator.

Start Android emulator:

  1. Go to your Android sdk directory (ex: open terminal and $cd Users/engineering/Library/Android/sdk/tools/emulator) and enter below command: