Create and launch a headless emulator with command line

 1.  Create AVD

android create avd --force -n Nexus_9_API_22 -t 1

 

  2.  Start AVD 

emulator -avd Nexus_9_API_22 -no-audio -no-window &

 

You can also refer to the official guide for more options when starting a emulator:

https://developer.android.com/studio/run/emulator-commandline.html

or use 

emulator -help

 

 

Other useful android command:

 

1. List all existing AVDs:

 emulator -list-avds

 

2. List the detail info of all the AVDs:

 android list avd

 

3. Delete an AVD:

 android delete avd -n {AVD_NAME}


4. Figure out the ABI name related to a certain SDK level

  In command line:

  $ android list target

  In Android Studio:

     Open the AVD manager -> Edit the AVD -> In AVD configuration wizard, click ‘Change’ for system image -> Find the ABI info

 

5. Install/Update SDK

e.g. Install the system images (x86) for the API (23) you can using

 $ android update sdk -a -u -t sys-img-x86-android-23

 to see a list of images ids:

 $ android list sdk -a -e

where -a stands for all and -e for extended, -t for filter and -u for no-ui

posted @ 2017-04-13 11:29  Majesty  阅读(251)  评论(0编辑  收藏  举报