【问题标题】:uiautomatorviewer no longer shows resource-iduiautomatorviewer 不再显示资源 ID
【发布时间】:2015-03-06 23:36:02
【问题描述】:

我使用 uiautomatorviewer 快速获取资源 ID 以创建验收测试,但在过去几周,我注意到该字段不再存在。我不确定这是我的问题,还是改变了的工具。

以前,我可以查看元素的资源 ID:

现在,resource-id 字段不再存在(选择的元素确实有一个 id):

我刚刚更新到 Android SDK Tools 22.3,但这是在更新之前发生的。不幸的是,我没有注意到这开始发生的版本。:/

【问题讨论】:

  • 内容描述仅供参考。资源 ID 仍然显示在我的查看器上,但我从不使用它。
  • @Binghammer 虽然这将是理想的(因为 content-descs 使应用程序更易于访问),但正如您在上面看到的,某些元素没有它们。不过,这些元素确实有资源 ID,这就是为什么我想使用 uiautomatorviewer 找到它们,而不必挖掘 /res/layout/。

标签: android-sdk-tools android-uiautomator


【解决方案1】:

问题可能出在 Android 版本上? 我正在使用 uiautomatorviewer 与带有 Android 4.3 的 Galaxy Samsung S4 (GT-I9505) 连接,我可以从查看器中看到资源 ID,但我无法使用带有 Android 4.1.2 的 Samsung Galaxy Note II (GT-N7100) .

【讨论】:

  • 啊,你是对的。我猜它不支持
【解决方案2】:

资源 ID 的可见性取决于 Adnroid 版本。它支持 Android 4.3 或更高版本/API 级别 18。我们的一位开发人员也证实了这一点。

另一个参考:real device Vs emulator : uiautomator does not show resource-id for the app

谢谢, 拉维坎特

【讨论】:

    【解决方案3】:

    您将能够根据您使用的设备查看资源 ID。某些设备不允许开发人员使用 uiauromator 查看器显示资源 ID。尝试使用 nexus 设备,您会发现显示的资源 ID。

    【讨论】:

    • 以上屏幕截图是在 Nexus 4 AVD(API 级别 18)上使用 uiautomatorviewer 时拍摄的,它曾经可以工作。我再次尝试在 Genymotion 模拟器(Nexus 4,API 级别 17)上使用它,但它仍然无法正常工作。我还尝试在各种真实设备上使用它,包括 Galaxy S4 和 Galaxy Note。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-12
    • 1970-01-01
    • 2014-11-24
    • 1970-01-01
    • 1970-01-01
    • 2012-05-20
    相关资源
    最近更新 更多