Agemu – 5 ms screenshots, 20 ms UI trees for mobile coding agents Agemu, a control layer for the Android emulator and iOS Simulator released by developer Piotr Graczyk, cuts a screenshot to 4-5 ms and a UI-tree screen read to 2-23 ms, against roughly 150 ms for adb/simctl screenshots and 2.0 s for uiautomator UI trees. In an 18-step shopping flow run five times per tool, agemu completed the flow in a median 10.6 s on Android versus 74 s for the standard emulator with adb, and 16 s on iOS versus 38 s for mobile-mcp. Agemu leaves the devices stock (the Android SDK arm64 image and Xcode's Simulator runtime) and is used by coding agents through an MCP server or CLI, installed with `claude mcp add agemu -- npx -y agentic-emulator@latest mcp`; measurements were taken on an M2 Pro Mac with 16 GB. A fast control layer for the Android emulator and iOS Simulator, for coding agents that build mobile apps. A screenshot takes 4-5 ms and reading the screen 2-23 ms. The same 18-step shopping flow sign in, search, cart, checkout driven by five tool stacks, cut as a race. The Grand Prix cut https://github.com/piotr-graczyk-dev/agentic-emulator/blob/main/examples/agent-race/out/grand-prix.mp4 · montage https://github.com/piotr-graczyk-dev/agentic-emulator/blob/main/examples/agent-race/out/montage.mp4 · Android race https://github.com/piotr-graczyk-dev/agentic-emulator/blob/main/examples/agent-race/out/android/race.mp4 · iOS race https://github.com/piotr-graczyk-dev/agentic-emulator/blob/main/examples/agent-race/out/ios/race.mp4 · method https://github.com/piotr-graczyk-dev/agentic-emulator/blob/main/examples/agent-race claude mcp add agemu -- npx -y agentic-emulator@latest mcp When an agent builds an app, writing the code is quick. Checking the result on a device is slow. Every screenshot, screen read, tap and reset goes through adb , simctl or Maestro, and each call takes from hundreds of milliseconds to several seconds. A test flow has dozens of these steps, so the agent spends most of its time waiting for the emulator instead of building. agemu replaces that control layer and leaves the devices stock: the Android SDK's arm64 image and Xcode's Simulator runtime. Your app behaves exactly as it does on the standard emulator and Simulator. Agents use agemu through an MCP server or a CLI. The build, run and check loop: the agent changes code, installs the app, looks at the screen, taps through a flow, reads the logs, resets, and goes again. A whole test flow the race above, 5 runs per tool, medians : | | standard emulator + adb | mobile-mcp | agent-device | Argent | agemu | |---|---|---|---|---|---| | Android | 74 s | 29 s | 24 s | 30 s | 10.6 s | | iOS | - | 38 s | 35 s | 18 s | 16 s | On iOS most of the flow's time belongs to the app itself, so the gap is smaller there. Each step of the loop: | Step | Standard tools | agemu | |---|---|---| | Take a screenshot | ~150 ms adb , simctl | 4-5 ms | | Read the screen UI tree | 2.0 s uiautomator , 7.1 s Maestro on iOS | 2-23 ms | | Tap on iOS | 8.4 s per call Maestro | 160 ms | | Return to a clean state | 14 s Android cold boot , 36 s iOS erase and boot | 2.1 s | | Notice that the app crashed | the agent waits until its timeout | under 0.2 s , with the crash's top frames | | Read the app's latest logs | 250 ms logcat , 960 ms log show | ~1 ms | Each device uses less of your Mac , so it can run beside your IDE, builds and browser: | Per device | Standard | agemu | |---|---|---| | Android emulator, memory | 7.5 GB | 4.3-5.4 GB | | Android emulator, CPU at idle | 86% of a core | 19-24% | | Android emulator, CPU in the first minute after boot | 202% of a core | 120% | | iOS simulator, memory with no app | 4.0 GB | 2.5 GB | | iOS simulator, CPU at idle | 20% of a core | 1.5% | | iOS simulator, memory with the app running the race | 3.8-4.0 GB | 1.9 GB | The standard Android emulator is the AVD as Android Studio runs it: 4 GB of guest RAM, a window and audio. agemu runs it headless with 2 GB, the host GPU and preinstalled Google apps turned off. The iOS simulator saves come from system services an app under test doesn't use, which agemu turns off. Idle figures are single sessions on a busy Mac, so treat them as rough. Measured on an M2 Pro Mac with 16 GB, over agemu's daemon connection as the MCP server uses it. The method, sample sizes and every other measurement are in docs/ANDROID.md https://github.com/piotr-graczyk-dev/agentic-emulator/blob/main/docs/ANDROID.md , docs/IOS.md https://github.com/piotr-graczyk-dev/agentic-emulator/blob/main/docs/IOS.md and bench/final/ https://github.com/piotr-graczyk-dev/agentic-emulator/blob/main/bench/final . - One call per step. tap --text "Sign in" --wait-text Welcome --ui taps, waits for the result and returns the new screen. Fewer calls means fewer agent turns. - Taps that land. A tap by selector waits until the element can take the touch: after a screen transition, or when an alert or sheet has just appeared. A flow doesn't fail because a tap came too early. --contains prefers an element whose whole text is the given text, and a switch is tapped on the switch, not in the middle of its row. - Crash notice. When the app dies, the next call says so instead of waiting for a timeout. - Logs and crash reports from memory , filtered to your app and to what happened since launch. - Test capabilities. Deep links, permissions, location, clipboard, dark mode, push iOS , clear data and uninstall. reset undoes them all. - Lighter devices. agemu turns off system services an app under test doesn't use, such as widgets, Siri and preinstalled Google apps. - Leaves your own devices alone. agemu touches only devices named agemu- , so it runs next to your emulators, simulators and other tools. - Real phones and tablets. agemu drives the Android emulator and the iOS Simulator only. - Boots, app launches and your app's own animations take as long as before. That time belongs to the OS and the app. AGEMU ANDROID ANIMATIONS=0 and AGEMU IOS ANIMATIONS=0 shorten animations if you opt in. - A new Android device takes 7-8 minutes to prepare, once. agemu saves a clean baseline after the system has settled, so every later boot and reset is fast and quiet. - More devices don't add up. On a 16 GB Mac, total throughput levels off at about 2.5 devices' worth. - iOS needs an Apple Silicon Mac and relies on private Xcode APIs. Android also runs on Linux and Windows, where it is newer and less measured. See Known limitations known-limitations . agemu does one job: it makes the emulator and the Simulator fast and light for an agent's build, run and check loop. Other tools cover more ground. agemu runs next to them, because it touches only devices named agemu- . | You need | Use | |---|---| | A fast loop on an emulator or simulator: millisecond screenshots and screen reads, lighter devices, a 2 s reset | agemu | | Real phones and tablets | mobile-mcp https://github.com/mobile-next/mobile-mcp or agent-device https://github.com/callstack/agent-device | | TVs, HarmonyOS, web and desktop apps | agent-device https://github.com/callstack/agent-device ; Argent https://github.com/software-mansion/argent for TVs and desktop apps | | React Native profiling, network inspection, recorded replays or visual diffs | Argent https://github.com/software-mansion/argent | The agent race https://github.com/piotr-graczyk-dev/agentic-emulator/blob/main/examples/agent-race measures agemu against adb , mobile-mcp, agent-device and Argent on one task. claude mcp add agemu -- npx -y agentic-emulator@latest mcp Claude Code codex mcp add agemu -- npx -y agentic-emulator@latest mcp Codex CLI npx -y agentic-emulator doctor checks this Mac, prints fixes Cursor ~/.cursor/mcp.json , Gemini CLI ~/.gemini/settings.json , Claude Desktop and other clients that read an mcpServers config: {"mcpServers": {"agemu": {"command": "npx", "args": "-y", "agentic-emulator@latest", "mcp" }}} agemu doctor checks each platform separately. One is enough: an iOS-only or Android-only Mac is fine. | | Needed for | |---|---| | Apple Silicon Mac | everything on macOS | | or Linux x86-64, arm64 with KVM, or Windows x86-64 with WHPX | Android Linux and Windows https://github.com/piotr-graczyk-dev/agentic-emulator/blob/main/docs/INSTALL.md linux-and-windows ; the image is the x86 64 one on x86-64 | | Xcode with an iOS Simulator runtime | iOS | | Android SDK emulator, platform-tools, command-line tools , the arm64 image system-images;android-37.1;google apis playstore ps16k;arm64-v8a and Java 17+ | Android | For agents that use a shell, put agemu on PATH : npm install -g agentic-emulator or without Node, into ~/.local/bin macOS, Linux : curl -fsSL https://raw.githubusercontent.com/piotr-graczyk-dev/agentic-emulator/main/install.sh | sh or on Windows, in PowerShell: irm https://raw.githubusercontent.com/piotr-graczyk-dev/agentic-emulator/main/install.ps1 | iex Other MCP clients, updates, uninstalling, building from source and troubleshooting: docs/INSTALL.md https://github.com/piotr-graczyk-dev/agentic-emulator/blob/main/docs/INSTALL.md . php agemu create --platform ios --name iphone - an agemu-iphone simulator agemu create --platform android --name pixel - android:agemu-pixel agemu boot agemu-iphone agemu install MyApp.app && agemu launch com.example.app agemu ui compact outline: ref role "text" id=... @ x,y wxh agemu tap --text "Sign in" --wait-text Welcome --ui act, wait and observe in one call agemu type "hello" into the focused field agemu key back home, back, enter, delete, tab, escape, ... agemu screenshot -o shot.png agemu logs com.example.app --since launch --level warn agemu crashes com.example.app crash, ANR and system-kill reports with top frames agemu open myapp://orders/7 --wait-id order-7 deep link agemu permission grant com.example.app camera location agemu appearance dark agemu profile small-phone another screen size agemu reset back to the clean baseline agemu shutdown Every command prints JSON, and agemu help lists them all. Coordinates are screenshot pixels on both platforms. With exactly one booted device, -d