Skip to content

Instantly share code, notes, and snippets.

@reggiegutter
Created September 1, 2021 15:33
Show Gist options
  • Save reggiegutter/b2325af15149b7b54225606d98c3d861 to your computer and use it in GitHub Desktop.
Save reggiegutter/b2325af15149b7b54225606d98c3d861 to your computer and use it in GitHub Desktop.
Run AVD from terminal in windows machines
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment