Google Play on Android 4.0 emulator
Asked Answered
C

8

185

How can I install the Google Play .apk onto my Android 4.0 emulator?

Clavicle answered 22/6, 2012 at 10:11 Comment(2)
Note: comments have mixed results, so your mileage may varyProven
but its the same with other emulator versions, and it worked there so why it shoudnt work in 4.x? :)Politesse
S
259

Download Google apps (GoogleLoginService.apk , GoogleServicesFramework.apk , Phonesky.apk)
from here.

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.
# NOTE: more recent system.img files are ext4, not yaffs2
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*
Seymore answered 26/6, 2012 at 18:20 Comment(18)
Note: Vending.apk is called Phonesky.apk in latest releasesCliftonclim
Server Offline. Please hang tight while we get this resolved. :'(Changchangaris
When installing with this method, I can register and login, but get an error Error retrieving information from server [RH-01] afterwards.Amblyopia
the -partition-size param is important, without it i got OutOfMemory exception while pushing the apksGoodrum
When installing with this method it worked by me only with the default data network, however it had a error logging in when I was on a different APN, so make sure you do not use any proxy for the Access PointCustodial
I think this answer should be the accepted answer. After all, this IS an actual answer, the current accepted answer (11/11/2013) is only a "breaking the eula is like a bad thing, m'kay?" type of comment.Catafalque
Does anyone have problem with connecting to Google services after installing Play this way on emulator?Coprolalia
Should I follow this instructions in emulator image with Google Play API services?Coprolalia
If you also want to be able to use a 4.0.3 emulator for GCM testing, you will also need to add the GmsCore.apk from the 4.3 package here. Here is a direct linkBower
Am I the only one not able to get this to work? On both 4.4 and 5.0 emulators, adding the APKs does not show the Play Store icon, and adb reboot just hangs.Edelsten
The link to download Google Play services are not working anymore. I think the root link goo.im/gapps itself is removed.Samuella
I'm unable to see play store icon on emulator after Successfully following all steps......is there any caveat to this method? Im running android 5.1 emulator imageDrummer
all was working fine but after closing the emulator and starting it again with eclipse is removing the playstore is there any solution to this problem?Hurry
Links Are:- electrocoder.googlecode.com/files/GoogleLoginService.apk , androidmarketu.googlecode.com/files/GoogleServicesFramework.apk , drive.google.com/a/sakshay.in/file/d/…Catalogue
getting rm: /system/app/SdkSetup: is a directory error on api 22Mortality
adb push seems to have problem failed to copy 'GoogleLoginService.apk' to 'C:/Program Files/Git/system/app/': No such file or directory when using window gitbash. Solved by using window cmdTeraterai
looks like this methos only works in android 4.x, in android 5 it fails for some kind of certifcated Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]Redneck
I'm gettin system not in proc/mounts. Trying on a 7.1 emulatorDuffel
I
85

For future visitors.

As of now Android 4.2.2 platform includes Google Play services. Just use an emulator running Jelly Bean. Details can be found here:

Setup Google Play Services SDK

EDIT:

Another option is to use Genymotion (runs way faster)

EDIT 2:

As @gdw2 commented: "setting up the Google Play Services SDK does not install a working Google Play app -- it just enables certain services provided by the SDK"

After version 2.0 Genymotion does not come with Play Services by default, but it can be easily installed manually. Just download the right version from here and drag and drop into the virtual device (emulador).

