代码之家  ›  专栏  ›  技术社区  ›  Nimesh Madhavan

Android Emulator on Hyper V错误

  •  26
  • Nimesh Madhavan  · 技术社区  · 6 年前

    微软最近宣布支持在hyper v上运行android模拟器( https://blogs.msdn.microsoft.com/visualstudio/2018/05/08/hyper-v-android-emulator-support/ )

    我正尝试使用以下命令行在我的Windows 10(2018年4月更新)支持Hyper V的机器上启动Android Emulator 27.2.9.0:

    > cd C:\Users\<username>\AppData\Local\Android\sdk\emulator\lib\qt\lib
    > ..\..\..\emulator -avd <avd name> -feature WindowsHypervisorPlatform
    

    我收到以下错误信息:

    emulator: ERROR: x86 emulation currently requires hardware acceleration!
    Please ensure Windows Hypervisor Platform (WHPX) is properly installed and usable.
    CPU acceleration status: Please disable Hyper-V before using the Android Emulator.  Start a command prompt as Administrator, run 'bcdedit /set hypervisorlaunchtype off', reboot.
    

    我已经将windowshypervisorplatform=联机添加到c:\ users\.android\advancedfeatures.ini中,但这没有帮助。

    我错过了什么?

    4 回复  |  直到 6 年前
        1
  •  48
  •   Nimesh Madhavan    6 年前

    嗯,原来我启用了“超V”,但是 “Windows管理程序平台 “未启用。(谁知道这是两件不同的事!)。启用后,仿真器开始工作。

    enter image description here

        2
  •  5
  •   ttt    6 年前

    我刚刚卸载了“hyper-v hypervisor”,仿真器开始工作了。我用的是windows 10(1803)。如果我安装“hyper-v hypervisor”,模拟器将停止工作。

    enter image description here

        3
  •  5
  •   Dinesh Rajan    6 年前

    有了最新的android工作室,你不需要在amd上使用hyper-v。

    只需启用“windows管理程序平台”(打开和关闭windows功能屏幕),x86映像就会自动可用

    enter image description here

        4
  •  4
  •   James    6 年前

    有几件事我做了让我的电脑工作。

    • 安装Visual Studio 15.8预览版1或更高版本
    • 在visual studio预览中删除并重新安装模拟器
    • 我从android sdk管理器中的“extras”中删除了haxm(从 visual studio菜单)。
    • advancedfeatures.ini的路径是C:\users\your username\advancedfeatures.ini以设置Windowshypervisorplatform=on
    • 打开打开或关闭Windows功能,然后选中Hyper-V和Windows虚拟机监控程序平台复选框。(需要重新启动)

    Microsoft提供了另一个指南: https://docs.microsoft.com/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration?tabs=vswin