Android Studio模拟器并没有Play Store for API 23(Android Studio emulator does not come with Play Store for

系统教程 行业动态 更新时间:2024-06-14 17:02:18
Android Studio模拟器并没有Play Store for API 23(Android Studio emulator does not come with Play Store for API 23)

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

我选择了最新版本的Android API 23.因为它说“使用Google API”,我以为它实际上会包括所有的Google应用程序,包括Play Store,以便我可以安装像Facebook这样的应用程序。

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

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

似乎很奇怪的是,官方的android模拟器不符合所有的谷歌应用程序的第一名...这似乎不是很支持谷歌,潜在的意思是开发人员将不得不购买实际的设备来开发API 23 ?

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

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.

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

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

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模拟器,因此您不应该有问题。

注意:所有的信用都是链接的博文(pyoor)的作者。 我只是在这里发布,以防链接由于任何原因而中断。

....

下载GAPPS软件包

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

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

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

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。

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

创建AVD时,这可能需要几分钟的时间。 一旦启动,我们需要将AVDs系统分区重新安装为读/写,以便我们将软件包推送到设备上。

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

接下来,将APK推送到我们的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

利润!

最后,使用以下命令重新启动Emualator:

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

一旦模拟器重新启动,我们应该看到Google Play软件包出现在菜单启动器中。 在将Google帐户与此AVD关联后,我们现在拥有完全正常版本的Google Play,并在我们的模拟器下运行。

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.

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.

....

Download the GAPPS Package

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

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

[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 ./

Push APKs to the Emulator

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

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

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

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

Profit!

And finally, reboot the emualator using the following commands:

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

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.

更多推荐

本文发布于:2023-04-21 19:00:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/b0b15d3f1b95171fc928ed55ed85c151.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:模拟器   Play   Android   Studio   emulator

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!