Immature answered 6/6, 2013 at 22:59 Comment(14)
do you mean that Genymotion's vms have a google play implementation in them?Jeuz
@craig65535 if you are using the map api, some people are having issues with that, that's way I recommended Genymotion.Immature
Holy mother! Genymotion is suweet!Hooknosed
Genymotion is faster than the emulated ARM image. It is probably the same speed as the HAXM-enabled x86 android image that is available with the Android SDK.Eyeopening
@Exception-al I think you should update your answer to clarify that setting up the Google Play Services SDK does not install a working Google Play app -- it just enables certain services provided by the SDK.Eyeopening
+1 for suggesting Genymotion!!! I didn't know it existed and now I can't live without it. It plays flawlessly with Android Studio (just add the plugin) and now I can debut my Google Maps V2 apps without resorting to "real" devices! Thanks a million!Newly
Genymotion is so cool at perfomance, but still there is no Play app, so I don't have desired opportunity to install custom apps/Coprolalia
Thanks, I've already voted up. But can you please also share if there any tutorial of how to set up Eclipse to work with Genymotion.Coprolalia
@Coprolalia Genymotion works just like a real device. Just run it and it will be automatically detected by any IDE.Immature
Some apps wont install via play store, says device is incompatible. I run a hardware benchmark and it blows the best phone out of the ball game. Not sure what its moaning baout. 4.3 -- But this is Genymotion is really awesome, looks like they did some serious work to the qemu emulator to enable 1GB ram and GPU pass through!Tightrope
Installing Play store for Lollipop #27046099Tightrope
Just an observation: Genymotion uses VirtualBox. VirtualBox uses Intel-specific virtualiation optimizations. It may not be possible to emulate an ARM Android platform with GenyMotion. Perahps such a limitation may not be absolutely a show-stopper, not for all development channels. Genymotion may not be in all ways a 100% replacement for the QEmu-based AVD manager. Peraps, any projects using low-level ARM interfaces (kernel, LibC) may need to be tested on ARM hardware - viz a viz adb - if not to be tested initially in the AVD emulator, on a comp w/ a good fast microcontroller and lots of RAM.Intensifier
@SeanChamp good point but final tests should always be on a real deviceImmature
@Immature Totally. Concerning HW, I'm sure any well connected author could write a whole book chapter, even an Open Access book, as to how a Linux kernel fits into an Android platform - concerning any hardware-oriented distinctions that may be found in low-level Linux kernel interfaces for specific microcontrollers, also any specific kernel driver implementations for OEM specific hardware, So far as testing, OEM's may make their own testing channels, of course - as to how a whole Android OS may fit together in any single OEM service bundle, if not also for issue tracking in app productionIntensifier
C
27

I do this in a more permanent way - instead of installing the APKs each time with adb, permanently add them to the system image that the emulator uses. You will need Yaffey on Windows, or a similar utility on other systems, to modify YAFFS2 images. Copy GoogleLoginService.apk, GoogleServicesFramework.apk, and Phonesky.apk (or Vending.apk in older versions of Android) to the /system/app folder of the system.img file of the emulator. Afterwards I can start the emulator normally, without messing with adb, and Play Store is always there.

Obtaining the Google Play app from your device

Downloading Google Apps from some Internet site may not be quite legal, but if you have a phone or tablet with a corresponding Android version, just pull them out of your device:

adb -d root
adb -d pull /system/app/GoogleLoginService.apk
adb -d pull /system/app/GoogleServicesFramework.apk
adb -d pull /system/app/Phonesky.apk

You must have root-level access (run adb root) to the device in order to pull these files from it.

Adding it to the image

Now start yaffey on Windows or a similar utility on Linux or Mac, and open system.img for the emulator image you want to modify. I modify most often the one in [...]\android-sdk\system-images\android-17\x86.

Rename the original system.img to system-original.img. Under yaffey, copy the APK files you pulled from your device to /app folder. Save your modified image as system.img in the original folder. Then start your emulator (in my case it would be Android 4.2 emulator with Intel Atom processor running under Intel HAX, super-fast on Windows machines) and you'll have Play Store there. I did not find it necessary to delete SdkSetup.apk and SdkSetup.odex - the Play Store and other services still work fine for me with these files present.

When finished with your testing, to alleviate your conscience guilty of temporarily pirating the Google Apps from your device, you may delete the modified system.img and restore the original from system-original.img.

