问题描述
我从最新版本的Android Studio AVD中选择了此模拟器.
I selected this emulator from the newest version of Android Studio AVD.
我选择了最新版本的android API23.因为它说的是"with Google APIs",所以我认为它实际上将包括所有Google应用(包括Play商店),以便我可以安装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上的其他线程似乎已经过时了(),该指南提供了基于通用软件包安装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
我想要一个API23.是否可以在模拟器上安装Google Apps软件包?
I would like the one for API 23. Is there a way to install the Google Apps package on the emulator?
奇怪的是,官方的android模拟器并不是所有google应用程序都标配的……这似乎并不十分支持google,这可能意味着开发人员必须购买实际的设备才能进行开发对于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.
这篇关于Play Studio不随附适用于API 23的Android Studio模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!