Open Android Emulator from Terminal

A little trick to add the android path to your environment and open the emulator without launching the Android Studio.

Open Android Emulator from Terminal
Photo by Gabriel Heinzer / Unsplash

A little trick to add the android path to your environment and open the emulator without launching the Android Studio.

Find the Android SDK path, here is a link to help you find it. For Mac is some like: /Users/<yout-user-name>/Library/Android/sdk"

Open the .rc file in your favorite editor:

# if you use ZSH
nano ~/.zshrc
# if you use BASH
nano ~/.bashrc

Add this line at the final of the file(your Android SDK path with a /emulator:$PATH at the end):

source ~/.zshrc
#or
source ~/.bashrc

Now you can get it running from any location:

emulator -avd EmulatorName
To see all available emulators and get the name just run: emulator -list-avds.