Catechol answered 22/3, 2013 at 22:10 Comment(6)
There doesn't seem to be a working YAFF2 editor for Linux—but fortunately, it turns out that with a one-line change, Yaffey itself compiles and runs on Linux. Posted the steps I used on this Ask Ubuntu question.Susiesuslik
+1s are way too less for the aha- moment happiness.. StackOverflow should have a kiss-cos-ur-so-happy-button :)Subtitle
I was able to pull the three APKs off of aa Android 4.1.2 phone without root, but I'm still working on getting them installed someplace else.Thoughtful
Any yaffey alternative for Mac?Cloven
@OlcayErtaş Mac Yaffey: github.com/danielkutik/yaffey. Builds a Yaffey.app, works perfectly on my Yosemite.Virchow
Good approach, wasn't working quite right for me. In the end I got the standard 4.0.4 x86 with working gapps by inserting all of the app, lib, and etc/permission files into the system image.Virchow
R
4
  1. Download the gapps package from http://goo.im/gapps
  2. extract GoogleLoginService.apk,GoogleServicesFramework.apk and Vending.apk Go to cmd window type adb shell
    1. on the shell type mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
    2. then press Ctrl+c to exit. cd to the directory where apks has been extracted,
    3. type adb push <appname>.apk /system/app
    4. then type adb reboot
Ruthie answered 8/8, 2013 at 4:55 Comment(5)
Where I need to place the .apk file.In my project or adt bundle platform tools?Ruction
copy it to platform-tools unless you have set your PATH environmental variableRuthie
Permission Denied.Allayne
@SanyamJain Did you solve that problem? I get the same message, mount: Permission deniedEstragon
@JoshuaSon: No I couldn't. And after reading from various sources I came to conclusion that It might not be worth the effort, as the emulator keeps on crashing or this strategy doesn't work for Upcoming versions of Android. Correct me if I am wrong :)Allayne
M
3

It is simple for me i downloaded the apk file in my computer and drag that file to emulator it install the google play for me Hope it help some one

Mccool answered 21/3, 2016 at 17:11 Comment(0)
P
2

You could download it from a Android 4.0 phone and then mount the system image rw and copy it over.

Didnt tried it before but it should work.

Politesse answered 22/6, 2012 at 10:18 Comment(1)
Nope, the zip with GAPPS is too big.Tomekatomes
C
0

Playstore + Google Play Services In Linux(Ubuntu 14.04)


Download Google apps (GoogleLoginService.apk , GoogleServicesFramework.apk )

from here http://www.securitylearn.net/2013/08/31/google-play-store-on-android-emulator/

and Download ( Phonesky.apk) from here https://basketbuild.com/filedl/devs?dev=dankoman&dl=dankoman/Phonesky.apk

GO TO ANDROID SDK LOCATION>>

cd -Android SDK's tools Location-

TO RUN EMULATOR>>

Android/Sdk/tools$ ./emulator64-x86 -avd Kitkat -partition-size 566 -no-audio -no-boot-anim

SET PERMISSIONS>>

cd Android/Sdk/platform-tools platform-tools$ adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock0 /system

platform-tools$ adb shell chmod 777 /system/app

platform-tools$ adb push /home/nazmul/Downloads/GoogleLoginService.apk /system/app/.

PUSH PLAY APKS >>

platform-tools$ adb push /home/nazmul/Downloads/GoogleServicesFramework.apk /system/app/. platform-tools$ adb push /home/nazmul/Downloads/Phonesky.apk /system/app/. platform-tools$ adb shell rm /system/app/SdkSetup*

Cascade answered 14/10, 2015 at 17:3 Comment(1)
System doesn't have enough space to install GAPPS.Tomekatomes
P
-1

Have you ever tried Genymotion? I've read about it last week and it is great. They have several Android Images that you run (with their own software). The images are INCREDIBLY fast and they have Google Play installed on them. Check it out if it is the kind of thing that you need.

http://www.genymotion.com/

Publicspirited answered 2/9, 2013 at 13:12 Comment(2)
genymotion does not provide VMs with API level lower than 16Excerpt
As a comment about Genymotion, in advise to the arbitrary reader: Genymotion uses the VirtualBox Virtualization platform. VIrtualBox is designed as to emulate Intel microcontroller platforms. Due to this limitation, It may not be possible to emulate ARM microcontroller platforms with Genymotion. This, of course, may serve to introduce an orthogonal question, as whether, when, and why it may be necessary to beta-test an app using a cross-platform SDK, on every single possible microconotroller or microcontroller emulator. The Intel-virt limitation may not be as much a concern, not in all apps?Intensifier

© 2022 - 2024 — McMap. All rights reserved.