在Android Studio用户界面的Tools菜单中依次选择Android〉AVD Manager。
新建一个虚拟机,然后启动报错,
Cannot launch AVD in emulator.
Output:
emulator: ERROR: x86_64 emulation currently requires hardware acceleration!
Please ensure Intel HAXM is properly installed and usable.
CPU acceleration status: HAX kernel module is not installed!
日你个x, what the fuck.
这里也有人遇上了同样的问题: 不过他的容易搞定。
在Android SDK 里下载这个插件、安装即可:
可是安装的时候,遇上了新的错误:
重启,在主板的BIOS里把 VT-x 开启了就行了。
可是,卧槽,明明已经是开启的啊,这什么情况? 开始怀疑是不是主板太老,,,,,
google了一下, 在stackoverflow 上发现了解决方法:
Just follows these steps:Go to Control Panel → Program and Feature.Click on Turn Window Features on and off. A window opens.Uncheck Hyper-V option and restart your system.Now, you can Start HAXM installation without any error.
好吧, 老衲在安装win10的时候开了Hyper-V, 就是你搞的。 去控制面板里把它卸载了,重启, 发现网卡列表里的虚拟网卡全部没了, O(∩_∩)O哈哈~ 没了就没了,太多看着烦。
继续安装HAXM。
刷刷,完成,启动虚拟机, 在console里看到:
"F:\Program Files\Android\sdk\tools\emulator.exe" -netdelay none -netspeed full -avd Nexus_5_API_23
emulator: device fd:1056
HAXM is not working and emulator runs in emulation mode
emulator: The memory needed by this AVD exceeds the max specified in your HAXM configuration.
emulator: AVD RAM size = 1536 MB
emulator: HAXM max RAM size = 1024 MB
emulator: You might want to adjust your AVD RAM size and/or HAXM configuration to run in fast virt mode.
emulator: warning: opening audio input failed
creating window 0 0 438 729
emulator: emulator window was out of view and was recentered
eglMakeCurrent failed
卧槽, 你又是咋了, cmd -> sc query interhaxm 里已经能看到hax is running.....
居然这次是说内存要调整,,,太矫情了罢,
老衲就满足你吧~~~, 编辑 AVD, 把内存设置成768M, 启动, 哇咔咔~~
"F:\Program Files\Android\sdk\tools\emulator.exe" -netdelay none -netspeed full -avd Nexus_5_API_23
emulator: device fd:1040
HAXM is working and emulator runs in fast virt mode
emulator: warning: opening audio input failed
creating window 0 0 438 729
emulator: emulator window was out of view and was recentered
哈O(∩_∩)O哈!