Android 更新 Big Sur 11.3 后模拟器不工作或不显示
Android Emulator not working or showing after update Big Sur 11.3
嗨,我今天将 mac os big sur 11.2 更新到了 11.3。
I am using Android Studio 4.1.3
Build #AI-201.8743.12.41.7199119, built on March 10, 2021
Runtime version: 1.8.0_242-release-1644-b3-6915495 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.16
GC: ParNew, ConcurrentMarkSweep
Memory: 1979M
Cores: 16
Android 模拟器未打开,但它在 avd 管理器的扩展坞中打开。
我试过
。
但它对我不起作用我按照给定的命令使用命令
~/Library/Android/sdk/emulator/emulator -gpu host -feature HVF -avd PIXEL_3A_API_30
emulator: Android emulator version 30.5.5.0 (build_id 7285888) (CL:N/A)
handleCpuAcceleration: feature check for hvf
cannot add library /Users/vmodi/Library/Android/sdk/emulator/qemu/darwin-x86_64/lib64/vulkan/libvulkan.dylib: failed
added library /Users/vmodi/Library/Android/sdk/emulator/lib64/vulkan/libvulkan.dylib
cannot add library /Users/vmodi/Library/Android/sdk/emulator/qemu/darwin-x86_64/lib64/vulkan/libMoltenVK.dylib: failed
HVF error: HV_ERROR
qemu-system-x86_64: failed to initialize HVF: Invalid argument
Failed to open the hax module
No accelerator found.
qemu-system-x86_64: failed to initialize HAX: Operation not supported by device
added library /Users/vmodi/Library/Android/sdk/emulator/lib64/vulkan/libMoltenVK.dylib
任何人都知道如何解决这个问题。
根据 this post 这似乎是在 OSX 11.3 中更新的一些 hypervisor
权利的问题。
在模拟器应用程序中提供官方修复之前,可以通过创建具有以下内容的entitlements.xml
文件来修复
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.hypervisor</key>
<true/>
</dict>
</plist>
然后是运行
codesign -s - --entitlements entitlements.xml --force ~/Library/Android/sdk/emulator/qemu/darwin-x86_64/qemu-system-x86_64
(qemu路径可能需要根据AndroidSDK的安装路径进行调整)
这个解决方案也是有人建议的 ,为了方便起见,我在这里重复了一遍。
嗨,我今天将 mac os big sur 11.2 更新到了 11.3。
I am using Android Studio 4.1.3
Build #AI-201.8743.12.41.7199119, built on March 10, 2021
Runtime version: 1.8.0_242-release-1644-b3-6915495 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.16
GC: ParNew, ConcurrentMarkSweep
Memory: 1979M
Cores: 16
Android 模拟器未打开,但它在 avd 管理器的扩展坞中打开。
我试过
~/Library/Android/sdk/emulator/emulator -gpu host -feature HVF -avd PIXEL_3A_API_30
emulator: Android emulator version 30.5.5.0 (build_id 7285888) (CL:N/A)
handleCpuAcceleration: feature check for hvf
cannot add library /Users/vmodi/Library/Android/sdk/emulator/qemu/darwin-x86_64/lib64/vulkan/libvulkan.dylib: failed
added library /Users/vmodi/Library/Android/sdk/emulator/lib64/vulkan/libvulkan.dylib
cannot add library /Users/vmodi/Library/Android/sdk/emulator/qemu/darwin-x86_64/lib64/vulkan/libMoltenVK.dylib: failed
HVF error: HV_ERROR
qemu-system-x86_64: failed to initialize HVF: Invalid argument
Failed to open the hax module
No accelerator found.
qemu-system-x86_64: failed to initialize HAX: Operation not supported by device
added library /Users/vmodi/Library/Android/sdk/emulator/lib64/vulkan/libMoltenVK.dylib
任何人都知道如何解决这个问题。
根据 this post 这似乎是在 OSX 11.3 中更新的一些 hypervisor
权利的问题。
在模拟器应用程序中提供官方修复之前,可以通过创建具有以下内容的entitlements.xml
文件来修复
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.hypervisor</key>
<true/>
</dict>
</plist>
然后是运行
codesign -s - --entitlements entitlements.xml --force ~/Library/Android/sdk/emulator/qemu/darwin-x86_64/qemu-system-x86_64
(qemu路径可能需要根据AndroidSDK的安装路径进行调整)
这个解决方案也是有人建议的