系统版本:MacOS Big Sur 11.3
AndroID emulator版本:30.5.5
系统升级后AndroID模拟器无法运行,通过命令行启动模拟器运行报错如下:
% emulator -feature HVF -avd Pixel_2_API_29 handlecpuacceleration: feature check for hvfemulator: INFO: QtLogger.cpp:68: Warning: QMetaObject::connectSlotsByname: No matching signal for on_new_posture_requested(int) ((null):0, (null))emulator: INFO: QtLogger.cpp:68: Warning: QMetaObject::connectSlotsByname: No matching signal for on_dismiss_posture_selection_dialog() ((null):0, (null))cannot add library /Users/zhangzhenli/library/AndroID/sdk/emulator/qemu/darwin-x86_64/lib64/vulkan/libvulkan.dylib: Failedadded library ./lib64/vulkan/libvulkan.dylibcannot add library /Users/zhangzhenli/library/AndroID/sdk/emulator/qemu/darwin-x86_64/lib64/vulkan/libmoltenVK.dylib: FailedHVF error: HV_ERRORqemu-system-x86_64: Failed to initialize HVF: InvalID argumentHAX is working and emulator runs in fast virt mode.qemu-system-x86_64: Back to HAX acceleratoradded library ./lib64/vulkan/libmoltenVK.dylibemulator: INFO: GrpcServices.cpp:301: Started GRPC server at 127.0.0.1:8554, security: Local
问题原因谷歌爬了一些发现了大概,简单说就是Big Sur 11.3针对安全性做了升级,现有的qemu没有及时适配。
解决方法要解决此问题,我们要做的就是为qemu-system-x86_64二进制添加新的权限声明。
创建一个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>
签名qemu二进制文件: ~ % cd ~/library/AndroID/sdk/emulator/ emulator % codesign -s - --enTitlements enTitlements.xml --force ~/library/AndroID/sdk/emulator/qemu/darwin-x86_64/qemu-system-x86_64
再次启动 emulator % ./emulator -List-avds Pixel_2_API_29emulator %./emulator -feature HVF -avd Pixel_2_API_29handlecpuacceleration: feature check for hvfemulator: INFO: QtLogger.cpp:68: Warning: QMetaObject::connectSlotsByname: No matching signal for on_new_posture_requested(int) ((null):0, (null))emulator: INFO: QtLogger.cpp:68: Warning: QMetaObject::connectSlotsByname: No matching signal for on_dismiss_posture_selection_dialog() ((null):0, (null))cannot add library /Users/zhangzhenli/library/AndroID/sdk/emulator/qemu/darwin-x86_64/lib64/vulkan/libvulkan.dylib: Failedadded library ./lib64/vulkan/libvulkan.dylibcannot add library /Users/zhangzhenli/library/AndroID/sdk/emulator/qemu/darwin-x86_64/lib64/vulkan/libmoltenVK.dylib: Failedadded library ./lib64/vulkan/libmoltenVK.dylibemulator: INFO: GrpcServices.cpp:301: Started GRPC server at 127.0.0.1:8554, security: Local
以上HVF error: HV_ERROR错误消除,成功启动了。
参考原文
链接: https://www.arthurkoziel.com/qemu-on-macos-big-sur/.
以上是内存溢出为你收集整理的修复MacOS Big Sur 下 Android模拟无法运行全部内容,希望文章能够帮你解决修复MacOS Big Sur 下 Android模拟无法运行所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)