如何在Android Studio模拟器中安装Google Play应用?

use*_*702 46 android google-play android-studio

我是使用Android Studio的新手,我正在尝试在模拟器上安装Google Play应用.我已经安装了Google RepositoryGoogle Play Services,以及一个Google APIs x86 Atom System Image从SDK管理器,我能够建立谷歌播放服务我的示例应用程序.

我现在想在我的模拟器上安装Google Play应用程序.如何才能做到这一点 ?任何建议或解决方案本身都将非常受欢迎.另外,非常感谢你的时间.

Mat*_*dim 58

从Android Studio 3.0 Canary 1开始,您现在可以选择内置Play Store应用程序的设备(下图中为Nexus 5X和Nexus 5).

在此输入图像描述

  • 大!如果我想在Play商店的模拟器上测试我的应用程序,但在**平板电脑模式下**会怎样? (6认同)
  • @IgorGanapolsky 我今天检查了它仍然在那里,需要向下滚动一点 (2认同)

小智 31

经过长时间的测试,一切似乎都过时了。我找不到必要的 APK 之类的GoogleLoginService.apk

I got it to work by installing two virtual devices.

  1. My Device (a Samsung Galaxy Tab A with custom skin and sizes)
  2. A device, which had the "Play Store Available" icon in your AVD-Manager on the site where you can create a new profile.

I installed the first device and the second device with the same Android version, and used one profile from Samsung (because my tablet is a Samsung).

After that step, I compared the config.ini file located in:

C:\Users\USER\.android\avd\DEVICE_ID
Run Code Online (Sandbox Code Playgroud)

On Ubuntu/Linux it'll be in

C:\Users\USER\.android\avd\DEVICE_ID
Run Code Online (Sandbox Code Playgroud)

Change the following variables to:

PlayStore.enabled = true
image.sysdir.1=system-images\android-27\google_apis_playstore\x86\
tag.display=Google Play
tag.id=google_apis_playstore
Run Code Online (Sandbox Code Playgroud)

Here's an example diff of what fields will be changed:

屏幕截图:AVD 设备 config.ini 差异

After that you'll probably have to re-download the system image for the device, which you can do from Tools > AVD Manager.

Here's an example screenshot of what that'd look like:

屏幕截图:在 AVD Manager 中安装系统映像

Once done, restart the device, and Play store will be installed and ready to use.

  • 2021年工作!谢谢你! (5认同)
  • 当我触摸下载时,出现此错误“所有软件包均不可供下载!,以下软件包不可用: - 软件包 id 系统图像;android-23;google_apis_playstore;x86 ” (3认同)

小智 5

首先在 SDK 管理器中安装 Play 商店包。您可以按照该视频中的步骤操作

完成该步骤后,编辑config.ini位于以下位置的文件:

C:\Users\USER\.android\avd\DEVICE_ID
Run Code Online (Sandbox Code Playgroud)

或者您也可以单击Show on Disk设备选项中的 。

将以下变量更改为:

PlayStore.enabled = true
image.sysdir.1=system-images\android-27\google_apis_playstore\x86\
tag.display=Google Play
tag.id=google_apis_playstore
Run Code Online (Sandbox Code Playgroud)

完成后,重新启动设备,Play 商店将安装完毕并可供使用。


Ran*_*ira 3

从http://wiki.rootzwiki.com/Google_Apps#Universal_Packages_2下载 Google 应用程序(GoogleLoginService.apk、GoogleServicesFramework.apk、Phonesky.apk)

启动你的模拟器:

emulator -avd VM_NAME_HERE -partition-size 500 -no-audio -no-boot-anim
Run Code Online (Sandbox Code Playgroud)

然后使用以下命令:

以 rw 模式重新挂载

adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock0 /system
Run Code Online (Sandbox Code Playgroud)

允许写入系统分区上的应用程序目录

adb shell chmod 777 /system/app
Run Code Online (Sandbox Code Playgroud)

安装以下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*
Run Code Online (Sandbox Code Playgroud)

请参阅:此 SO 帖子

  • /system 不在 /proc/mounts 中 (3认同)

归档时间:

查看次数:

61649 次

最近记录:

7 年,3 月 前