# How Olef compares

Source: https://olef.dev/docs/engineers/compare

**Olef CLI for Android** is not a replacement for Android Studio, Gradle, or unit tests, and it works alongside your existing Espresso or UI Automator suite. The difference is **who the interface is built for and how deep it sees**.

## At a glance

| Capability | Raw `adb` + shell scripts | Espresso / UI Automator | Maestro / Appium | Olef (`olef` + `ocloud`) |
| --- | --- | --- | --- | --- |
| **Compact JSON output with error codes & `next_actions`** | No (free-form text) | JUnit/logs only | Text / runner output | **Built-in on every verb** |
| **Verified postconditions on every tap/input** | Manual sleep + poll | Assertions in test code | Flow assertions | **`--expect-*`, settle detection, staleness hashes** |
| **Fast edit-to-device (`app apply`, state kept)** | Full `installDebug` | Full APK + test APK | External build | **~1.5s hot class redef + Compose recompose** |
| **Live JDWP & native LLDB debugger for agents** | No | No | No | **Breakpoints, logpoints, locals, coroutines, LLDB** |
| **Compose source mapping & recomposition `--why`** | No | Partial test tags | No | **Composable tree → `file:line` + trigger causes** |
| **Room/SQLite, DataStore & WorkManager inspection** | Manual `run-as` + parsing | In-process test code | No | **Typed WAL snapshots, `--live` SQL, JobScheduler diff** |
| **WebView CDP (Shadow DOM, iframes, native occlusion)** | Manual port forward | Espresso Web | Appium context switch | **Pure-Rust CDP + native overlay check** |
| **Built-in MITM HTTPS/WebSocket proxy + replay** | External tool | External mock server | External proxy | **`olef net` capture, intercept, rules, WS inject, replay** |
| **Startup, frame jank & JVMTI leak chains** | Raw `dumpsys` / HPROF | Macrobenchmark | No | **`olef perf startup \| frames \| leaks`** |
| **Record flow → deterministic CI test (zero AI replay)** | No | Espresso Recorder | Maestro Studio | **Readable Bash scripts (`test.sh`), JUnit, HTML, `test heal`** |
| **Cloud emulators, physical phones & BYO Mac/Linux host** | DIY | Firebase Test Lab | Maestro Cloud / Device farms | **Managed workspaces, DDP phones, `ocloud host`, durable agents** |

## Keeping your existing Espresso or UI Automator tests

You do not need to migrate existing instrumentation tests to adopt Olef. Because Olef's on-device service holds Android's single `UiAutomation` slot while connected, wrap commands that need that slot:

```bash
olef test -- ./gradlew connectedDebugAndroidTest
```

Olef disconnects cleanly, runs your instrumentation suite with inherited stdio, and reconnects afterward.

## Why raw `adb` costs coding agents time and tokens

When a coding agent relies on raw `adb` commands, it typically spends multiple turns dumping giant XML hierarchies, guessing tap coordinates, inserting arbitrary `sleep` calls, parsing noisy logcat dumps, and running full Gradle reinstalls on every small Kotlin tweak.

In our 21-task Android engineering benchmark with Codex (Olef 2.0, October 2026), switching from `adb` + the Android CLI to Olef cut **median task time by 48%** (36 s vs. 69 s) and **token consumption by 34%** (4.0M vs. 6.1M tokens), with warm `ui dump` reads around **~65 ms** and `app apply` edits landing in **~1.5 s**.

## When Olef is *not* the right tool

- **Pure JVM unit logic:** run `./gradlew testDebugUnitTest` directly with no device needed.
- **Automated Play Store publishing:** Olef stops at build verification and private tester distribution (`ocloud builds`); Play Console uploads and release signing stay in your existing release pipeline.
- **Release-build deep runtime inspection:** JDWP debugging, `olef storage`, `olef work`, `olef perf leaks`, and Compose runtime inspection require a debuggable build; UI automation, screenshots, logs, startup/frame metrics, and network checks (where CA trust permits) work more broadly. See [Capabilities & requirements](https://olef.dev/docs/reference/capabilities).
