Android emulator not opening in vs code

Viewed 1971

When I use `flutter in vs code I am able to start the android emulator easily but when I do it in vs code with react native I get this:

Command 'React Native: Launch Android Emulator' resulted in an error (Error while executing command 'emulator -list-avds': Command failed: emulator -list-avds 'emulator' is not recognized as an internal or external command, operable program or batch file. )

This error is killing me please help. I am using expo CLI with react native.

1 Answers

In windows you can go to Start > Control Panel > System > Advanced System Settings > Environment Variables . Then under System Variables find Path and double click on it and add this path C:\Users\<your-username>\AppData\Local\Android\sdk\emulator or in windows 7 append the path with a ; at the end of line.

Then click the OK buttons to get out.

If you already have a Command Prompt window open, close it then re-open and the emulator -list-avds command should then work.

Related