在DevEco Studio 3.1.1 Release版本中的Device Manager中创建本地的模拟器,创建phone-x86-api9模拟器成功,但是启动该新建的模拟器一直显示"HarmonyOS"logo图片,然后一直卡在这里,运行结果如下所示:
检查模拟器日志文件Emulator.log发现存在如下问题:
2024-06-20 10:34:57.131 [Info] set "HarmonyOS_HVD_HOME" : "D:\\Huawei\\HarmonyOSEmulator\\deployed"
2024-06-20 10:34:57.192 [Info] whpx unavailable.
2024-06-20 10:35:01.228 [Info] Use haxm as hardware accelerator.
2024-06-20 10:35:01.232 [Info] Find the free port: 8554
2024-06-20 10:35:02.837 [Info] Starting qemu.
2024-06-20 10:39:41.432 [Info] Wait for saving snapshot..
2024-06-20 10:39:42.741 [Info] Succeeded in saving snapshot!
2024-06-20 10:39:43.477 [Info] qemu stopped, exit code is 0
2024-06-20 10:43:08.119 [Info] set "HarmonyOS_HVD_HOME" : "D:\\Huawei\\HarmonyOSEmulator\\deployed"
2024-06-20 10:43:08.202 [Info] whpx unavailable.
2024-06-20 10:43:15.169 [Info] Use haxm as hardware accelerator.
2024-06-20 10:43:15.174 [Info] Find the free port: 8554
2024-06-20 10:43:16.324 [Info] Starting qemu.
2024-06-20 10:52:04.335 [Info] Wait for saving snapshot..
2024-06-20 10:52:05.210 [Info] Succeeded in saving snapshot!
2024-06-20 10:52:06.022 [Info] qemu stopped, exit code is 0
2024-06-20 14:19:19.679 [Info] set "HarmonyOS_HVD_HOME" : "D:\\Huawei\\HarmonyOSEmulator\\deployed"
2024-06-20 14:19:19.836 [Info] whpx unavailable.
2024-06-20 14:19:28.278 [Info] Use haxm as hardware accelerator.
2024-06-20 14:19:28.283 [Info] Find the free port: 8554
2024-06-20 14:19:30.420 [Info] Starting qemu.
问题在于 :whpx unavailable
日志中提到的whpx是Microsoft 的 Hyper-V 和 Windows 虚拟机监控程序平台 (WHPX)。
解决之道是 :启动Windows 虚拟机监控程序平台和虚拟机平台
勾选如上图红色箭头所示的内容,然后重启电脑,重启DevEco Studio,启动模拟成功,运行如下图所示: