Why? Not all AVD profiles come with Play Store installed. I needed a phone with a notch, and decided on Google Pixel XL, but turns out it didn’t have Play Store installed
I found the answer on StackOverflow, and it’s pretty straight forward. Compare the config.ini
file with another AVD device that does has Play Store installed and then update the one for Google Pixel XL after figuring out the change
1~/.android/avd/DEVICE_ID/config.ini
This is from the config that had Play Store installed (Pixel 3a)
1PlayStore.enabled = true
2image.sysdir.1 = system-images/android-29/google_apis_playstore/x86/
3tag.display = Google Play
4tag.id = google_apis_playstore
And this is how it was in Pixel 3 XL
1PlayStore.enabled = false
2image.sysdir.1 = system-images/android-30/google_apis/x86/
3tag.display = Google APIs
4tag.id = google_apis
All i had to do was update the config, re-download the system image and then restart the device
1PlayStore.enabled = true
2image.sysdir.1 = system-images/android-30/google_apis_playstore/x86/
3tag.display = Google Play
4tag.id = google_apis_playstore
Android Studio > Tools > AVD Manager. Click Download for your device so that it installs the system image with Google Play
IF you don’t re-download the system image, you’ll likely get the following when trying to run the emulator
PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT
Keep in mind that even though your device will now have Play Store, the Play Store icon will not appear next to your device in Device Manager If you change PlayStore.enabled
in config.ini
to true, it’ll start showing the Play Store icon next to the device in AVD Manager.