20

I'm trying to use emulator.exe as android emulator for Charles Proxy. But I have problem, when I launch

emulator @5.1_WVGA_API_28 

I get this error:

PANIC: Missing emulator engine program for 'x86' CPU.

But I can run the emulator from android studio and it's working fine! I have an intel processor.

advert2013
  • 9,734
  • 3
  • 24
  • 35
Marat Mkhitaryan
  • 844
  • 2
  • 11
  • 25

4 Answers4

56

If you want to run emulator from command line,

<your-full-path>/emulator -avd 5.1_WVGA_API_28 

For newer version of Android SDK, the emulator path should be something as below:

/<xxx>/Android/sdk/emulator/emulator

For older version of Android SDK, the emulator path is as below:

/<xxx>/Android/sdk/tools/emulator

Try either one of above to see which is your case.

Here is the official document for Android emulator command line usage: https://developer.android.com/studio/run/emulator-commandline

shizhen
  • 12,251
  • 9
  • 52
  • 88
  • I have two different emulators as u specified, but i couldnt find official documentation which says which emulator is supposed to be used. Why are there two versions ? can we delete one of it safely ? – Sudhir N Apr 03 '23 at 09:54
4

That was not a path/location problem on my PC.

I have to use x86_64 system images to get the emulator working from the command line...

https://stackoverflow.com/a/56099493/531322

KARPOLAN
  • 2,507
  • 1
  • 19
  • 10
2

I have solved the problem. You must install HAX drivers. You can do it here: https://software.intel.com/en-us/articles/intel-hardware-accelerated-execution-manager-intel-haxm Or just do update of SDK:

C:\Users\%username%\AppData\Local\Android\Sdk\tools\android.bat update sdk

Jay Taylor
  • 13,185
  • 11
  • 60
  • 85
Marat Mkhitaryan
  • 844
  • 2
  • 11
  • 25
  • Congrats that you solve it. But ... the error `PANIC: Missing emulator engine program for 'x86' CPU.` is not caused by missing HAX drivers. – shizhen Nov 01 '18 at 05:58
  • @shizhen - If you are commenting upon cookie's answer, that it is not related to missing HAX drivers. Then can you please update us what is the actual reason for the error mentioned? – Akshat Dec 03 '18 at 06:17
  • 2
    @AkshatSharma, Cookie said he could run Emulator from Android Studio, then it means the HAX driver was already properly installed on the machine. This error actually is because of the emulator paths exists at TWO places, you need to try to call the one same as Android Studio refers to. – shizhen Dec 03 '18 at 06:24
  • 1
    @AkshatSharma, Please see my answer to the same question: https://stackoverflow.com/a/52161215/8034839 – shizhen Dec 03 '18 at 06:28
0

@shizen answer worked for me using "...emulator/emulator" but even after changing the path in .zprofile (I use zsh on Mac), it was finding the old emulator. To find out which emulator your system is using, use "which emulator". In my case it was still loading the old one so I deleted the old path (rm -R /usr/local/bin/emulator) and now the correct (new) emulator loads.

GeoNet
  • 1
  • 1