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 vanished since then. But perhaps someone found out how to do it anyways?
30 Answers
The way to run the emulator from the console (I assume that you installed it before, using Android Studio) is:
run
cd ~/Android/Sdk/tools/bin && ./avdmanager list avd
OR
cd ~/Android/Sdk/tools && ./emulator -list-avds
You will get the list od your virtual installed devices. In my case it was:
Available Android Virtual Devices:
Name: Galaxy_Nexus_API_17
Device: Galaxy Nexus (Google)
Path: /home/piotr/.android/avd/Galaxy_Nexus_API_17.avd
Target: Google APIs (Google Inc.)
Based on: Android 4.2 (Jelly Bean) Tag/ABI: google_apis/x86
Skin: galaxy_nexus
Sdcard: /home/piotr/.android/avd/Galaxy_Nexus_API_17.avd/sdcard.img
Copy name of the device you want to run and then
cd ~/Android/Sdk/tools && ./emulator -avd NAME_OF_YOUR_DEVICE
in my case:
cd ~/Android/Sdk/tools && ./emulator -avd Nexus_5X_API_23
You can make a batch file, that will open your emulator directly without opening Android Studio. If you are using Windows:
Open Notepad
New file
Copy the next lines into your file:
cd /d C:\Users\%username%\AppData\Local\Android\sdk\tools emulator @[YOUR_EMULATOR_DEVICE_NAME]Notes:
Replace
[YOUR_EMULATOR_DEVICE_NAME]with the device name you created in emulatorTo get the device name go to:
C:\Users\%username%\AppData\Local\Android\sdk\toolsRun
cmdand type:emulator -list-avdsCopy the device name and paste it in the batch file
Save the file as
emulator.batand closeNow double click on
emulator.batand you got the emulator running!
Try this
1. Complete Video tutorials (For all windows versions)
OR
2. Text tutorials
Open the command prompt and change the directory where your sdk is placed
D:\Softwares\Android\sdk\tools\bin>now add your avdmanager in this,now your full code is
D:\Softwares\Android\sdk\tools\bin>avdmanager list avdit will show you a list of emulator device that you have already created after few seconds
now type
cd..and run your emulator with this cmd, Here my emulator name is Tablet_API_25 so I have typed this name after the -avd.
D:\Softwares\Android\sdk\tools>emulator -avd Tablet_API_25
EDIT : For Android Studio 3.2 or later, the path changes to D:\Softwares\Android\sdk\emulator\emulator -avd Tablet_API_25
i.e. %ANDROID_HOME%\tools\emulator -avd [AVD NAME]
In the ANDROID_HOME folder you will have tools folder
In Mac/Linux
emulator -avd <avdName>
In Windows
emulator.exe -avd <avdName>
If you are using API 24 You can get the names of the emulator from the list
android list avds
If you are using API 25 then you will get it with avdmanager in tools\bin
avdmanager list avds
If you are starting emulator for Flutter applications, then you can run below command -
> flutter emulators --launch [Emulator ID]
In my case, emulator id is Pixel_2_API_29 as i created it with AVD manager in Android studio. so the command in my case is below -
> flutter emulators --launch Pixel_2_API_29
Thanks
Here’s what you need to do:
1.Download and extract the SDK.
2.Open a terminal and navigate to the “tools” directory.
3.Launch the “android” tool (./android if you are currently in the tools directory).
4.Tick off the “SDK Platform” for each version of Android that you’d like to use in your emulator.
5.Click the “Install N Packages” button.
6.Click each package and tick off “Accept License” (legally, I’m probably required to tell you that this step may take several hours as you read each license ;).
7.Done with those licenses? Great. Click “Install”. Wait for the SDK manager to finish installing your packages, then you can close it.
8.Back in your terminal, still in the tools directory, enter ./android avd which will launch the Android Virtual Device Manager.
9.Click “New” and fill out the form to build the device you’d like to emulate. In the “Target” dropdown, you’ll see the SDK Platforms that you installed earlier. If the version you need is missing, you need to go back and install it. Click OK when you’re done.
10.Click on the device that you just created and click the “Start” button, tweak any options that you need on the Launch Options window, and click “Launch”.
Check this question's answer also.
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
Assuming you've got Android Studio installed, and SDK in your PATH, it's:
emulator -avd avd_name
To get a list of AVD names, run:
emulator -list-avds
Source: https://developer.android.com/studio/run/emulator-commandline.html
In Ubuntu 20.04, I found following solution
First You need to export Android path variables. For that :
export ANDROID_SDK=~/Android/Sdk
export PATH=$ANDROID_SDK/emulator:$ANDROID_SDK/tools:$PATH
The paths may change according to your installation path. If Android Studio is installed using Ubuntu Software then path will be same as stated above.
If the export worked correctly, then following command should list your AVD names.
emulator -list-avds
In my case, I got the result
Nexus_5_API_30
Which is the name of my AVD.
If the above command have listed your AVD name, then you could run your AVD by :
emulator @YOUR_AVD_NAME
In my case
emulator @Nexus_5_API_30
You could add the export commands to .bashrc file to avoid typing export command every time you needed to run your AVD .
For Linux/Ubuntu
Create a new File from Terminal as
gedit emulator.sh (Use any Name for file here i have used "emulator")
now write following lines in this file
cd /home/userName/Android/Sdk/tools/
./emulator @your created Android device Name
(here after @ write the name of your AVD e.g
./emulator @Nexus_5X_API_27 )
Now save the file and run your emulator using following commands
./emulator.sh
In case of Permission denied use following command before above command
chmod +x emulator.sh
All set Go..
I am working with a React Native project and I also faced this problem
I solved it by making a .bat file in my desktop that I can open fast
The content of the .bat is
C:\Users\haria\AppData\Local\Android\sdk\emulator\emulator -avd Pixel_2_XL_API_27
Where haria is my Windows username and Pixel_2_XL_API_27 is my emulator name
If you want to see your emulator name, open CMD (or PowerShell) and type (In Windows)
cd C:\Users\haria\AppData\Local\Android\sdk\emulator
Then to see the emulator(s) name
./emulator -list-avds
in 2019 , there might have some changes due to android studio update.
- open command prompt [ cmd ]
change directory to sdk > tools
cd C:\Users\Intel\AppData\Local\Android\sdk\tools
if that address is not working 2.a open android studio 2.b open Gradle Scripts directory ( if you have a open project inside android studio, you can easily find in left side of the screen. ) 2.c double click on local properties ( at the very bottom ) 2.d you should see the address right away, ( sdk dir ) 2.e change your directory to that address in command prompt ( like cd AppData ) 2.f change directory again to tools ( cd tools )
check the list of emulators that you all ready created by
emulator -list-avds
copy your preferred emulator name.
choose and run your emulator by
emulator -avd < your preferred emulator name >
done.
Update 2020/05: Windows 10
first get a list of emulators, open cmd and run :
cd %homepath%\AppData\Local\Android\Sdk\emulator
then
emulator -list-avds
next create a shortcut of emulator.exe found in the directory above, then change the properties in it by editing the Target: text box like this
emulator.exe @YourDevice
For Windows users:
- Copy your Emulator name.
- Go to this directory:
C:\Users\[yourusername]\AppData\Local\Android\Sdk\emulator - Right click on
emulator.exeand 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
if you installed Git on your system. then you can run .sh bash code. I create the bash code for search from your created ADV Devices and list them. then you can select the number of adv device for run emulator without running Android studio.
link: adv-emulator.sh
note [windows os]: please first add %appdata%\..\Local\Android\Sdk\emulator to your system Environment path, otherwise the bash-code not work.
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.
(Only for Windows) Why to torture yourself? Make a Simple BAT file ! :
- Open Notepad
- Create the command as shown below
- Save as *.bat
- (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



