首页 > 解决方案 > android studio avd manager 无效选项——'-enable-whpx'

问题描述

我在使用 android studio avd manager 运行任何模拟器时遇到错误:

...AppData\Local\Android\Sdk\emulator/emulator-x86.exe: invalid option -- '-enable-whpx' 

这是详细模式的一部分:

emulator: Checking whether Windows Hypervisor Platform (WHPX) is available.
emulator: Could not load library WinHvPlatform.dll
emulator: WHPX is either not available or not installed.
emulator: CPU Acceleration: working
emulator: CPU Acceleration status: HAXM version 7.2.0 (4) is installed and usable.

Windows Hypervisor Platform 在 Windows 功能中进行了检查,并且WinHvPlatform.dll存在于C:\Windows\System32

如何启用或安装 WHPX?

标签: androidandroid-studioandroid-emulatorandroid-sdk-toolsavd-manager

解决方案


只需更改模拟器引擎即可解决我的问题。

根据文档-engine,您可以使用标志指定模拟器引擎。classic使用引擎发生上述错误。当我将引擎更改为autoqemu2模拟器启动时没有错误。要更改引擎,请使用命令行转到.../sdk/emulator目录并运行:

emulator.exe -list-avds

这将输出你的虚拟设备名称

然后运行:

emulator.exe -avd YOUR_DEVICE_NAME -engine qemu2

或者

emulator.exe -avd YOUR_DEVICE_NAME -engine auto

我希望这能帮到您。


推荐阅读