Skip to content

Live viewer, annotations & test healing

olef v3.18.0View Markdown

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.

1. Human annotates Circle a bug in the live device viewer Annotate mode 2. Olef resolves it Element + selector + Compose file:line + crop olef pane annotations 3. Agent fixes fast Edits Kotlin/Compose and hot-applies in ~1.5s olef app apply 4. Verify & keep Prove fix & save deterministic test record save / test run
Instead of describing "the second small icon near the top right," circle it once and let Olef hand your agent the exact selector and Compose source file:line.

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:

Terminal window
olef pane

For cloud emulators and remote leased phones, use ocloud emulator viewer <name> or ocloud devices view <spec> to get a hosted browser viewer link.

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:

Terminal window
olef pane annotations

For each note, Olef returns:

  • Your comment text
  • The matched UI element and a stable selector for it
  • The composables that drew it with file:line source 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:

Terminal window
olef ui audit
olef ui audit --a11y

To 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:

Terminal window
olef ui gen

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:

Terminal window
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.

See olef pane, olef ui, and olef test.