Skip to content

Olef in your Android workflow

CLI v3.0.2View Markdown

Olef gives you and your coding agent a structured interface to a running Android app. Keep Android Studio, your editor, Gradle, and code review workflow. Use Olef for the feedback loop between source changes and actual device behavior.

You want to… Start here
Find the cause of a crash Reproduce, diagnose, fix, verify
Inspect Compose structure and state Inspect a Compose screen
Understand a failed request Debug a network request
Preserve a working user flow Record a regression test
Run repeatable checks without a model Run tests in CI
Set breakpoints and inspect locals Debugger guide
  1. Read the current screen with ui dump.
  2. Act using a stable selector, and assert the destination with an --expect-* option.
  3. Inspect logs, network traffic, layouts, or debugger state when the result is wrong.
  4. Change the source and apply the build with app apply.
  5. Repeat the failing behavior and verify the result.
Terminal window
olef ui dump
olef ui tap --rid settings_button --expect-text "Settings"
olef why

The selector and expected text above are illustrative: choose them from your own app’s current screen. Configure your app and project using configuration.

Java/Kotlin debugging uses JDWP directly. Native and mixed debugging use NDK LLDB. Olef exposes breakpoints, call stacks, locals, stepping, and snapshots as structured output, so an agent can diagnose behavior without an interactive IDE debugger.

JDWP permits one debugger per app process. Detach Android Studio’s debugger before attaching Olef to that process, and vice versa. Native debugging has additional NDK and ABI requirements; see capabilities.

Use your own emulator or connected device, or use Olef Cloud for managed workspaces and emulators. Your agent can remain in its usual environment. For multiple projects or concurrent agents, use named targets and sessions to make device ownership explicit.

Olef holds Android’s single UiAutomation slot while connected. If your Espresso or UI Automator suite needs that slot, run it through:

Terminal window
olef test -- ./gradlew connectedDebugAndroidTest

This disconnects Olef, runs the command, and reconnects afterward. Olef’s own recorded tests use olef test run instead. See CI.