DEV Community

Tulio Calil
Tulio Calil

Posted on

How to Open Android emulator without Android Studio

Let's see how to open Android Virtual Device (AVD) directly from the terminal without opening Android Studio!

First, we need to get our Android SDK location, here is a link to help you find it. For me (MacOS) is: /Users/<user>/Library/Android/sdk.

Now Open the .rc file in your favorite editor:

# if you use ZSH
nano ~/.zshrc
# if you use BASH
nano ~/.bashrc
Enter fullscreen mode Exit fullscreen mode

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

  export PATH="/Users/<your-user-name>/Library/Android/sdk/emulator:$PATH"
Enter fullscreen mode Exit fullscreen mode

Save the file and go back to the terminal and reload the new configuration:

source ~/.zshrc
#or
source ~/.bashrc
Enter fullscreen mode Exit fullscreen mode

Now you can get it running from any location:

emulator -avd EmulatorName
Enter fullscreen mode Exit fullscreen mode

To see all available emulators just run: emulator -list-avds.

Like this? Check my blog!
Follow me on Twitter

Oldest comments (0)