如何为从 Google Play 安装的应用程序使用布局检查器?

How can I use Layout Inspector for apps installed from Google Play?

我试图将 LayoutInspector 用于来自 Google Play 的应用程序。我有一个 root 设备,所以当我执行 "Show all processes" 时,我开发的所有 运行 应用程序都会显示,但不会显示官方应用程序。

您可以转到 /Users/.../Library/Android/sdk/tools/monitor

和select转储视图

您可以使用 UiAutomator2 Viewer(来自 android SDK 的工具)

{ your sdk path} \tools\bin\uiautomatorviewer.bat

此工具显示设备显示屏上可见的所有元素的完整层次结构和属性(无论哪个应用 运行)。

同样在“Katalon studio”中,我们有一个名为 Mobile Spy 的工具,它具有相同的功能 + 完整的 Xpath

Note that you should have adb server running with connecting the device. so the "adb devices" must return device id.