Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create Android Virtual Device with command line and avdmanager?

Tags:

android

I can not create a device with avdmanager command line:

$ Android/Sdk/tools/bin/avdmanager create avd --name Nexus6P --tag 11 --package 'system-images;android-23;google_apis;x86_64' Error: Invalid --tag 11 for the selected package.  $ Android/Sdk/tools/bin/avdmanager create avd --name Nexus6P --package 'system-images;android-23;google_apis;x86_64' Error: Invalid --tag default for the selected package.  $ Android/Sdk/tools/bin/avdmanager list Available Android Virtual Devices: Available devices definitions: ... --------- id: 11 or "Nexus 6P"     Name: Nexus 6P     OEM : Google --------- 

Any idea?

like image 506
Guillaume Vincent Avatar asked Mar 14 '17 17:03

Guillaume Vincent


People also ask

How do I get Avdmanager?

If you're using Android Studio, then you do not need to use this tool and you can instead create and manage AVDs from the IDE. The avdmanager tool is included in the Android SDK Command-Line Tools package at android_sdk /cmdline-tools/ version /bin/avdmanager .

How do I open an Android Emulator from the command line?

Starting the emulator Use the emulator command to start the emulator, as an alternative to running your project or starting it through the AVD Manager. Here's the basic command-line syntax for starting a virtual device from a terminal prompt: emulator -avd avd_name [ {- option [ value ]} … ]


1 Answers

If you don't care about it being a Nexus 6P, you can run

echo no | Android/Sdk/tools/bin/avdmanager create avd --force --name testAVD --abi google_apis/x86_64 --package 'system-images;android-23;google_apis;x86_64' 
like image 81
Gregriggins36 Avatar answered Sep 27 '22 18:09

Gregriggins36