英文:
android emulator is not working due to haxm?
问题
我正在尝试在Android Studio上运行Android模拟器,但它始终不断提示说HAXM未安装,并始终提供安装HAXM的选项,我每次都安装了它,然后它显示安装成功,但再次运行模拟器时又显示HAXM未安装。
我尝试了网上找到的所有方法,但模拟器无法启动,一直显示HAXM未安装,但当我尝试安装它时,它显示已经安装。
英文:
I am trying to run android emulator on android studio but it always kept prompting that haxm is not installed and always give option to install haxm and i installed it every time then it shows its successfully done then again when i run emulator it show haxm is not installed.
I tried every thing that I found on internet. But emulator is not starting it kept showing haxm is not installed but when i try to installed it show its already installed.
答案1
得分: 0
- 检查是否已安装
sc query intelhaxm
[SC] EnumQueryServicesStatus:OpenService FAILED 1060:
指定的服务不存在作为已安装的服务。
服务未安装,需要安装
-
安装
haxm-7.8.0-setup.exe
,我从 https://github.com/intel/haxm/releases 下载了 -
检查是否已安装
sc query intelhaxm
SERVICE_NAME: intelhaxm
TYPE : 1 KERNEL_DRIVER
STATE : 1 STOPPED
WIN32_EXIT_CODE : 31 (0x1f)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
如果它像这样运行,它将要求停止 Hyper-V。
-
bcdedit /set hypervisorlaunchtype off
操作已成功完成。
它还会要求重新启动以使禁用操作生效。 -
重启
再次查询服务状态 -
sc query intelhaxm
SERVICE_NAME: intelhaxm
TYPE : 1 KERNEL_DRIVER
STATE : 4 RUNNING
(STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
从 Android SDK 检查
- Android\Sdk\emulator>emulator-check.exe accel
accel:
0
HAXM 版本 7.8.0 (4) 已安装并可用。
运行带有内核日志的仿真后
- 在 qemu 日志中我看到 4 个遭遇
8.1. VERBOSE | CPU Acceleration status: HAXM version 7.8.0 (4) is installed and usable.
8.2. INFO | argv[16] = "-enable-hax"
8.3. INFO | Concatenated QEMU options: "lala;a-bla-bla-bla pstore.bin -cpu android64 -enable-hax
8.4. HAX is working and emulator runs in fast virt mode.
希望这对你有所帮助。
附言:有时我必须从 Studio 运行仿真器两次才能启动,否则没有问题...
英文:
I can not say what you did. Bu what is what I did for it to work.
As admin from command prompt
- check if installed
sc query intelhaxm
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->
[SC] EnumQueryServicesStatus:OpenService FAILED 1060:
The specified service does not exist as an installed service.
<!-- end snippet -->
Service not installed, need to install
-
install
haxm-7.8.0-setup.exe
. I downloaded from https://github.com/intel/haxm/releases -
check if installed
sc query intelhaxm
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->
SERVICE_NAME: intelhaxm
TYPE : 1 KERNEL_DRIVER
STATE : 1 STOPPED
WIN32_EXIT_CODE : 31 (0x1f)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
<!-- end snippet -->
It will say to stop Hyper-V if it works like this.
4.bcdedit /set hypervisorlaunchtype off
The operation completed successfully.
it will also ask to restart for disable operation to to take effect.
-
restart
Query againg for service state -
sc query intelhaxm
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->
SERVICE_NAME: intelhaxm
TYPE : 1 KERNEL_DRIVER
STATE : 4 RUNNING
(STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
<!-- end snippet -->
From android SDK check
7. Android\Sdk\emulator>emulator-check.exe accel
accel:
0
HAXM version 7.8.0 (4) is installed and usable.
accel
After runnin an emulation with kernel logs
- I see in qemu logs 4 encounters
>8.1. VERBOSE | CPU Acceleration status: HAXM version 7.8.0 (4) is installed and usable.
>8.2. INFO | argv[16] = "-enable-hax"
>8.3. INFO | Concatenated QEMU options: "lala;a-bla-bla-bla pstore.bin -cpu android64 -enable-hax
>8.4. HAX is working and emulator runs in fast virt mode.
I hope it helps.
p.s. someone I had to run emulator from Studio twice for it to kick in otherwise no issues...
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论