Android Studio 模拟器不附带 API 23 的 Play 商店 [英] Android Studio emulator does not come with Play Store for API 23

查看:45
本文介绍了Android Studio 模拟器不附带 API 23 的 Play 商店的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从最新版本的 Android Studio AVD 中选择了这个模拟器.

I selected this emulator from the newest version of Android Studio AVD.

我选择了最新版本的 android API 23.因为它说with Google APIs",我认为它实际上会包含所有 Google 应用程序,包括 Play Store,这样我就可以安装像 Facebook 这样的应用程序.

I have selected the latest version of android API 23. Because it says "with Google APIs", I thought that it would actually include all the Google apps, including Play Store so that I can install apps like Facebook.

我在 SO 上看到过其他线程,这些线程现在似乎已经过时了 (如何在 Android Studio 模拟器中安装 Google Play 应用程序?),这篇文章给出了安装基于通用包的 Google 应用程序的说明,但它只适用于 Android 4.3 API 18:http://wiki.rootzwiki.com/Google_Apps#Universal_Packages_2

I have seen other threads on SO which seems to be outdated now (How to install Google Play app in Android Studio emulator?), this one gives instructions for installing Google apps based on universal packages but it only goes up to Android 4.3 API 18: http://wiki.rootzwiki.com/Google_Apps#Universal_Packages_2

我想要 API 23 的那个.有没有办法在模拟器上安装 Google Apps 包?

I would like the one for API 23. Is there a way to install the Google Apps package on the emulator?

似乎很奇怪,官方的 android 模拟器一开始并不是所有谷歌应用程序的标准...对于 API 23?

It seems strange that the official android emulator doesn't come standard with all the google apps in the first place...This doesn't seem very supportive of google and would potential mean developers will have to buy actual devices to develop for API 23?

推荐答案

我最近不得不在 API 23 模拟器上执行此操作,并遵循了 本指南.它适用于 API 23 模拟器,所以你应该没有问题.

I've had to do this recently on the API 23 emulator, and followed this guide. It works for API 23 emulator, so you shouldn't have a problem.

注意:所有功劳归于链接博客文章 (pyoor) 的作者.我只是在这里发布,以防链接因任何原因中断.

Note: All credit goes to the author of the linked blog post (pyoor). I'm just posting it here in case the link breaks for any reason.

....

下载 GAPPS 包

接下来,我们需要下拉与我们的 Android AVD 版本匹配的相应 Google Apps 软件包.在这种情况下,我们将使用gapps-lp-20141109-signed.zip"包.您可以从 BasketBuild 此处下载该文件.

Next we need to pull down the appropriate Google Apps package that matches our Android AVD version. In this case we’ll be using the 'gapps-lp-20141109-signed.zip' package. You can download that file from BasketBuild here.

[pyoor@localhost]$ md5sum gapps-lp-20141109-signed.zip
367ce76d6b7772c92810720b8b0c931e gapps-lp-20141109-signed.zip

为了安装 Google Play,我们需要将以下 4 个 APK 推送到我们的 AVD(位于 ./system/priv-app/):

In order to install Google Play, we’ll need to push the following 4 APKs to our AVD (located in ./system/priv-app/):

GmsCore.apk、GoogleServicesFramework.apk、GoogleLoginService.apk、Phonesky.apk

GmsCore.apk, GoogleServicesFramework.apk, GoogleLoginService.apk, Phonesky.apk

[pyoor@localhost]$ unzip -j gapps-lp-20141109-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 ./

将 APK 推送到模拟器

提取 APK 后,让我们使用以下命令启动 AVD.

With our APKs extracted, let’s launch our AVD using the following command.

[pyoor@localhost tools]$ ./emulator @<YOUR_DEVICE_NAME> -no-boot-anim

第一次创建 AVD 时,这可能需要几分钟时间.启动后,我们需要将 AVD 系统分区重新挂载为读/写,以便我们可以将我们的包推送到设备上.

This may take several minutes the first time as the AVD is created. Once started, we need to remount the AVDs system partition as read/write so that we can push our packages onto the device.

[pyoor@localhost]$ cd ~/android-sdk/platform-tools/
[pyoor@localhost platform-tools]$ ./adb remount

接下来,将 APK 推送到我们的 AVD:

Next, push the APKs to our AVD:

[pyoor@localhost platform-tools]$ ./adb push GmsCore.apk /system/priv-app/
[pyoor@localhost platform-tools]$ ./adb push GoogleServicesFramework.apk /system/priv-app/
[pyoor@localhost platform-tools]$ ./adb push GoogleLoginService.apk /system/priv-app/
[pyoor@localhost platform-tools]$ ./adb push Phonesky.apk /system/priv-app

利润!

最后,使用以下命令重启模拟器:

And finally, reboot the emualator using the following commands:

[pyoor@localhost platform-tools]$ ./adb shell stop && ./adb shell start

一旦模拟器重新启动,我们应该会看到 Google Play 包出现在菜单启动器中.将 Google 帐户与此 AVD 相关联后,我们现在有一个完整的 Google Play 版本在我们的模拟器下运行.

Once the emulator restarts, we should see the Google Play package appear within the menu launcher. After associating a Google account with this AVD we now have a fully working version of Google Play running under our emulator.

这篇关于Android Studio 模拟器不附带 API 23 的 Play 商店的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