I’m trying to start the emulator with this command emulator -avd Pixel_4_API_30
but it gives me an error:
[8633370112]:ERROR:android/android-emu/android/qt/qt_setup.cpp:28:Qt library not found at ../emulator/lib64/qt/lib
Could not launch '/Users/primulax/../emulator/qemu/darwin-x86_64/qemu-system-aarch64': No such file or directory
Android Studio specs:
Build #AI-203.7717.56.2031.7935034, built on November 21, 2021
Runtime version: 11.0.10+0-b96-7249189 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.2
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 8
Registry: external.system.auto.import.disabled=true
Non-Bundled Plugins: org.jetbrains.kotlin
✅ I was able to run with ~/Library/Android/sdk/emulator/emulator -avd Pixel_4_API_30
with this command
3
Answers
If you have Android Studio installed, you can run the emulator from terminal without having started Android Studio first.
First of all, run
to get a list of all the available Android virtual devices that you have installed.
Then, copy the name of the virtual device you want to use and run
where you replace "YOUR_DEVICE_NAME" with the name of a virtual device that was listed in the installed virtual devices list.
This info and more that you may find useful can be found in the official documentation.
Now for the error you get it’s most possibly due to a wrong file path. It seems that others have also faced this issue and a bug has been opened before here. The most common solution proposed is to launch emulator from the
directory in command line.
Also, before trying this or any other solution listed in this issue tracker, firstly make sure that you have installed from the SDK Manager the Android Emulator in SDK Tools.
I just experienced the same issue on a freshly setup machine, emulator installed through SDK manager and all.
The error message says it all actually: If you go to
/Users/primulax/../emulator/qemu/
on your machine, you’ll notice that of course there is nodarwin-x86_64
directory, butdarwin_aarch64
, since you are on an M1 machine. Whatever the reason is the emulator looks in the wrong directory, if you just duplicate thedarwin_aarch64
folder and name your copydarwin-x86_64
, it works as intended. Not ideal, but it’s a workaround until this path-problem is fixed.Edit: Please take a look at @Andrew Stromme’s comment. Of course symlinking is a much more elegant solution to this problem!
Use
~/Library/Android/sdk/emulator/emulator
instead of~/Library/Android/sdk/tools/emulator
on MacOS, for Ubuntu use~/Android/Sdk/emulator/emulator
.