45

How to open the AVD manager on Ubuntu Linux from the command line?

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
Garvit Arora
  • 471
  • 1
  • 4
  • 4

10 Answers10

53

For thoose coming here because the android avd command has been deprecated*, here's how to do it now:

Using Android Studio

Open Android Studio with a valid studio project (if you don't have one, simply create one empty). After you've your project open, go to Tools => Android => AVD Manager. Note that this menu does not appear if you don't have a valid Android Studio project open.

Now you can safely close Android Studio if you only want the AVD Manager.

From command line

If you want to use the command line you'll first need to create the virtual device using avdmanager, located under $ANDROID_HOME/tools/bin/avdmanager like so:

$ANDROID_HOME/tools/bin/avdmanager create avd --force --name testAVD --abi google_apis/x86_64 --package 'system-images;android-23;google_apis;x86_64'

After you created the device to emulate, then you need to open it with emulator, which is located under $ANDROID_HOME/tools/emulator. The command for the previously created device should be something like:

emulator -avd testAVD

If it crashes saying something like...

[140022905190208]:ERROR:./android/qt/qt_setup.cpp:28:Qt library not found at ../emulator/lib64/qt/lib

Ensure you're running the emulator command inside the $ANDROID_HOME/tools folder, otherwise may not work.

If you already added a device VM you can list them all with

emulator -list-avds

Check out the official documentation for more details (thanks to Jeff Xiao for this—in comments).

* The depreaction note says:

The android command is no longer available.
For manual SDK and AVD management, please use Android Studio.
For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager
elboletaire
  • 5,180
  • 2
  • 36
  • 46
  • For me, I cannot close Android studio once I open the AVD manager, it closes too. Also, it is very slow/uncertain when AVD manager will be available in the menu since it seems to have to run a bunch of gradle commands first. – AnneTheAgile Oct 10 '17 at 20:36
  • Which version of Android Studio are you using? In my case, under Linux, I can have the AVD manager after I close Android Studio. – elboletaire Oct 11 '17 at 09:57
  • 2
    I am using version 3.0 of Android Studio and I don't see Android submenu under Tools – apieceofbart Nov 22 '17 at 14:03
  • 1
    `emulator -list-avds` lists AVDs. here's a [referece](https://developer.android.com/studio/run/emulator-commandline.html) on the Android Studio doc. – XoXo Mar 07 '18 at 12:58
  • Thank you @JeffXiao! I've added that command to the post too :) – elboletaire Mar 08 '18 at 12:43
31

Use android avd to open the AVD Manager.

Akash Moradiya
  • 3,318
  • 1
  • 14
  • 19
  • 19
    This has been deprecated, see https://developer.android.com/studio/tools/help/android.html – elboletaire Mar 16 '17 at 16:54
  • ************************************************************************ The "android" command is deprecated. For manual SDK, AVD, and project management, please use Android Studio. For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager ************************************************************************* – Shivam Bharadwaj Mar 26 '19 at 12:35
11

Sadly commands android sdk and android avd stopped working so to run emulator we need to use different commands to download and build all devices and its dependencies:

  1. Download sdk-tools-linux (tar.gz) from:

https://developer.android.com/studio#downloads

  1. Unpack tools to : ...android-sdk/tools (...wherever you want)

  2. Go to : android-sdk/tools/bin

  3. Install needed sdk libraries:

Execute in cmd

sdkmanager --update

sdkmanager "platform-tools" "platforms;android-29" 

sdkmanager "build-tools;29.0.1" "extras;android;m2repository" "tools"

sdkmanager "system-images;android-29;google_apis_playstore;x86_64"

sdkmanager "emulator"
  1. Setup environment variables

Add env to system by editing ~/.bashrc (Linux) in Windows just setup system enviroments.

export ANDROID_HOME=../android-sdk

export ANDROID_SDK_ROOT=$ANDROID_HOME

export PATH=$PATH:$ANDROID_SDK_ROOT/tools/bin

alias emulator="sh $ANDROID_HOME/tools/emulator"

Note: There is possible that You need JAVA_HOME too.

Restart computer or cmd to load environments

  1. Create device:

Go to /bin

avdmanager create avd -n myDevice -k "system-images;android-29;google_apis_playstore;x86_64"
  1. run device:

Got to dir and run

cd android-sdk/tools
emulator -avd myDevice (or sh $ANDROID_HOME/tools/emulator -avd myDevice)

Issues:

qemu emulator not found in /bin....

cd android-sdk/tools/bin
ln -s  android-sdk/emulator/ emulator
John Tribe
  • 1,407
  • 14
  • 26
9

For me, ./android avd worked, where android was the shell script under android-studio/sdk/tools.

Shipra Swati
  • 3,999
  • 2
  • 14
  • 7
7

./android avd is deprecated use ~/Android/Sdk/tools/bin/avdmanager --help instead!

or if it is easier for you, move to the directory and use it like in the old version:

cd ~/Android/Sdk/tools/bin/
./avdmanager

check new [options] with --help or -h before you use avdmanager

first occurence in Android Studio 2.3 !

Stormtrooper CWR
  • 533
  • 1
  • 6
  • 19
2

Android studio:v3.0.1

Get name:

/home/user/Android/Sdk/tools$ android list avd

Start emulator:

/home/user/Android/Sdk/tools$ emulator -avd Nexus_6_API_23
me_astr
  • 922
  • 1
  • 14
  • 21
1

First of all to show all devices run the following command from the location - ~/Android/Sdk/tools

/home/user/Android/Sdk/tools> ./emulator -list-avds

then you will see the list of devices id, in my case i got following devices

Nexus_5X_API_28
Nexus_9_API_28

Now just run following command with the device id you want to run.

/home/user/Android/Sdk/tools> ./emulator -avd Nexus_9_API_28
Mahendra Pratap
  • 3,174
  • 5
  • 23
  • 45
0

I created shortcut with this command

 /path/to/Android/emulator/emulator -avd Nexus_5X_API_26

Where "Nexus_5X_API_26" is my virtual device I created in Android Studio (2.3.3). Correct name can be checked from ~/.android/avd/ folder, where are one subfolder (with extension .avd) and one file (with extension .ini) for each. There are qcow2 files which I think could be also run directly with qemu (have not tested yet).

Kalamarico
  • 5,466
  • 22
  • 53
  • 70
Karel H
  • 21
  • 2
-2

I used a sudo bash command and that worked for me:

sudo ./avdmanager list

after running sudo ./avdmanager list

PrimeTime
  • 121
  • 1
  • 6
-16

Here's the command-line usage for creating an AVD:

android create avd -n -t [- ] ...

Example : android create avd -n my_android1.5 -t 2

If the target you selected was a standard Android system image ("Type: platform"), the android tool next asks you whether you want to create a custom hardware profile.

Android 1.5 is a basic Android platform. Do you wish to create a custom hardware profile [no]

Use the create avd command to create a new AVD, specifying the --skin option with a value that references either a default skin name (such as "WVGA800") or a custom skin resolution (such as 240x432). Here's an example:

android create avd -n -t --skin WVGA800

or you can refer from :-

http://developer.android.com/tools/devices/managing-avds-cmdline.html

A-Droid Tech
  • 2,301
  • 24
  • 33
  • 3
    The `android` command is deprecated https://developer.android.com/studio/tools/help/android.html says: "This tool is no longer supported. You should instead use Android Studio to create AVDs and create projects." – Ciro Santilli OurBigBook.com Jun 25 '16 at 17:31
  • 13
    The question is asking how to open AVD manager, not how to create. – wi1 Sep 26 '16 at 23:32
  • SDKmanager is a better alternative https://developer.android.com/studio/command-line/sdkmanager – TomTom Apr 12 '20 at 00:29