简体   繁体   English

Android 4.0 模拟器上的 Google Play

[英]Google Play on Android 4.0 emulator

如何将 Google Play .apk 安装到我的 Android 4.0 模拟器上?

Download Google apps (GoogleLoginService.apk , GoogleServicesFramework.apk , Phonesky.apk)下载 Google 应用程序(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*

For future visitors.对于未来的访客。

As of now Android 4.2.2 platform includes Google Play services.截至目前,Android 4.2.2 平台包括 Google Play 服务。 Just use an emulator running Jelly Bean.只需使用运行 Jelly Bean 的模拟器即可。 Details can be found here:详细信息可以在这里找到:

Setup Google Play Services SDK设置 Google Play 服务 SDK

EDIT:编辑:

Another option is to use Genymotion (runs way faster)另一种选择是使用Genymotion (运行速度更快)

EDIT 2:编辑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"正如@gdw2 评论的那样: “设置 Google Play 服务 SDK 不会安装可运行的 Google Play 应用程序——它只是启用 SDK 提供的某些服务”

After version 2.0 Genymotion does not come with Play Services by default, but it can be easily installed manually. 2.0 版本之后 Genymotion 默认不自带 Play 服务,但可以很容易地手动安装。 Just download the right version from here and drag and drop into the virtual device (emulador).只需从此处下载正确的版本,然后拖放到虚拟设备 (emulador) 中即可。

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.我以一种更永久的方式执行此操作 - 而不是每次都使用adb安装 APK,而是将它们永久添加到模拟器使用的系统映像中。 You will need Yaffey on Windows, or a similar utility on other systems, to modify YAFFS2 images.您将需要 Windows 上的Yaffey或其他系统上的类似实用程序来修改 YAFFS2 映像。 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.GoogleLoginService.apkGoogleServicesFramework.apkPhonesky.apk (或旧版 Android 中的Vending.apk )复制到模拟器的system.img文件的/system/app文件夹中。 Afterwards I can start the emulator normally, without messing with adb, and Play Store is always there.之后我就可以正常启动模拟器了,不用弄乱adb,Play Store一直都在。

Obtaining the Google Play app from your device从您的设备获取 Google Play 应用

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:从某些 Internet 站点下载 Google Apps 可能不太合法,但如果您有具有相应 Android 版本的手机或平板电脑,只需将它们从您的设备中取出即可:

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.您必须对设备具有根级访问权限(运行 adb root)才能从中提取这些文件。

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.现在在 Windows 上启动yaffey或在 Linux 或 Mac 上启动类似的实用程序,并为要修改的模拟器映像打开system.img I modify most often the one in [...]\\android-sdk\\system-images\\android-17\\x86 .我最常修改[...]\\android-sdk\\system-images\\android-17\\x86那个。

Rename the original system.img to system-original.img .将原来的system.img重命名为system-original.img Under yaffey, copy the APK files you pulled from your device to /app folder.在 yaffey 下,将您从设备中提取的 APK 文件复制到 /app 文件夹。 Save your modified image as system.img in the original folder.将修改后的图像作为system.img保存在原始文件夹中。 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.然后启动您的模拟器(在我的情况下,它将是带有英特尔 Atom 处理器的 Android 4.2 模拟器,在英特尔 HAX 下运行,在 Windows 机器上速度超快),您将在那里拥有 Play 商店。 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.我认为没有必要删除SdkSetup.apkSdkSetup.odex - 在这些文件存在的情况下,Play 商店和其他服务对我来说仍然可以正常工作。

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 .完成测试后,为了减轻您暂时从您的设备盗版 Google Apps 的良心,您可以删除修改后的system.img并从system-original.img恢复system-original.img

  1. Download the gapps package from http://goo.im/gappshttp://goo.im/gapps下载 gapps 包
  2. extract GoogleLoginService.apk,GoogleServicesFramework.apk and Vending.apk Go to cmd window type adb shell提取 GoogleLoginService.apk,GoogleServicesFramework.apk 和 Vending.apk 到 cmd 窗口输入adb shell
    1. on the shell type mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system在外壳上键入mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
    2. then press Ctrl+c to exit.然后按 Ctrl+c 退出。 cd to the directory where apks has been extracted, cd到apks解压后的目录,
    3. type adb push <appname>.apk /system/app输入adb push <appname>.apk /system/app
    4. then type adb reboot然后输入adb reboot

You could download it from a Android 4.0 phone and then mount the system image rw and copy it over.您可以从 Android 4.0 手机下载它,然后挂载系统映像rw并复制它。

Didnt tried it before but it should work.以前没有尝试过,但应该可以。

这对我来说很简单,我在我的电脑中下载了 apk 文件并将该文件拖到模拟器它为我安装了谷歌播放希望它对某人有所帮助


Playstore + Google Play Services In Linux(Ubuntu 14.04) Linux 中的 Playstore + Google Play 服务(Ubuntu 14.04)


Download Google apps (GoogleLoginService.apk , GoogleServicesFramework.apk )下载 Google 应用程序( GoogleLoginService.apk 、 GoogleServicesFramework.apk )

from here http://www.securitylearn.net/2013/08/31/google-play-store-on-android-emulator/从这里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并从这里下载 (Phonesky.apk) https://basketbuild.com/filedl/devs?dev=dankoman&dl=dankoman/Phonesky.apk

GO TO ANDROID SDK LOCATION>>前往 ANDROID SDK 位置>>

cd -Android SDK's tools Location- cd -Android SDK 的工具位置-

TO RUN EMULATOR>>运行模拟器>>

Android/Sdk/tools$ ./emulator64-x86 -avd Kitkat -partition-size 566 -no-audio -no-boot-anim 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 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平台工具$ adb shell chmod 777 /system/app

platform-tools$ adb push /home/nazmul/Downloads/GoogleLoginService.apk /system/app/.平台工具$ adb push /home/nazmul/Downloads/GoogleLoginService.apk /system/app/.

PUSH PLAY APKS >>推播APKS >>

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

Have you ever tried Genymotion?你有没有尝试过 Genymotion? I've read about it last week and it is great.我上周读过它,它很棒。 They have several Android Images that you run (with their own software).他们有几个您运行的 Android 映像(使用他们自己的软件)。 The images are INCREDIBLY fast and they have Google Play installed on them.图像非常快,并且安装了 Google Play。 Check it out if it is the kind of thing that you need.检查它是否是您需要的那种东西。

http://www.genymotion.com/ http://www.genymotion.com/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM