Live viewer, annotations & test healing
Outcome: collaborate visually with your coding agent on a live Android screen, pointing at exact UI issues, recording flows by hand, auditing selector stability, and repairing broken tests without weakening assertions.
Visual collaboration loop
Section titled “Visual collaboration loop”1. Open the live device viewer
Section titled “1. Open the live device viewer”The Claude Code and Codex plugins (olef init) embed the interactive viewer directly alongside your conversation. You can also launch the loopback viewer standalone from any terminal:
olef paneFor cloud emulators and remote leased phones, use ocloud emulator viewer <name> or ocloud devices view <spec> to get a hosted browser viewer link.
2. Circle a bug with Annotate mode
Section titled “2. Circle a bug with Annotate mode”In the viewer, switch to Annotate, outline one or more elements on screen, and leave a short note on each (for example, “Padding clips on small screens” or “Button stays disabled after filling email”).
Your agent then reads every note in one structured call:
olef pane annotationsFor each note, Olef returns:
- Your comment text
- The matched UI element and a stable selector for it
- The composables that drew it with
file:linesource locations (when project source mapping is configured) - An overview PNG with every note outlined and numbered, plus close-up crops for small targets
Reading annotations clears them from the viewer so they are not reprocessed; pass --keep to retain them.
3. Audit selectors & generate Screen Objects
Section titled “3. Audit selectors & generate Screen Objects”Before writing or recording tests, check which interactive elements on the current screen lack stable selectors (resource-id or Compose testTag), or audit accessibility issues:
olef ui auditolef ui audit --a11yTo scaffold typed test helpers from a real screen, generate a starting-point Kotlin Screen Object with stable selectors filled in and untagged elements marked as TODO:
olef ui gen4. Heal broken regression tests safely
Section titled “4. Heal broken regression tests safely”When an intentional UI refactor changes a label or resource ID and a saved test fails, ask Olef to inspect the failure artifacts and propose a minimal patch:
olef test heal <failed-run-dir>test heal matches the failed step against the closest candidate selectors captured at failure time (or highlights a changed expectation for you to confirm). It never edits the script automatically and never weakens assertions silently.