Android Emulator not running on M1
I cannot start the android emulator V30.9.4
I got this error message:
INFO | Android emulator version 30.9.4.0 (build_id 7759208) (CL:N/A)
WARNING | unexpected system image feature string, emulator might not function correctly, please try updating the emulator.
WARNING | cannot add library /Users/-/Library/Android/sdkPreview/emulator/qemu/darwin-aarch64/lib64/vulkan/libvulkan.dylib: failed
WARNING | cannot add library /Users/-/Library/Android/sdkPreview/emulator/lib64/vulkan/libvulkan.dylib: failed
ERROR | EglOsGlLibrary: Could not open GL library libGLESv2.dylib [dlopen(libGLESv2.dylib, 0x0002): tried: '/Users/-/Library/Android/sdkPreview/emulator/lib64/qt/lib/libGLESv2.dylib' (no such file), '/Users/-/Library/Android/sdkPreview/emulator/lib64/gles_swiftshader/libGLESv2.dylib' (code signature]
ERROR | EglOsEglDispatcher: Could not open EGL library libEGL.dylib [dlopen(libEGL.dylib, 0x0002): tried: '/Users/-/Library/Android/sdkPreview/emulator/lib64/qt/lib/libEGL.dylib' (no such file), '/Users/-/Library/Android/sdkPreview/emulator/lib64/gles_swiftshader/libEGL.dylib' (code signature in <5C3A]
It works with sudo privilege.
- Try to use the host system's OpenGL driver:
cd $ANDROID_SDK_ROOT/emulator
./emulator -avd <Pixel_4_API_29> -gpu host
- Then go to Emulator Settings -> Settings -> Advanced.
- Select OpenGL ES renderer "Autodetect based on host".
- Save & restart.
P.S. Get list of avds:
./emulator -list-avds
https://developer.android.com/studio/run/emulator-acceleration#command-gpu