Ziem
Ziem

Reputation: 6697

How to correctly create Android emulator from command line with avdmanager?

For some reason all emulators, which I created using avdmanager, don't work.

To be sure that I'm doing it correctly I opened https://developer.android.com/studio/command-line/avdmanager.html and copied example:

./avdmanager create avd -n test -k "system-images;android-25;google_apis;x86"

./emulator -avd test

Emulator starts (as before) but unfortunately shows black screen: Android emulator

How to correctly create Android emulator from command line with avdmanager?

Upvotes: 2

Views: 5028

Answers (1)

srinivasu u
srinivasu u

Reputation: 1473

Try following steps:

touch ~/.android/repositories.cfg

cd ~/Android/Sdk/tools/bin

./sdkmanager --verbose --list

Here I am creating android api 25.

./sdkmanager --verbose "system-images;android-25;google_apis_playstore;x86"

To list all the devices

./avdmanager list device

To list all targets(versions of android operating system)

./avdmanager list targets

AVDs are combinations of targets and devices

./avdmanager create avd -n nexus6p -k "system-images;android-25;google_apis_playstore;x86" -b x86 -c 2048M -f

Do you wish to create a custom hardware profile? [no]

just press enter

Upvotes: 3

Related Questions