I am trying to run a Android Emulator by using AVD Manager. this is my avd:
and this is what happens by starting:
I have a Macbook Pro Retina. Installed the Haxm driver direct from intel page.
No emulator is working. All get the same "error" message.
Running Command (This error was when i used Homebrew for installing Android-sdk and Android-platform-tools | anyone who get the same problem should remove this or look where the conflict is)
export ANDROID_EMULATOR_DEBUG=1 test20 emulator:Found AVD name 'test20' emulator:Found AVD target architecture: x86 emulator:Looking for emulator-x86 to emulate 'x86' CPU emulator:Probing program: ./emulator-x86 emulator:Probing path for: emulator-x86 emulator:Found target-specific emulator binary: /usr/local/bin/emulator-x86 emulator:Probing for: /usr/local/bin/libOpenglRender.dylib emulator:Probing for: /usr/local/bin/lib/libOpenglRender.dylib emulator:Probing for: /usr/local/lib/libOpenglRender.dylib emulator:Probing for: /usr/local/bin/lib64OpenglRender.dylib emulator:Probing for: /usr/local/bin/lib/lib64OpenglRender.dylib emulator:Probing for: /usr/local/lib/lib64OpenglRender.dylib emulator:Could not find OpenGLES emulation host libraries! emulator: ERROR: This AVD's configuration is missing a kernel file!! emulator -avd test21 emulator:Found AVD name 'test21' emulator:Found AVD target architecture: x86_64 emulator:Looking for emulator backend for x86_64 CPU emulator:Probing program: ./emulator-x86_64 emulator:Probing path for: emulator-x86_64 emulator:Looking for emulator-x86 to emulate 'x86_64' CPU emulator:Probing program: ./emulator-x86 emulator:Probing path for: emulator-x86 PANIC: Missing emulator engine program for 'x86_64' CPUS. After I fixed the problem with Homebrew:
I tried a bit around and found this:
emulator64-x86 -avd test20 Creating filesystem with parameters: Size: 69206016 Block size: 4096 Blocks per group: 32768 Inodes per group: 4224 Inode size: 256 Journal blocks: 1024 Label: Blocks: 16896 Block groups: 1 Reserved block group size: 7 Created filesystem with 11/4224 inodes and 1302/16896 blocks emulator: ERROR: Could not load OpenGLES emulation library: dlopen(lib64OpenglRender.dylib, 1): image not found emulator: WARNING: Could not initialize OpenglES emulation, using software renderer. HAX is working and emulator runs in fast virt mode qemu: could not load PC BIOS 'bios.bin' For all who has the same problem, maybe these steps help:
Run your Emulator in Debug mode:
export ANDROID_EMULATOR_DEBUG=1 emulatorName If there is a path that look strange check for other installations like Homebrew and remove the conflict (uninstall one)
When the library is missing you need to export the variable:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ANDROID_HOME/tools/lib And when error "qemu: could not load PC BIOS 'bios.bin'" appears, one fix is to run the emulator with the full path:
/Applications/Android\ -avd test20 In your case it is maybe a other path. 432 Answers
If you are using macOS, add both Android SDK emulator and tools directories to the path:
Step 1: In my case the order was important, first emulator and then tools.
export ANDROID_SDK=$HOME/Library/Android/sdk export PATH=$ANDROID_SDK/emulator:$ANDROID_SDK/tools:$PATH Step 2: Reload you .bash_profile Or .bashrc depending on OS
Step 3: Get list of emulators available: $emulator -list-avds
Step 4: Launch emulator from the command line and Replace avd with the name of your emulator $emulator @avd
Don't forget to add the @ symbol.
This was tested with macOS High Sierra 10.13.4 and Android Studio 3.1.2.
8I had this issue after upgrading Android Studio to 3.2 and even upgrade some SDK-Packages.
The cause was that the path to emulator had changed, so don't use ...../Android/Sdk/tools/emulator but instead ....../Android/Sdk/emulator/emulator.
The following work-around to start emulator-x86 worked for me:
cd $SDK/tools; ln -s emulator64-x86 emulator-x86 Or on Windows open Command Prompt (Admin)
cd %ANDROID_SDK_ROOT%\tools mklink emulator64-x86.exe emulator-x86.exe And now the emulator will start from the SDK manager.
Note: Emulators islocated in emulators folder in more recent versions.
Navigate to the emulator folder located within Android SDK folder / emulator
cd ${ANDROID_HOME}/emulator
Then type these command to open emulator without android studio:
$ ./emulator -list-avds $ ./emulator -avd Nexus_5X_API_28_x86 Nexus_5X_API_28_x86 is My AVD you need to give your AVD name
For Windows 10, 5.29.18 :
Using command promt I just got in the emulator directory:
cd C:\Android\sdk\emulator and then typed the command:
emulator -avd Nexus_S_API_27 Nexus_S_API_27 is the name of my custom emulator.
Othewize it will abuse :
PANIC: Missing emulator engine program for 'x86' CPU. 1In my case by doing which emulator it returned $ANDROID_HOME/tools/emulator but it should be $ANDROID_HOME/emulator/emulator
So I just added $ANDROID_HOME/emulator before $ANDROID_HOME/tools in the PATH variable and it works fine now
On Mac after installing Android Studio IDE android-studio-ide-173.4907809-mac.dmg and using studio SDK Manager to install SDK Tools
Add to your PATH using ~/.profile or ~/.bash_profile and make sure you have $ANDROID_HOME/emulator in your $PATH before $ANDROID_HOME/tools like so:
export ANDROID_HOME=$HOME/Library/Android/sdk export PATH=$PATH:$ANDROID_HOME/emulator export PATH=$PATH:$ANDROID_HOME/tools export PATH=$PATH:$ANDROID_HOME/tools/bin export PATH=$PATH:$ANDROID_HOME/platform-tools alias androidemulator='emulator -avd Nexus_5X_API_28_x86' 1There are two named emulator binary file. which located under $SDK/tools/emulator another under $SDK/emulator/
- please make sure you have the right emulator configure(need add
$SDK/emulatorto your env PATH
I have write a script to help me to invoke the avd list
#!/bin/bash -e echo "--- $# $(PWD)" HOME_CURRENT=$(PWD) HOME_EMULATOR=/Users/pcao/Library/Android/sdk/emulator if [ "$#" -eq 0 ] then echo "ERROR pls try avd 23 or avd 28 " fi if [ "$1" = "23" ] then echo "enter 23" cd $HOME_EMULATOR ./emulator -avd Nexus_5_API_23_Android6_ & cd $HOME_CURRENT fi if [ "$1" = "28" ] then echo "enter 28" cd $HOME_EMULATOR ./emulator -avd Nexus_5_API_28_GooglePlay_ & cd $HOME_CURRENT fi 1Tested on macOS Mojave 10.14.5.
Reason and Solution:
we use sdk/tools/emulator, we should use sdk/emulator.
WM-C02WM0T3HTD8:~ zgong$ emulator -avd Pixel_3_XL_API_Q_x86 PANIC: Unknown AVD name [Pixel_3_XL_API_Q_x86], use -list-avds to see valid list. HOME is defined but there is no file Pixel_3_XL_API_Q_x86.ini in $HOME/.android/avd (Note: Directories are searched in the order $ANDROID_AVD_HOME, $ANDROID_SDK_HOME/avd, and $HOME/.android/avd) WM-C02WM0T3HTD8:~ zgong$ emulator -avd Pixel_3_XL_API_Q PANIC: Missing emulator engine program for 'x86' CPU. We could check the emulator location:
WM-C02WM0T3HTD8:~ zgong$ which emulator /Users/zgong/Library/Android/sdk/tools/emulator I did a bunch of googling and while most of the answers were about setting the paths correctly in terminal, it turns out it was actually to do with a shift in a recent version of the SDK, where the emulator app is located in /emulator instead of /tools. Leaving this here in case anyway runs into the same problem.
We need to use as below:
{sdk location}/emulator -avd {avd name}
Here is the real output:
WM-C02WM0T3HTD8:~ zgong$ /Users/zgong/Library/Android/sdk/emulator/emulator -avd Pixel_3_XL_API_Q pc_memory_init: above 4g size: 40000000 emulator: WARNING: UpdateCheck: Failure: Error emulator: WARNING: UpdateCheck: failed to get the latest version, skipping check (current version '29.2.1-5889189') emulator: WARNING: UpdateCheck: Failure: Error WebSocketServer listening on port 55850 Qt WebEngine ICU data not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64/resources. Trying parent directory... Qt WebEngine ICU data not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64/resources. Trying parent directory... Qt WebEngine ICU data not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64. Trying application directory... Qt WebEngine ICU data not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64. Trying application directory... Installed Qt WebEngine locales directory not found at location /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64/translations/qtwebengine_locales. Trying application directory... Qt WebEngine locales directory not found at location /Users/zgong/Library/Android/sdk/emulator/lib64/qt/libexec/qtwebengine_locales. Trying fallback directory... Translations MAY NOT not be correct. Installed Qt WebEngine locales directory not found at location /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64/translations/qtwebengine_locales. Trying application directory... Qt WebEngine locales directory not found at location /Users/zgong/Library/Android/sdk/emulator/lib64/qt/libexec/qtwebengine_locales. Trying fallback directory... Translations MAY NOT not be correct. Path override failed for key ui::DIR_LOCALES and path '/Users/zgong/.QtWebEngineProcess' Path override failed for key ui::DIR_LOCALES and path '/Users/zgong/.QtWebEngineProcess' Qt WebEngine resources not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64/resources. Trying parent directory... Qt WebEngine resources not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64. Trying application directory... Qt WebEngine resources not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64/resources. Trying parent directory... Qt WebEngine resources not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64. Trying application directory... [0403/154905.171893:WARNING:resource_bundle_qt.cpp(116)] locale_file_path.empty() for locale [0403/154905.171871:WARNING:resource_bundle_qt.cpp(116)] locale_file_path.empty() for locale Qt WebEngine ICU data not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64/resources. Trying parent directory... Qt WebEngine ICU data not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64. Trying application directory... Installed Qt WebEngine locales directory not found at location /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64/translations/qtwebengine_locales. Trying application directory... Qt WebEngine locales directory not found at location /Users/zgong/Library/Android/sdk/emulator/lib64/qt/libexec/qtwebengine_locales. Trying fallback directory... Translations MAY NOT not be correct. Path override failed for key ui::DIR_LOCALES and path '/Users/zgong/.QtWebEngineProcess' Qt WebEngine resources not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64/resources. Trying parent directory... Qt WebEngine resources not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64. Trying application directory... [0403/154907.393116:WARNING:resource_bundle_qt.cpp(116)] locale_file_path.empty() for locale 1In my Case this works like a charm:
Open Terminal
Type:
open ~/.bash_profileAdd the following lines:
export ANDROID_SDK=$HOME/Library/Android/sdk export PATH=$ANDROID_SDK/emulator:$PATH export PATH=$ANDROID_SDK/tools:$PATH export PATH=$ANDROID_SDK/tools/bin:$PATH export PATH=$ANDROID_SDK/platform-tools:$PATH export ANDROID_SDK_ROOT=$ANDROID_SDK export ANDROID_AVD_HOME=$HOME/.android/and alias emulator='$ANDROID_SDK/emulator/emulator'Save (hit Command+S). You may close the window or not.
Back to Terminal, type:
source ~/.bash_profileShow the installed emulators:
emulator -list-avds, something like:Pixel_2_API_29 Pixel_3a_API_29 Pixel_C_API_29Last, run the emulator:
emulator @Pixel_2_API_29
Simply follow the below steps specific to mac:
go to:
/Users/{username}/Library/Android/sdk/emulator./emulator -list-avds./emulator @avdName
ON WINDOWS - updating the system path worked for me. Create an environment variable for the location of your sdk called ANDROID_SDK then add these to your path, in this order:
%ANDROID_SDK%\emulator %ANDROID_SDK%\platform-tools %ANDROID_SDK%\tools %ANDROID_SDK%\tools\bin You can also try what is suggested here:
For short, run the emulator from the sdk/emulator folder
In my case, I needed to install Android Emulator from Sdk manager and it get fixed
Hit below command. It work for me. Android has changed the emulator directory from /tools to sdk/emulator
/Users/yourusername/Library/Android/sdk/emulator/emulator -avd Pixel_API_27 You cannot start emulator-x86 directory, because it needs to have LD_LIBRARY_PATH setup specially to find the PC Bios and GPU emulation libraries (that's why 'emulator' exists, it modifies the path, then calls emulator-x86).
Did you update the first ouput ? It looks like 'emulator' is still finding ' /usr/local/bin/emulator-x86'
1Try the following work-around to start emulator-x86:
export LD_LIBRARY_PATH=$SDK/tools/lib:$LD_LIBRARY_PATH $SDK/tools/emulator-x86 <your-other-options> Where $SDK is the path to your SDK installation. That's in a nutshell what 'emulator' tries to do. You might want to start emulator64-x86 instead of emulator-x86 if the former exists though.
4Had the same issue on Windows7 64bit. The reason why it didn't was missing emulator-x86.exe file under sdk/tools. Fixed it by deleting Android SDK Tools using Android SDK Manager and installing it again. The file now exists and emulator works as expected.
I faced the same problem and never worked for me except until go to the emulator folder, I tried to export the emulator folder but not worked for me
cd $android_home/emulator and run emulator , in the end, I write Elias for the command in .bashrc file
alias emulator="$ANDROID_HOME/emulator/emulator" 3Avast Antivirus is sensing emulator-arm.exe as a thread and blocking from some reasons. When you add it exclusions in Virus Chest page with right-click -> "restore and add to exclusions" it's not solved in future runnings. To solve this permanently in Avast 2015 :
Settings ->
Active Protection ->
File System Shield ->
Customize ->
Exclusions then add thread as a exclusion . And then press ok.
0Delete both Android SDK Tools and Android SDK PLatform-tools; then download both packages again. Now, create a new emulator and start it; it will work. You might be able to run your old emulators.
1This worked for me on macOS:
echo 'export PATH=$PATH:'$HOME'/Library/Android/sdk/emulator:'$HOME'/Library/Android/sdk/tools:'$HOME'/Library/Android/sdk/platform-tools' >> ~/.bash_profile source ~/.bash_profile First, check the path you get with which emulator and if you get /usr/local/share/android-sdk/tools/emulator then remove or rename that emulator (it's an old one) and instead use /usr/local/share/android-sdk/emulator/emulator which is the new path.
If you're using Homebrew and installed with brew cask install android-sdk android-studio then you need to:
- Verify your .bashrc or .zshrc that you have the correct paths set:
# Remove $HOME/Library/Android paths # The new way is to use ANDROID_SDK_ROOT export ANDROID_SDK_ROOT="/usr/local/share/android-sdk" # For good measure, add old paths to be backwards compatible with any scripts or whatnot. And to hopefully decrease confusion: export ANDROID_HOME=$ANDROID_SDK_ROOT export ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk-bundle Then restart your terminal shell, and check your paths are as you expect them:
set | grep ANDROIDFinally, with correct paths set, you typically need to install the ndk and some tools:
sdkmanager "ndk-bundle" "cmake;3.10.2.4988404" "lldb;3.1"and check the list for other pieces like this
sdkmanager --list
I also closed Android Studio, removed the old Android/Sdk folder under my $HOME folder, and restarted Studio, and when it asked where my Sdk had gone, I pasted the Sdk path: /usr/local/share/android-sdk
For Ubuntu users
If you are getting PANIC: Missing emulator engine program for 'x86' CPU. this error
Try starting your emulator from the emulator folder in SDK, like above
usama@usama-Aspire-V5-471:~/Android/Sdk/emulator$ ./emulator -avd Pixel_2_API_29 1Latest Android Studio path has changed.
Use below path to locate emulator
cd /Users/<username>/Library/Android/sdk/emulator And then run this command
./emulator -avd Pixel_2_XL_API_28 My emulator name is "Pixel 2 XL API 28"
Enjoy!
Example that works for me on OSX / MacOS (replace name of device)
~/Library/Android/sdk/emulator/emulator @Pixel_2_API_28 -no-snapshot -wipe-data Adding a virtual device with the lowest possible Android version that was acceptable in my case worked for me. (Before that I'd tried several recent Android versions and had been getting the Missing emulator engine program for 'x86_64' CPUS error.)
My problem was using the integrated terminal in VS Code. That showed me a different path setting (and so tools path instead of emulator path was shown in the first place). All you need is to change the global vscode settings by using the correct bash as described here:
The issue stems from SDK changes, since emulator now has it's own directory.
I didn't notice (nor care) to run an outdated emulator, while it still worked ...
This is a stalled SDK migration. When running with the -verbose switch:
emulator -avd Nexus_6_API_R -verbose One can see where it starts to panic:
emulator:try dir C:\Android\tools emulator:Looking for emulator-x86 to emulate 'x86' CPU emulator:Probing program: C:\Android\tools/emulator-x86.exe PANIC: Missing emulator engine program for 'x86' CPU. But there is no emulator-x86.exe available and the actual emulator resides in directory emulator. After uninstalling "SDK Tools" (while trying to reinstall them), that one entry unexpectedly vanished from the list, leaving an empty tools directory, which may be deleted and removed from PATH.
Using x86_64 emulation is not required nor suggested (as this will run the stalled version of the emulator). Adapting to the SDK path changes by uninstalling "SDK Tools" is rather "the answer". One probably could just replace tools with emulator on PATH, but this leaves clutter behind.
For comparison, the actual startup sequence of version 30.3.5.0 should look about like this:
emulator: Android emulator version 30.3.5.0 (build_id 7033400) (CL:N/A) emulator: Found AVD name 'Nexus_6_API_R' emulator: Found AVD target architecture: arm emulator: argv[0]: 'emulator.exe'; program directory: 'C:\Android\emulator' And if there may be follow up errors alike:
PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value This means that the system image path inside the *.ini may be wrongful.
It helps to download the x86 system image and then create a new emulator.
Here the issue was caused by the default AVD using hardware accelerated GLES when setting is "auto". Had to edit the AVD and set it to "Software - GLES 2.0"

