Android 4.0 模拟器上的 Google Play

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11154222/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 06:10:49  来源:igfitidea点击:

Google Play on Android 4.0 emulator

androidgoogle-play

提问by Sarath

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

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

回答by Mohan raja

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


这里下载 Google 应用程序(GoogleLoginService.apk、GoogleServicesFramework.apk、Phonesky.apk)。

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*

回答by Androiderson

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:

截至目前,Android 4.2.2 平台包括 Google Play 服务。只需使用运行 Jelly Bean 的模拟器即可。详细信息可以在这里找到:

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 easilyinstalled manually. Just download the right version from hereand drag and drop into the virtual device (emulador).

2.0 版本之后 Genymotion 默认不自带 Play 服务,但可以很容易地手动安装。只需从此处下载正确的版本,然后拖放到虚拟设备 (emulador) 中即可。

回答by gregko

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 Yaffeyon Windows, or a similar utility on other systems, to modify YAFFS2 images. Copy GoogleLoginService.apk, GoogleServicesFramework.apk, and Phonesky.apk(or Vending.apkin older versions of Android) to the /system/appfolder of the system.imgfile of the emulator. Afterwards I can start the emulator normally, without messing with adb, and Play Store is always there.

我以更永久的方式执行此操作 - 而不是每次使用 安装 APK,而是adb将它们永久添加到模拟器使用的系统映像中。您将需要Windows 上的Yaffey或其他系统上的类似实用程序来修改 YAFFS2 映像。将GoogleLoginService.apkGoogleServicesFramework.apk、 和Phonesky.apk(或Vending.apk在旧版 Android 中)/system/app复制system.img到模拟器文件所在的文件夹。之后我就可以正常启动模拟器了,不用弄乱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 yaffeyon Windows or a similar utility on Linux or Mac, and open system.imgfor the emulator image you want to modify. I modify most often the one in [...]\android-sdk\system-images\android-17\x86.

现在yaffey在 Windows 或 Linux 或 Mac 上的类似实用程序上启动,并打开system.img要修改的模拟器映像。我最常修改[...]\android-sdk\system-images\android-17\x86.

Rename the original system.imgto system-original.img. Under yaffey, copy the APK files you pulled from your device to /app folder. Save your modified image as system.imgin 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.apkand SdkSetup.odex- the Play Store and other services still work fine for me with these files present.

将原始文件重命名system.imgsystem-original.img. 在 yaffey 下,将您从设备中提取的 APK 文件复制到 /app 文件夹。将修改后的图像保存system.img在原始文件夹中。然后启动您的模拟器(在我的情况下,它将是带有英特尔 Atom 处理器的 Android 4.2 模拟器,在英特尔 HAX 下运行,在 Windows 机器上速度超快),您将在那里拥有 Play 商店。我认为没有必要删除SdkSetup.apk并且SdkSetup.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.imgand restore the original from system-original.img.

完成测试后,为了减轻您暂时从您的设备盗版 Google Apps 的良心,您可以system.imgsystem-original.img.

回答by insomniac

  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
  1. http://goo.im/gapps下载 gapps 包
  2. 提取 GoogleLoginService.apk、GoogleServicesFramework.apk 和 Vending.apk 转到 cmd 窗口类型 adb shell
    1. 在外壳类型上 mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
    2. 然后按 Ctrl+c 退出。cd到apks解压后的目录,
    3. 类型 adb push <appname>.apk /system/app
    4. 然后输入 adb reboot

回答by Muhammad Asif Javed

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

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

回答by reox

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

您可以从 Android 4.0 手机下载它,然后挂载系统映像rw并将其复制过来。

Didnt tried it before but it should work.

以前没有尝试过,但应该可以。

回答by Nazmul



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/. platform-tools$ adb push /home/nazmul/Downloads/Phonesky.apk /system/app/. platform-tools$ adb shell rm /system/app/SdkSetup*

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

回答by Oliver Drummond

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.

你有没有尝试过 Genymotion?我上周读过它,它很棒。他们有几个您运行的 Android 映像(使用他们自己的软件)。图像非常快,并且安装了 Google Play。检查它是否是您需要的那种东西。

http://www.genymotion.com/

http://www.genymotion.com/