DEV Community

Kelvin Pere
Kelvin Pere

Posted on

How to Run Android Studio Emulator via CMD

This as been a pain to me. I have been trying to open my Android Studio Emulator from the Command Prompt, but I have been getting funny error messages which I don't understand.

I did whatever a typical developer will do, which is going to Google.com and searching => "open android studio emulator from cmd".

And I saw a link to a question answered on SO (Stackoverflow)https://stackoverflow.com/questions/44521081/android-how-launch-emulator-from-command-line/44521194. To make your life easy, you can follow the steps below in order to run Android Studio Emulator via CMD.

Steps:

  • You have to first add this line |C:\Users<User>\AppData\Local\Android\Sdk\emulator| to your environmental variables.If you don't know how to or you haven't done it before. Just do a quick Google search on how to add a file path to environmental variables on Windows or Mac.

When you are done, then you can then move to the next step.

  • Open CMD and run it as an Administrator. I don't think its a requirement to do so. When you have done that, type this command on your CMD => |emulator -list-avds| Emulator stands for the in-built Emulator you have already installed on Android Studio. list-avds Just list all the emulator you have. If its one, that the one that would be shown.

  • Now the last thing is to run the emulator with this command => |emulator -avd Nexus_One_API_27| Nexus_One_API_27 is just the name of the emulator i have currently on the machine.

After typing that command, just press ENTER and it should start running.

And that's all!

P.S * This article assumes you have already installed, downloaded and configured AVD (Android Virtual Device) and all you want to do is run it from the command line.

Top comments (0)