What is the command to list the available avdnames

AndroidShellConfigurationAdbAvd

Android Problem Overview


I know I can start the emulator avd by typing

emulator.exe @avdname

But is there a command to list the available avdnames? Where are this avd configuration stored?

Android Solutions


Solution 1 - Android

Using sdk/tools/emulator

This will list all available avds

emulator -list-avds

Solution 2 - Android

AFAIK avdmanager list avd is what you need.

Solution 3 - Android

get into Android/sdk/tools and run following command

./emulator -list-avds

which will return something like

Nexus_5X_API_P
Nexus_6_API_25

Solution 4 - Android

List all your emulators:

> emulator -list-avds

Run one of the listed emulators:

> emulator @name-of-your-emulator

where emulator is under:

> ${ANDROID_SDK}/tools/emulator

Solution 5 - Android

I try few combination and it worked :), it was pretty obvious

android list avd

the output is something like this

Available Android Virtual Devices:
    Name: EMULLL
    Path: /home/krste_ristevski/.android/avd/EMULLL.avd
  Target: Android 2.3.3 (API level 10)
    Skin: WVGA800
  Sdcard: 512M

now with

emulator @EMULLL

I can start the emulator from console

Solution 6 - Android

This is an old post, but I am currently using this script to display the avd names and start one.

#! /bin/bash
# (@) start-android
# If the emulator command exists on this device, displays a list of emulators
# and prompts the user to start one

# Check if the emulator command exists first
if ! type emulator > /dev/null; then
  echo "emulator command not found"
  exit 1
fi

# Gather emulators that exist on this computer
DEVICES=( $(emulator -list-avds 2>&1 ) )

# Display list of emulators
echo "Available Emulators
----------------------------------------"
N=1
for DEVICE in ${DEVICES[@]}
do
  echo "$N) $DEVICE"
  let N=$N+1
done

# Request an emulator to start
read -p "
Choose an emulator: " num

# If the input is valid, launch our emulator on a separate PID and exit
if [ $num -lt $N ] && [ $num -gt 0 ];
then
  DEVICE=${DEVICES[$num-1]}
  emulator "@$DEVICE" > /dev/null 2>&1 &
  exit 0
else
  echo "Invalid Entry : $num"
  exit 1
fi

Here is an example run and output:

./start-android.sh
Available Emulators
----------------------------------------
1) Nexus_5X_API_23
2) Nexus_9_API_23
 
Choose an emulator: 1

Solution 7 - Android

I have a simple method (Only for windows):

  1. First of all set permanent path to adb in your system (Pretty similar like java). Find yours, For most of cases - C:\Program Files\android\android-sdk\platform-tools and copy it. Now go through your system properties and find Advance System Setting. Now find Environment Variable, in system variable tab find path. If there is no path then create a new variable and name it Path and paste the copied value in next field. But if there is already a Path, then open it and put a ; semi-colon at the last of value box and paste the copied value.

  2. Now you are almost done.! Check it by typing adb in cmd

  3. and now type adb devices, thats what you wanted. Cheers.!

Solution 8 - Android

On Mac and Linux operating system:

  1. Navigate to Android/sdk/emulators
  2. Run command ./emulator -list-avds

This will give you all the avd's created on your system.

Solution 9 - Android

For Mac users arriving here, you can find the previously mentioned android/sdk/tools directory at /Users/YOURUSERNAME/Library/Android/sdk/tools/

Solution 10 - Android

First check if the emulator exe is installed and is present in the PATH env variable:

Windows: where emulator

C:\Users\ShahidSiddiqui>where emulator
C:\Users\ShahidSiddiqui\AppData\Local\Android\Sdk\emulator\emulator.exe

*nix/Mac: which emulator

If no emulator found, either install it or fix the PATH to include its path.

You can check for the avd's present in your PC by running command:

PS C:\Users\ShahidSiddiqui> dir $HOME\.android\avd


    Directory: C:\Users\ShahidSiddiqui\.android\avd


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----         7/05/2021   2:55 pm                Copy_of_HighRAM_Custom_API_30-Clone.avd
d-----        27/04/2021   5:36 pm                HighRAM_Custom_API_30.avd
d-----        29/01/2021  10:19 pm                Nexus_5X_API_30.avd
d-----        30/03/2021   1:27 pm                Nexus_5X_API_30_2.avd
d-----        22/01/2021   8:03 am                Pixel_4_API_30.avd
d-----        24/12/2020  10:14 am                Pixel_4_API_30_-2.avd
d-----        18/03/2021   2:55 pm                ShahidDevice_API_30.avd
-a----        29/04/2021  10:00 am            176 HighRAM_Custom_API_30-Clone.ini
-a----        29/01/2021   4:36 pm            148 HighRAM_Custom_API_30.ini
-a----        25/03/2021   4:20 pm            140 Nexus_5X_API_30_-New.ini

The INI files are the name of the AVDs that you can run.

If you have configured things properly, looking the AVDs is quite easy. Run command:

PS C:\Users\ShahidSiddiqui> emulator -list-avds
HighRAM_Custom_API_30-Clone
HighRAM_Custom_API_30
Nexus_5X_API_30_-New

To launch any of these avds, run the command (I am using which I am working on it):

PS C:\Users\ShahidSiddiqui\.android\avd> emulator -avd HighRAM_Custom_API_30-Clone
emulator: Android emulator version 30.5.5.0 (build_id 7285888) (CL:N/A)
handleCpuAcceleration: feature check for hvf
added library vulkan-1.dll
Failed to open /qemu.conf, err: 2
Windows Hypervisor Platform accelerator is operational
emulator: INFO: GrpcServices.cpp:301: Started GRPC server at 127.0.0.1:8554, security: Local

And a sweet AVD will be launched. Cheers!

NOTE: adb devices command will only list the currently running avds and real android devices. It will not show emulators (i.e. avds configured).

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionLukapView Question on Stackoverflow
Solution 1 - Androiduser1046762View Answer on Stackoverflow
Solution 2 - AndroidZelluXView Answer on Stackoverflow
Solution 3 - AndroidAsnad AttaView Answer on Stackoverflow
Solution 4 - AndroidDhiraj HimaniView Answer on Stackoverflow
Solution 5 - AndroidLukapView Answer on Stackoverflow
Solution 6 - AndroidChris SullivanView Answer on Stackoverflow
Solution 7 - AndroidEastern KillerView Answer on Stackoverflow
Solution 8 - AndroidAdityaView Answer on Stackoverflow
Solution 9 - AndroidJeffery BennettView Answer on Stackoverflow
Solution 10 - AndroidMohammad Shahid SiddiquiView Answer on Stackoverflow