Skip to content

Instantly share code, notes, and snippets.

@kosiara
Last active November 26, 2023 13:01
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save kosiara/c6c7323621ca712ab831 to your computer and use it in GitHub Desktop.
Save kosiara/c6c7323621ca712ab831 to your computer and use it in GitHub Desktop.
Android - Install Google Play Services / Google Play on android emulator
1. Download Google Apps from basketbuild.com:
https://basketbuild.com/gapps
2. Extract GPE services apk files from the zip:
unzip -j gapps-lp-20150222-signed.zip system/priv-app/GoogleServicesFramework/GoogleServicesFramework.apk system/priv-app/GoogleLoginService/GoogleLoginService.apk system/priv-app/Phonesky/Phonesky.apk system/priv-app/GmsCore/GmsCore.apk -d ./
3. Start the emulator with the command:
/home/path/to/your/android/Sdk/tools/emulator -no-boot-anim -netdelay none -netspeed full -avd YOUR_EMULATOR_NAME
4. Remount the file system from read-only to read-write:
adb remount
5. Copy the apks to the emulator:
adb push GmsCore.apk /system/priv-app/
adb push GoogleServicesFramework.apk /system/priv-app/
adb push GoogleLoginService.apk /system/priv-app/
adb push Phonesky.apk /system/priv-app/
6. Reboot the emulator:
adb shell stop && adb shell start
========================
7. Use http-proxy in emulator:
/home/path/to/your/android/Sdk/tools/emulator -http-proxy http://127.0.0.1:8888 -avd "Your_emulator_name"
8. Install apk on a specific device:
adb -s emulator-5556 install "com.your.app.apk"
9. Stop emulator
adb -s emulator-5554 emu kill
@kosiara
Copy link
Author

kosiara commented Oct 9, 2015

#!/bin/bash

/home/user/Android/Sdk/tools/emulator -no-boot-anim -netdelay none -netspeed full -avd "Nexus_5_API_22"
echo "emulator started"
adb remount
echo "emulator fs remounted"
adb push ./system/priv-app/GmsCore/GmsCore.apk ./system/priv-app/
echo "emulator GmsCore pushed"
adb push ./system/priv-app/GoogleServicesFramework/GoogleServicesFramework.apk ./system/priv-app/
echo "emulator GoogleServicesFramework pushed"
adb push ./system/priv-app/GoogleLoginService/GoogleLoginService.apk ./system/priv-app/
echo "emulator GoogleLoginService pushed"
adb push ./system/priv-app/Phonesky/Phonesky.apk ./system/priv-app/
echo "emulator Phonesky pushed"
sleep 5
adb shell stop && adb shell start
echo "emulator restarted"

@anonym24
Copy link

anonym24 commented Jun 10, 2018

adb: error: failed to copy 'app/GoogleContactsSyncAdapter/GoogleContactsSyncAdapter.apk' to '/system/app/GoogleContactsSyncAdapter/GoogleContactsSyncAdapter.apk': remote No space left on device

I increased anything I could, but there is still no space left... (added in config/emu ini files data partition 2gb, system partition 1gb, sdcard 2gb, what that emulator needs else?)

@itaispector
Copy link

@anonym24 same here

@allesklarbeidir
Copy link

@itaispector , @anonym24
I had the same issue and solved it using this stackoverflow answer:
https://stackoverflow.com/a/38574745/6721161

You manipulate the default system.img (backup it beforehand) and then create a new device based on that image.

@chandniKkpl
Copy link

@itaispector , @anonym24
I had the same issue and solved it using this stackoverflow answer:
https://stackoverflow.com/a/38574745/6721161

You manipulate the default system.img (backup it beforehand) and then create a new device based on that image.

url is showing 404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment