慢吞云雾缓吐愁 发表于 2025-2-21 09:07:12

Android Emulator hypervisor driver安装一直弹出黑窗口安装失败

Android Emulator hypervisor driver安装失败办理
朋侪,当你看到这篇文章,信赖之前也搜索过很多办理博客,也信赖了其他大佬说法,是因为电脑CPU差别或硬件情况导致的,终极还得看官方表明。
一、电脑情况和安装地址

github安装链接
电脑安装条件:
1、CPU 具有虚拟化扩展,并且 BIOS 尚未禁用该扩展。(CPU开启虚拟化,使命管理器可以看到,如下图)
2、必须禁用 Hyper-V。 (命令提示符关闭,以管理员身份运行命令提示符,实行命令:
bcdedit /set hypervisorlaunchtype off)
https://i-blog.csdnimg.cn/direct/0fe2721ea33d4c34893ccb19f5ad0030.png
二、勾选Android Emulator hypervisor driver,进行安装:
https://i-blog.csdnimg.cn/direct/11772b5446b74be3bd2065c521db5ce4.png
安装后会报错,同时在{android-sdk}\extras\google\Android_Emulator_Hypervisor_Driver目次下安装文件silent_install.bat 等。
三、在{android-sdk}\extras\google\Android_Emulator_Hypervisor_Driver目次下实行silent_install.bat,报错同步骤二。
办理步骤如下:
1、起首参考了文章:https://blog.csdn.net/qq_37242224/article/details/107625180
安装了工具检测,对我办理题目也没有啥用,
2、然后参考文章:https://blog.csdn.net/gonghui_gonghui/article/details/136069862
这篇文章照旧有作用的,重要是把{android-sdk}\extras\google\Android_Emulator_Hypervisor_Driver
文件夹下的silent_install.bat 内容用以下代码更换掉:
@echo off

:-------------------------------------
Check for admin rights
fltmc >nul 2>&1
if %errorlevel% NEQ 0 (
echo Requesting administrative privileges...
goto getAdmin
)

:gotAdmin
pushd "%CD%"
CD /D "%~dp0"

:--------------------------------------
Parse commands

set action=install

:parseInput
if "%~1"=="" (
goto %action%
)

if /i "%~1"=="-u" (
set action=uninstall
shift
goto parseInput
)

if /i "%~1"=="-v" (
set action=checkinstall
shift
goto parseInput
)

REM Ignore other params
shift
goto parseInput

:getAdmin
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "cmd.exe", "/c %~s0 %*", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B

:install
sc query gvm >nul 2>&1
if %errorlevel% EQU 0 (
sc stop gvm
sc delete gvm
)

RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultInstall 132 .\gvm.inf
if %errorlevel% NEQ 0 (
echo Failed to install GVM
exit /b 1
)

sc start gvm
exit /b 0

:uninstall
sc query gvm >nul 2>&1
if %errorlevel% NEQ 0 exit /b 0

sc stop gvm
sc delete gvm
if %errorlevel% NEQ 0 (
echo Failed to uninstall GVM
exit /b 1
)

exit /b 0

:checkinstall
sc query gvm >nul 2>&1
if %errorlevel% EQU 0 (
exit /b 0
) else (
exit /b 1
)
3、更换完后,在Check for admin rights、 Parse commands前添加REM,如下:
REMCheck for admin rights

REMParse commands
然后再运行silent_install.bat 。
4、信赖有的朋侪照旧会报错,别急,可能你的CPU没有大题目。
下面请看Android Studio官方表明:
https://i-blog.csdnimg.cn/direct/d1381d92d3d54f45ba9bf12d56834eeb.png
信赖看到这就知道了,要保持版本跟服务名称同等,以是请注意看上面图中,即下图对应的版本是2.2.0
https://i-blog.csdnimg.cn/direct/8f1268786b2b4b0a96eb4ee4f213da68.png
以是要在silent_install.bat里把所有的“gvm”改为“”aehd“,然后再运行silent_install.bat,信赖到这步,很多朋侪就会看到乐成的曙光了。
silent_install.bat经过更换、添加、更换“gvm”->“aehd”,完备的更换代码如下:
@echo off

:-------------------------------------
REM Check for admin rights
fltmc >nul 2>&1
if %errorlevel% NEQ 0 (
echo Requesting administrative privileges...
goto getAdmin
)

:gotAdmin
pushd "%CD%"
CD /D "%~dp0"

:--------------------------------------
REM Parse commands

set action=install

:parseInput
if "%~1"=="" (
goto %action%
)

if /i "%~1"=="-u" (
set action=uninstall
shift
goto parseInput
)

if /i "%~1"=="-v" (
set action=checkinstall
shift
goto parseInput
)

REM Ignore other params
shift
goto parseInput

:getAdmin
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "cmd.exe", "/c %~s0 %*", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B

:install
sc query aehd >nul 2>&1
if %errorlevel% EQU 0 (
sc stop aehd
sc delete aehd
)

RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultInstall 132 .\aehd.inf
if %errorlevel% NEQ 0 (
echo Failed to install aehd
exit /b 1
)

sc start aehd
exit /b 0

:uninstall
sc query aehd >nul 2>&1
if %errorlevel% NEQ 0 exit /b 0

sc stop aehd
sc delete aehd
if %errorlevel% NEQ 0 (
echo Failed to uninstall aehd
exit /b 1
)

exit /b 0

:checkinstall
sc query aehd >nul 2>&1
if %errorlevel% EQU 0 (
exit /b 0
) else (
exit /b 1
)
原文参考:
https://blog.csdn.net/gonghui_gonghui/article/details/136069862
https://github.com/google/android-emulator-hypervisor-driver/issues/88
https://blog.csdn.net/qq_37242224/article/details/107625180
https://developer.android.google.cn/studio/run/emulator-acceleration.html?hl=el

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: Android Emulator hypervisor driver安装一直弹出黑窗口安装失败