Android Studio comes with a built-in AVD manager that lets you create and access Android virtual devices for app development purposes. In this short post, let me show you how to launch AVD manager without starting Android Studio first.
To launch a virtual device, you need to access the AVD manager. The problem is, you need to launch the Android Studio first to get access to the AVD manager. This is not a problem if you are developing apps. However, if you want to access the Android emulator for other reasons then launching the Android Studio each and every time can be a pain in the back.
The good thing is, you can launch AVD manager from command line. Let me show you how.
A Couple of Things Before You Proceed
Before proceeding, I assume you know a few things.
1. You have Android Studio installed and configured properly.
2. There should be at least one virtual device in the Android AVD Manager. If not, create a virtual device first.
3. Know the location of the Android SDK on your hard disk. If you have installed Android Studio with default settings, the SDK will be in your C drive. If you are not sure, launch Android Studio and click on the Tools -> SDK Manager. In the new window, you will see the location right next to Android SDK Location.
Once you’ve confirmed all the above things, follow the next steps.
Start AVD Manager Without Android Studio
1. First, open the file explorer and go to the Android SDK folder. Inside the SDK folder, find and open the Emulator folder. As you can see, I’ve placed my SDK folder in some other drive.
2. In the file explorer, hold the Shift key on your keyboard and right-click on the empty space. This action will open the extended context menu. Here, select the Open PowerShell window here option.
Note: If you are using Windows 7 or 8, you will Open Command Prompt Here option, select it.
3. To launch Android emulator, we first need to know the name of the virtual device. So, execute the below command and it will list all the devices with their names. In my case, there is only one virtual device.
.\emulator.exe -list-avds
4. Now, execute the below command to launch the virtual device. Don’t forget to replace <virtualDeviceName> with the actual device name you got from the above command.
.\emulator.exe -avd "<virtualDeviceName>"
5. As soon as you execute the command, the AVD manager will launch the virtual device.
6. You can access all the settings of the virtual device too.
Finally, do not close the PowerShell or Command Prompt window while the virtual device is running. If you do, the device will be turned off.
(Optional) Add Android Emulator to Windows Path
If you only launch AVD manager without Android Studio occasionally, then the above method is good enough. However, if you are going through this procedure frequently, then you can make your life easier by adding the Emulator folder as an environment variable to the Windows path.
That way, you don’t have to go to the SDK folder manually just to launch the virtual device. Follow the below steps to add Android emulator to Windows path.
1. Just like before, go to the Emulator folder in the Android SDK folder. Now, click on the address bar and copy the folder path.
2. Open the start menu, search for Environment Variables and open it.
3. In the System Properties window, click on the Environment Variable button appearing at the bottom of the window.
4. Now, select the Path variable under your user account and click on the Edit button.
Note: if you want the path to be available for all users, then select the Path variable under the System Variables section.
5. Since we want to add a new value, click on the New button.
6. In the new blank field, paste the copied path. Click on the Ok button to save changes.
7. Click Ok on all other windows.
8. That is it. From now on, you can use the below command to list all the AVDs. As you can see, we are not manually providing the file path for emulator.exe.
emulator -list-avds
9. To launch the virtual device, you can use the below command.
emulator -avd "<virtualDeviceName>"
That is all. It is that simple to launch AVD manager without starting Android Studio.
Thanks, but the next question is… how do we do this without having to keep that command-line window open?
You can put the command in a batch file and then create a shortcut to that batch file like so:
– create a file and call it ‘startemulator.bat’
– put this as the content in the batch file and then save the batch file:
@echo off
cd
emulator.exe -avd “”
– create a shortcut to ‘startemulator.bat’; you can rename the shortcut to ‘startemulator’
– open the properties of the shortcut file (right-click and select “Properties”)
– Select the drop-down box next to “Run” and choose “Minimized”
– apply the changes
– run the shortcut
Works like a charm and you don’t see that nagging dos command box open anymore.
Hth.
Ahh… I see part of my text has vanished…
Where there’s ‘cd’ it should be ‘cd path_to_the_emulator’
Where there’s ’emulator.exe -avd “”‘ it should be name_of_your_emulator between the double quotes.
I’ve put the above between triangles (smaller-then, bigger-then symbols) but they’re apparently filtered out…
Hope it’s still clear…
thank you !
Great…. except the article doesn’t describe how to launch the AVD Manager, it describes how to launch an Emulator.
Yes. He poses one question, and answers another. Did you ever find out how to lanch the skdManager without launching AndroidStudio?
When I open powershell and search for available emulators it doesn’t show any available, although I have four set up within Android Studio. Any idea why? Thanks.