14

I am trying to create a custom virtual device in Android Studio to emulate my Pixel 3 phone and I am having difficulty getting it to work, so I wanted to see if the steps I am using are correct or there is something better I should be doing.

I followed the answer from here and cloned the Pixel 2 profile, then manually edited it to specify the Pixel 3 dimensions, resolution, etc. I am using Android Studio 3.3.1 with the latest updates.

I am hitting two problems with that: 1) When I try to import that profile, it loses the "Play Store" setting and the newly started image doesn't have Google Play Services checked (see screenshot) 2) When I start that image it gets stuck at the "Preparing for setup phase" of what I think is the Android SDK (see screenshot)

My questions are - is what I am doing supported (or supposed to work at all) and if not, is there a better way to get a custom-sized device image with Google Play services on it?

Thanks in advance for the help!

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
kaloianm
  • 143
  • 1
  • 6

2 Answers2

21

open file in: USER_HOME/.android/avd/[YOUR_AVD].avd/config.ini

and edit / add this:

PlayStore.enabled=true
image.sysdir.1=system-images\android-29\google_apis_playstore\x86\
tag.display=Google Play
tag.id=google_apis_playstore
hw.device.manufacturer=Google
hw.device.name=Nexus 5

Maybe not all required, but PlayStore.enabled and image.sysdir.1 is required. image.sysdir.1 depends on your installed Android AVD version...

mtrakal
  • 6,121
  • 2
  • 25
  • 35
  • 4
    This worked great for me. Only needed to change 'PlayStore.enabled' and 'image.sysdir.1' as mtrakal suggested. Thanks. – dev2505 Jun 04 '20 at 12:41
  • This worked for me :-) And it finally it downloaded the image which have Google Play store. So bottom line is not all image have Google play store by default. – Pushpendra Jan 30 '21 at 11:15
  • This worked great, just want to add that you will have to start avd from android studio so that it downloads updated playstore images, running avd directly will probably throw some error. – Shashi Shekhar Mar 06 '22 at 17:03
  • @ShashiShekhar of course it depends on what images you have currently downloaded otherwise it need to download image (which is not possible by command line start). You can replace `android-29` with another version of your preferred API level which you have downloaded. – mtrakal Mar 07 '22 at 10:10
0

Seems to be working with Android 10.0 image. Tested with a modified Nexus 5 profile.

Sir Beethoven
  • 348
  • 1
  • 8