Olef in your Android workflow
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.
Choose a problem
Section titled “Choose a problem”| 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 |
The development loop
Section titled “The development loop”- Read the current screen with
ui dump. - Act using a stable selector, and assert the destination with an
--expect-*option. - Inspect logs, network traffic, layouts, or debugger state when the result is wrong.
- Change the source and apply the build with
app apply. - Repeat the failing behavior and verify the result.
olef ui dumpolef ui tap --rid settings_button --expect-text "Settings"olef whyThe selector and expected text above are illustrative: choose them from your own app’s current screen. Configure your app and project using configuration.
A debugger your agent can use
Section titled “A debugger your agent can use”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.
Local and managed environments
Section titled “Local and managed environments”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.
Keep your existing tests
Section titled “Keep your existing tests”Olef holds Android’s single UiAutomation slot while connected. If your Espresso or UI Automator suite needs that slot, run it through:
olef test -- ./gradlew connectedDebugAndroidTestThis disconnects Olef, runs the command, and reconnects afterward. Olef’s own recorded tests use olef test run instead. See CI.