如何理解为什么 "Android app is incompatible with some specific devices"

How to understand why "Android app is incompatible with some specific devices"

我在 Google Play 中的应用对某些设备不可见,无论其 Android 版本如何。有什么方法可以通过 Android Studio 或 Google Android Developer Console 了解为什么我的应用程序与 Brand X 设备不兼容?

例如;

我检查了之前输入的questions/answers,了解到原因可能是以下之一;

  1. android:需要="false" should be used for several uses-features.
  2. Could be related to application size.

我真正想知道的是了解它与特定设备不兼容的原因。不过,我会尝试这些建议并分享结果。

我的清单文件如下;

<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="10000" android:versionName="1.0.2" package="com.apps.appname" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name" android:supportsRtl="true">
    <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
        <intent-filter android:label="@string/launcher_name">
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>
**<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23" />**
<uses-feature android:name="android.hardware.usb.host" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-feature android:name="android.hardware.bluetooth_le" android:required="false" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.RECORD_VIDEO" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
</manifest>

在清单中使用 <uses-feature android:name="android.hardware.usb.host" /> 将导致 Google Play 不允许在没有 USB-host 功能的设备上安装该应用程序。
如果您仍希望该应用可用于此类设备,则应为此功能添加 "android:required="false"
请注意,您仍然无法在没有此类功能的设备上使用 USB-host 功能。尝试使用它们会导致异常。您应该在使用前检查该功能是否可用。

有什么方法可以通过 Android Studio 或 Google [=119= 了解为什么我的应用程序与 Brand X 设备不兼容] 开发者控制台?

是的,Cloud Test Lab 是一种测试应用程序兼容性的方法。

Get free automated testing of your app on physical devices covering nearly every brand, model, and version of the devices your users might have. The lab helps you quickly find compatibility issues that you might miss using only your available test devices.

使用来自 Android Studio 的云测试实验室:

将以下内容添加到 studio.vmoptions 文件中:

-Denable.google.cloud.testing.plugin=true

现在,您应该能够在 Android Studio 的 Run/Debug 配置对话框中看到 Cloud Test Lab 的其他选项。

"Cloud device matrix" 下,您可以通过单击以下图标提供不同的 "Matrix configuration":和创建不同的配置。

单击 "Apply" 并关闭 window。

现在您可以 运行 通过单击 Android Studio 中的 运行 配置图标进行测试。

使用来自 command-line

的云测试实验室

首先,安装gCloud SDk 添加 Alpha 组件以允许从 Alpha 存储库访问 Cloud Test Lab

$ gcloud components update alpha

现在为 Codelab 配置项目。如果您使用自己的项目,请替换为正确的项目 ID:

$ gcloud config set project cloud-test-lab-babbq-2015

确保您的身份验证凭据是最新的

$ gcloud auth login

为了运行在不同设备上的测试,让我们先通过运行ning这个命令查看可用设备列表:

$ gcloud alpha test android devices list

例如:

在 Nexus6 和 Nexus7 虚拟设备上进行测试,运行在英语和法语语言环境中使用 API 19 和 21 进行纵向和横向设置。 GCloud 向测试结果页面提供了 URL,每个测试完成后都会显示结果。

$ gcloud alpha test android run \
--type instrumentation \
--app app/build/outputs/apk/app-debug-unaligned.apk \

--test app/build/outputs/apk/app-debug-androidTest-unaligned.apk \

--device-ids Nexus6,Nexus7 \
--os-version-ids 19,21 \ --locales en,fr \
--orientations portrait,landscape

Guide For Using Google Cloud Test Lab

查看下方 link 了解更多详情 https://firebase.google.com/docs/test-lab/

希望对您有所帮助!!!编码愉快!!

编辑: 要查看 Firebase 项目中给定应用的所有测试矩阵的汇总测试结果,请单击应用的名称,如下面的示例测试矩阵结果页面所示。​​

示例测试执行结果页面

示例测试矩阵列表页面

只有四个测试执行的测试矩阵结果页面示例

注: 详细测试结果在您​​ 运行 测试后 90 天内可用,并存储在 Google 云存储 (GCS) 存储桶中(但也可以在 Firebase 控制台中看到)。在测试执行结果页面点击查看源文件,可以查看GCS bucket中的详细测试结果。当详细的测试结果不再可用时,您仍然可以看到哪些测试通过了哪些失败了。

注: 图片来源取自官方文档