How to open AVD Manager GUI without opening Android Studio?

ぐ巨炮叔叔 提交于 2019-12-11 01:32:10

问题


As I'm not developing my app with Android Studio, but I'm still using the Android emulator.

What's a nice way for me start up my emulator without doing this?

  1. Open Android Studio
  2. Open some project
  3. Click the AVD Manager button

I'm not looking for a complete CI replacement, but if there's a long command I can run to open the GUI I'm happy.


回答1:


What about a script that show current avds defined and let you choose which one start ? I called it avdmanager.bat in root of SDK (variable ANDROID_HOME set on SDK root needed):

@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
SET count=0
FOR /F "tokens=* USEBACKQ" %%F IN (`%ANDROID_HOME%\emulator\emulator.exe -
list-avds`) DO (
  SET /a count=!count!+1
  SET var!count!=%%F
)
for /l %%i in (1,1,%count%) do echo %%i) !var%%i!
@echo digit number of virtual machine to run or 'q' to quit
set /p choice=""
if "%choice%"=="q" goto end
@echo !var%choice%!
%ANDROID_HOME%\emulator\emulator.exe -avd !var%choice%!
:end
ENDLOCAL



回答2:


Just a minor fix with the command -list-avds in @alrama's answer (the extra space), I cannot add comments yet.

@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
SET count=0
FOR /F "tokens=* USEBACKQ" %%F IN (`%ANDROID_HOME%\emulator\emulator.exe -list-avds`) DO (
  SET /a count=!count!+1
  SET var!count!=%%F
)
for /l %%i in (1,1,%count%) do echo %%i) !var%%i!
@echo digit number of virtual machine to run or 'q' to quit
set /p choice=""
if "%choice%"=="q" goto end
@echo !var%choice%!
%ANDROID_HOME%\emulator\emulator.exe -avd !var%choice%!
:end
ENDLOCAL


来源:https://stackoverflow.com/questions/47941999/how-to-open-avd-manager-gui-without-opening-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!