您的位置:首页 > 移动开发 > Android开发

Android emulator 不能使用的问题

2015-09-15 22:39 597 查看

Possible Solution: Android emulator 不能使用

Bug出现

在Android Studio中初次运行模拟器(Android emulator),使用默认的AVD设置也就是


报错,代码确认没有问题(之前一直按照Google的帮助文档做):

emulator: ERROR: x86 emulation currently requires hardware acceleration!

Please ensure Intel HAXM is properly installed and usable.

CPU acceleration status: HAX kernel module is not installed!

从错误信息中可以看出是Intel HAXM没有安装的问题,因为CPU是Intel的,在其上面运行模拟器,而 HAXM又是什么呢?Google一下会得到下面的结果:

The Intel Hardware Accelerated Execution Manager (Intel® HAXM) is a hardware-assisted virtualization engine (hypervisor) that uses Intel Virtualization Technology (Intel® VT) to speed up Android app emulation on a host machine. In combination with Android x86 emulator images provided by Intel and the official Android SDK Manager, HAXM allows for faster Android emulation on Intel VT enabled systems.

其实Windows下也有个类似功能的Microsoft-Hyper-V,只是Android emulator用的是Intel(或amd,与CPU有关)的程序,Windows的Hyper-V反而可能导致Intel的HAXM被屏蔽,这算是另一个bug了。

可能的原因和相应的办法

根本上的原因就是Intel HAXM无法使用(解答从Stack OverflowHow to Enable Intel VT-x in Your Computer’s BIOS or UEFI Firmware上收集)

第一种可能:Android的SDK没有安装,可以通过打开对应Android sdk目录下的SDK manager.exe查看:



我的是在Extras的最后一项(带HAXM install),如果右边显示Not installed就说明是相应的包没有安装,还要注意有可能是有包却没有安装,解决办法:

Go to extras > intel > Hardware_Accelerated_Execution_Manager and run the file named “intelhaxm-android.exe”

更多细节在上面两个网站。如果报错“Intel virtualization technology (vt,vt-x) is not enabled“可能是下面两个问题:

第二种可能:You must enable Intel Virtualization Technology. 要进入BIOS或者UEFI中设置Intel Virtualization Technology为 enabled,Stack Overflow的回答很详细就不多说了。

Windows的Microsoft-Hyper-V屏蔽了Intel的HAXM,2和3都会导致intelhaxm-android.exe不能安装。这里看一下How to Enable Intel VT-x in Your Computer’s BIOS or UEFI Firmware的说明就好,倒不用把微软的程序给卸了,只要以管理员身份运行cmd,运行下列操作:

dism.exe /Online /Disable-Feature:Microsoft-Hyper-V
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息