无法在 macOS 10.13 上启动 AVD

Can't launch AVD on macOS 10.13

我在 Android studio 3.0 中创建了一些 AVD,但我无法启动它们。我使用以下命令启动它们:

./emulator @Nexus_5X_API_17

日志:

emulator: WARNING: encryption is off
Hax is enabled
Hax ram_size 0x60000000
Failed to open vm 3
Failed to create HAX VM
No accelerator found.
failed to initialize HAX: Invalid argument

当我重新安装 "Intel x86 Emulator Accelerator(HAXM installer)" 时,日志:

HAXM silent installation only supports macOS from 10.8 to 10.12 !

不知道跟这个有没有关系

之后,我尝试安装virtualBox来安装genymotion,但是我发现当我点击virturalBox.dmg时,安装程​​序崩溃了。

你能帮帮我吗?谢谢。

转到您的 SDK 安装目录,然后手动 运行 HAXM 安装程序。请参阅页面上的第 4 步:https://developer.android.com/studio/run/emulator-acceleration.html#vm-mac

从技术上讲,HAXM 仅在 MacOS 10.12 (Sierra) . Since MacOS 10.13 is still in beta, there may be a bug or incompatible API. If the wizard does no work, please file a bug here for the Android Emulator dev team to investigate further: https://source.android.com/source/report-bugs

之前得到官方支持

在 macOS 上使用新的 Hypervisor.Framework 支持而不是 HAXM,如 issue filed for this:

的评论中所述

Try running the emulator on Canary channel 26.1.x (API 25/26 recommended) with Hypervisor.Framework; put the text "HVF = on" in ~/.android/advancedFeatures.ini (create this file if it doesn't exist already).

您可以下载并安装最新版本的haxm https://github.com/intel/haxm/releases/latest

在 HAXM 的 install/reinstall 上,您得到:

HAXM silent installation only supports macOS from 10.8 to 10.12 !

来自https://issuetracker.google.com/issues/62395878#comment44

in System Preferences > Security & Privacy > General, there was a message “System software from developer xxx was blocked from loading.” with an Allow button. Clicking the allow button enabled HAXM again

以下步骤对我有用:

  1. 从 android studio SDK 管理器中卸载 HAXM(工具->Android->SDK 管理器->SDK 工具,然后通过取消选中它来卸载 'Intel x86 Emulator Accelerator (HAXM)'。
  2. 从英特尔网站下载 HAXM 版本 6.2.1 zip 文件https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager-end-user-license-agreement-macosx
  3. 安装 .dmg 文件
  4. 重新启动计算机
  5. 打开具有 x86_64 图片的 AVD,它应该可以工作。

转到工具->Android->SDK管理器,然后在SDK工具中搜索Intel x86 Emulator Accelerator (HAXM installer)并更新到最新版本,重启即可!

我刚刚重新下载了模拟器,它成功了。