inspect_view_hierarchy
Inspect an Android Activity's view tree for custom View classes, resource IDs, and hidden nodes, with filters to narrow output. Requires ROMs whose dumpsys activity top returns view data.
Instructions
【仅用于已知能吐出 View 树的 ROM】通过 dumpsys activity top 取 Activity/Task 记录。
注意:本机 HyperOS(Android 16)实测该命令不返回任何 View 层级——mID=、mText、
android:text 均为 0 行,微信整份输出只有 776 字节。所以在该机型上它拿不到控件信息,
需要理解界面请直接用 ui_describe(OS 语义,非 OCR)。
在确实支持 AOSP 式 dumpsys activity top 的 ROM 上,本工具可能额外给出:
真实的自定义 View 类名;2. 16 进制资源 ID 锚点;3. 被隐藏的 GONE/INVISIBLE 节点。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keyword | No | 可选过滤关键词(如自定义 View 类名、0x7f 资源号、id 名称),留空返回顶层起全部视图 | |
| max_lines | No | 最大返回视图行数,默认 180 | |
| visibility_filter | No | 可见性过滤:'ALL'(全部,含 GONE/INVISIBLE 隐藏广告锚点)、'VISIBLE'(仅可见)、'GONE'(仅隐藏) | ALL |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |