【问题标题】:How to test an android app with non-existing or outdated Google Play Services?如何使用不存在或过时的 Google Play 服务测试 android 应用程序?
【发布时间】:2016-01-01 06:59:42
【问题描述】:

我正在构建一个通过 Google Play 服务使用地图的 Android 应用。

在应用程序中,我正在检查是否安装了具有以下功能的 Google Plays 服务:GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable。如果 Google Play 服务不可用,我会显示一条消息:“请安装 Google Play 服务以继续。”

如何在模拟器或设备上对其进行测试?当 Google Play 服务不可用或版本不正确时,如何模拟这种情况?在我的设备上安装了 Google Play 服务,所以我的应用程序总是走上愉快的道路。模拟器上也一样。我想检查我的应用在没有 Google Play 服务的设备上不会崩溃,但会显示说明。

【问题讨论】:

    标签: android google-play-services


    【解决方案1】:

    您可能希望通过转到设置 > 应用程序 > Google Play 服务 > 卸载更新来对 Google Play 服务进行“卸载更新”。

    【讨论】:

      【解决方案2】:

      您还可以使用 Android Studio 模拟没有 Google Play 服务的设备:创建一个新的虚拟设备,然后在选择系统映像时选择一个没有 Google API 的设备。

      【讨论】:

      • 这很有趣,但是在没有 Google Play 服务的 API 19 模拟器上,它返回了成功代码(使用 stackoverflow.com/questions/36218434/…)和 'com.google.android.gms:play-services-maps:17.0.0 '。
      猜你喜欢
      • 2014-06-01
      • 2016-11-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-13
      • 1970-01-01
      相关资源
      最近更新 更多