解决AMD CPU 启动Android模拟器时无法安装Intel HAXM 的问题

刚买的电脑,是用的AMD的CPU,在安装Android开发环境时,遇到以下问题:

Failed to install Intel HAXM. For details, please check the installation log: "C:\Users\zhangqs\AppData\Local\Temp\haxm_log9.txt"
HAXM installation failed. To install HAXM follow the instructions found at: https://software.intel.com/android/articles/installation-instructions-for-intel-hardware-accelerated-execution-manager-windows
Installer log is located at C:\Users\zhangqs\AppData\Local\Temp\haxm_log9.txt
Installer log contents:
=== Logging started: 2020/1/4  13:34:14 ===
This computer does not support Intel Virtualization Technology (VT-x) or it is being exclusively used by Hyper-V. HAXM cannot be installed. 
Please ensure Hyper-V is disabled in Windows Features, or refer to the Intel HAXM documentation for more information.

=== Logging stopped: 2020/1/4  13:34:14 ===
Done

网上搜了很多办法,试过下面几种,都不行。

1.关闭Hyper-V。

2.禁用Hyper-V相关的服务。

3.单独下载Intel HAXM安装。

试了很多次,都失败了。

我的电脑配置是:

在网上一搜,说是Android Studio已经支持AMD CPU的,后面在Android SDK配置项中终于发现有这么一项。

(根据下面图中2处红色标记就可以找到Android对应的AMD模拟器驱动)

貌似看到了希望,经过一番查找,Android官方有说明的,英文好的同学可以直接看原文:

https://androidstudio.googleblog.com/2019/10/android-emulator-hypervisor-driver-for.html

简单的来说,就是以下步骤:

1.开机进入BIOS,设置CPU开启虚拟化。是否开启,可以通过任务管理器确定。

2.关闭Win10的Hyper-V和Windows Hypervisor Platform 和 Windows Sandbox。

(如果不知道是该勾选,还是不勾选,跟下面截图的选中状态一致即可。)

对应中文版的系统是:

3.打开命令行,进到:$ANDROID_SDK_ROOT\extras\google\Android_Emulator_Hypervisor_Driver.

($ANDROID_SDK_ROOT\ 是Android SDK的安装路径,如果不是安装在默认路径,需要你手动改一下)

运行:silent_install.bat,如果执行结果返回是:STATE: 4 RUNNING,说明安装成功。

至此,就可以使用Android针对AMD处理器的高性能模拟器了。

参考内容:

https://androidstudio.googleblog.com/2019/10/android-emulator-hypervisor-driver-for.html

发布了438 篇原创文章 · 获赞 229 · 访问量 304万+

猜你喜欢

转载自blog.csdn.net/a497785609/article/details/103832368