Run AVD Emulator without Android Studio

后端 未结 30 1883
不知归路
不知归路 2020-11-28 17:39

is there a way to run the emulator without starting the Android Studio first. Perhaps from the command line. I know that this feature was available in older versions and has

相关标签:
30条回答
  • 2020-11-28 17:57

    For Windows

    In case anyone looking for shortcut / batch script - Gist - Download batch file.

    @echo off
    IF [%1]==[] (GOTO ExitWithPrompt)
    set i=1
    FOR /F "delims=" %%i IN ('emulator -list-avds') DO (
        set /A i=i+1
        set em=%%i
        if %i% == %1 (
            echo Starting %em%
            emulator -avd %em%
            EXIT /B 0
        )
    )
    GOTO :Exit
    :ExitWithPrompt
    emulator -list-avds
    echo Please enter the emulator number to start
    
    :Exit
    EXIT /B 0
    

    Usage

    D:\>start-emulator
    Nexus_5_API_26
    Please enter the emulator number to start
    
    D:\>start-emulator 1
    Starting Nexus_5_API_26
    HAX is working and emulator runs in fast virt mode.
    
    0 讨论(0)
  • 2020-11-28 17:58

    If you are on windows, what about a shortcut ? It is very easy to place whatever you want ant the icon is descriptive and nice.

    • First, navigate to your android sdk, probably at C:\Users\YOURUSERNAME\AppData\Local\Android\Sdk\tools\
    • Then right click on emulator.exe and then click create shortcut.
    • Your new and shiny shortcut gets created, probably with a predefined name.
    • Right click on the shortcut, and on the target field (my computer is on spanish) add an extra parameter with the name of your device with an @ in front (take a look at the picture below )

    now you can do whatever yhou want with that shortcut, put on the desktop, bind it to the start-menu or whatever

    0 讨论(0)
  • 2020-11-28 17:58

    Assuming you have installed Android studio properly,Open a command prompt and type emulator -list-avds which will display all the devices and then type emulator @avd_name where avd_name is the the name of your emulator installed.

    0 讨论(0)
  • 2020-11-28 18:00

    (Only for Windows) Why to torture yourself? Make a Simple BAT file ! :

    1. Open Notepad
    2. Create the command as shown below
    3. Save as *.bat
    4. (Optional) Create a shortcut to that *.bat, rename shortcut and change icon

    Here is the command:

    cd /d yourSdkPath\emulator && emulator -avd yourAVDName

    Example:

    cd /d D:\Android_SDK\emulator && emulator -avd Nexus_5_API_28

    0 讨论(0)
  • 2020-11-28 18:02

    The path for emulator is

    /Users/<Username>/AppData/Local/Android/sdk/tools
    
    0 讨论(0)
  • 2020-11-28 18:03

    For Windows users:

    • Copy your Emulator name.
    • Go to this directory: C:\Users\[yourusername]\AppData\Local\Android\Sdk\emulator
    • Right click on emulator.exe and send as a shortcut to where you want.
    • Right click on shortcut .exe file and add your Emulator name just copied to end of target textbox with @ symbol.
    • Double click your shortcut and done!

    C:\Users\[yourusername]\AppData\Local\Android\Sdk\emulator\emulator.exe @EmulatorName

    0 讨论(0)
提交回复
热议问题