Skip to content

Android snapshot misses text when XML attributes use single quotes in uiautomator dump #25

@XiaoPengYouCode

Description

@XiaoPengYouCode

Summary

On Android, agent-device snapshot --raw --json misses some visible text content. The missing text is present in adb shell uiautomator dump output.

Environment

  • agent-device version: v0.2.4
  • device: vivo x80

Repro

  1. Open a screen containing long text.
  2. Run:
    • adb shell uiautomator dump /sdcard/window_dump.xml
    • adb shell cat /sdcard/window_dump.xml
    • pnpm ad snapshot --raw --json
  3. Compare outputs.

Observed

In dumped XML, some nodes have:

  • content-desc="..."
  • and others have content-desc='...' (single-quoted)

snapshot seems to capture double-quoted values but miss single-quoted ones.

Expected

snapshot should capture both single-quoted and double-quoted attribute values consistently.

Notes

This may affect text, content-desc, and resource-id parsing for some Android UI hierarchies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions