0
votes

I am creating an AVD using the command line, since I am running on a machine which does not necessitate installing all of Android Studio for this simple task.

Per the avdmanager and sdkmanager documentation, I am creating an AVD like so:

cd <android-sdk-tools-directory>

# Ensure the emulator is installed
./bin/sdkmanager "emulator"

# Obtain the system images
./bin/sdkmanager "system-images;android-25;google_apis;x86"

# Create the AVD
./bin/avdmanager create avd \
    -b google_apis/x86 \
    -d 11 \ # Corresponds to Nexus 6P, per ./bin/avdmanager list
    -f \
    -k "system-images;android-25;google_apis;x86" \
    -n "Nexus_6P_x86_Android_25"

This creates an AVD which corresponds to the Nexus 6P running on x86 hardware with API level 25. However, when I start up the emulator, here is what I get:

./eumlator -avd Nexus_6P_x86_Android_25 -netdelay none -netspeed full

Android Emulator incorrect resolution

The avdmanager indeed correctly identifies this device:

./bin/avdmanager list

Available Android Virtual Devices:
  Name: Nexus_6P_x86_Android_25
Device: Nexus 6P (Google)
  Path: /Users/user/.android/avd/Nexus_6P_x86_Android_25.avd
Target: Google APIs (Google Inc.)
        Based on: Android 7.1.1 (Nougat) Tag/ABI: google_apis/x86

...

What's wrong with this emulator? Is there something I'm missing which is creating such an incorrect hardware profile?

1
which skin are you using? try using WVGA852Itzik Samara
@ItzikSamara Skinning is not available from the avdmanager command line.Oliver Spryn
you should use emulator64-x86 plus have you check out this doc : stuff.mit.edu/afs/sipb/project/android/docs/tools/devices/… ? dpi is also a possiblityItzik Samara

1 Answers

0
votes

As everyone mention above, avdmanager currently doesn't support setting the skin when creating avd. The workaround is by updating the argument to start the emulator with following:

$ANDROID_SDK/tools/emulator @avdname -skin nexus_6p -skindir "$ANDROID_SDK/skins"

You can get the /skins/ directory from comment of issue below. https://issuetracker.google.com/issues/37137534

Or you can modify the AVD definition to include Skin definition - How to create an Android AVD for Pixel device, from command line?