How to install Google Play app in Android Studio emulator?
Solution 1
Starting with Android Studio 3.0 Canary 1, you have now some options of devices that come with the Play Store app built-in(Nexus 5X and Nexus 5 on image below).
Solution 2
After a long while of testing, everything seems to be outdated. I can't find necessary APK's like GoogleLoginService.apk
, etc.
I got it to work by installing two virtual devices.
- My Device (a Samsung Galaxy Tab A with custom skin and sizes)
- A device, which had the "Play Store Available" icon in your AVD-Manager on the site where you can create a new profile.
I installed the first device and the second device with the same Android version, and used one profile from Samsung (because my tablet is a Samsung).
After that step, I compared the config.ini
file located in:
C:\Users\USER\.android\avd\DEVICE_ID
On Ubuntu/Linux it'll be in
~/.android/avd/DEVICE_ID
Change the following variables to:
PlayStore.enabled = true
image.sysdir.1=system-images\android-27\google_apis_playstore\x86\
tag.display=Google Play
tag.id=google_apis_playstore
Here's an example diff of what fields will be changed:
After that you'll probably have to re-download the system image for the device, which you can do from Tools > AVD Manager.
Here's an example screenshot of what that'd look like:
Once done, restart the device, and Play store will be installed and ready to use.
Solution 3
Download Google apps (GoogleLoginService.apk , GoogleServicesFramework.apk , Phonesky.apk) from http://wiki.rootzwiki.com/Google_Apps#Universal_Packages_2
Start your emulator:
emulator -avd VM_NAME_HERE -partition-size 500 -no-audio -no-boot-anim
Then use the following commands:
Remount in rw mode
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock0 /system
Allow writing to app directory on system partition
adb shell chmod 777 /system/app
Install following apk
adb push GoogleLoginService.apk /system/app/.
adb push GoogleServicesFramework.apk /system/app/.
adb push Phonesky.apk /system/app/. # Vending.apk in older versions
adb shell rm /system/app/SdkSetup*
Refer: to this SO Post
user1841702
Updated on July 07, 2021Comments
-
user1841702 almost 3 years
I am completely new to using Android Studio and I am trying to install the Google Play app on the emulator. I have installed the
Google Repository
andGoogle Play Services
as well as aGoogle APIs x86 Atom System Image
from the SDK manager and I am able to set up Google Play Services for my sample application.I would now like to install the Google Play application on my emulator. How can this be done ? Any suggestions or a solution itself would be most appreciated. Also, thank you very much for your time.
-
Damn Vegetables over 7 yearsI do not think this is how to install Google Play Store.
-
Pascal about 6 yearsGreat! And what if I want to test my app on a emulator with Play Store, but in Tablet mode?
-
1QuickQuestion about 6 yearsI've been searching for a few hours and finally ran across this! Thank you!
-
Peter Cullen about 6 years/system not in /proc/mounts
-
IgorGanapolsky almost 6 yearsI don't see this option. Are you sure it is there?
-
Ng Sek Long almost 6 years@IgorGanapolsky I checked today and it is still there, need to scroll down a bit
-
Jeremy Caney about 4 yearsPlease be careful with your formatting, and be sure to preview your answer before posting. Your entire answer was indented by four spaces which made it appear as a code block, and made it difficult to read. I've reformatted it for you; please review to make sure everything is correct, but also to evaluate how the formatting was achieved for future posts.
-
Aamnah almost 4 yearsYou may also have to download the system image for the device again if the API version is different or the image doesn't already exist. I had to re-download the system image when i was moving from API 29 on Google Pixel 3a to API 30 on Google Pixel 3 XL. If the system image is missing, you'll get
PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT
when you try to run the emulator. You can download system image from Tools > AVD Manager -
vitek6491 over 3 yearsin the emulator, with whatever tools are the latest as of Feb, 2017, the emulator needs to be launched from the command line with:
-writable-system
stackoverflow.com/a/42280124/3003905 -
lambozsolty about 3 yearsWorking in 2021! Thank you!
-
JP711 about 3 yearsWhen I touch on download I get this error "All packages are not available for download !, The following packages are not available: - Package id system-images; android-23; google_apis_playstore; x86 "
-
Federico Navarrete almost 3 yearsThe best solution until 2021!
-
click_whir almost 3 yearsHeroic. I have a working emulator for API 30 finally
-
zerox1212 over 2 yearsThe real question is why isn't AVD showing emulator images with Google Play???
-
bebosh over 2 yearsyou are smart one!!
-
Karmalakas about 2 yearsPixel C API 31 works fine now after changing ini