Issue
I just wondered if there is a way to configure Android Studio such that it automatically starts a specific virtual device (AVD) in the emulator when i start Android Studio itsself.
Thank you in advance! Marc
Solution
I always forget emulator command options and my avd names so I made a bat script that show all the avds defined and let me choose which one start. I quite often need to start an avd without waiting Android Studio up and running. Could this solve your problem ? 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
Answered By - alrama
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.