Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not able to Create AVD using command line

I have downloaded the basic Android command line tools from devloper.android.com, now i am creating a new AVD using following command

avdmanager create avd --package 'platforms;android-26;google_apis;x86' -n test-1

Its giving error

Error: Package path is not valid. Valid system image paths are:

I have already installed the package using sdkmanager and its available in my sdk folder under platforms.

like image 267
Meetesh Avatar asked Oct 06 '17 12:10

Meetesh


People also ask

Why is my AVD not working?

Android Virtual Devices fail to launch on ChromeOS On ChromeOS, Android Virtual Devices (AVDs) might fail to launch because the libnss3 dependency is missing. To launch the AVDs successfully, run sudo apt install libnss3 to manually install the libnss3 library.

Why AVD Manager is not working?

SDK Build Tools are not installed If it fails then you may have to install it again. You look at the build tab at the bottom of the screen, it will display the error message and option to install the Build tools. Install it and you should be able to see the AVD Manager. Another way is to go to the SDK Manager.

How do I run an emulator from command prompt?

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

First, you need to download the necessary packages. Here is an example of downloading API 23 packages for x86 emulators:

 ./sdkmanager "system-images;android-23;google_apis;x86"

and then create your emulator:

./avdmanager create avd -n test -k "system-images;android-23;google_apis;x86" -b x86 -c 100M -d 7 -f

Or you can try with this sample steps:

android update sdk -u --filter platform-tools,android-25
sdkmanager --verbose "system-images;android-25;google_apis;x86"

and then create the avd using:

avdmanager -v create avd -n x86 -k "system-images;android-25;google_apis;x86" -g "google_apis"
like image 173
Nezir Avatar answered Oct 04 '22 19:10

Nezir