agemu

io.github.piotr-graczyk-dev由 GitHub 帳號 piotr-graczyk-dev 發布v0.2.1更新於 Nov 14, 2026

Fast Android emulator and iOS Simulator control for coding agents: screenshots, UI tree, taps, logs

已驗證STDIO僅桌面瀏覽器自動化開發者工具

概覽

AI 產生的概覽

讓編碼代理操控 Android 模擬器與 iOS 模擬器:截圖、UI 樹、點擊、輸入、日誌與當機資訊,反應時間達毫秒級。

可以做什麼
  • 建立、啟動、關閉、重設 agemu 管理的模擬器,並切換螢幕設定
  • 擷取畫面、讀取 UI 樹、尋找元素、點擊、滑動、輸入文字與按鍵
  • 安裝、啟動與終止應用程式,開啟深層連結,等待文字或元素出現
  • 設定權限、位置、剪貼簿、外觀,以及在 iOS 上推送通知
  • 讀取依應用程式篩選的日誌,以及當機、ANR 與系統終止報告
  • 解除安裝應用程式並清除應用程式資料
適用情境
適用於代理開發行動應用程式時,在模擬器上快速完成「改程式、執行、檢查」的循環:查看畫面、點擊走完流程、讀取日誌並在兩次執行之間重設。不適用於實機、平板,也不適用於電視、網頁或桌面應用程式。
執行需求
以 npx 執行的本機程序(需 Node.js),或全域安裝。macOS 需 Apple Silicon Mac;Android 另可在搭配 KVM 的 Linux 或搭配 WHPX 的 Windows 上執行。iOS 需具備模擬器執行環境的 Xcode;Android 需 Android SDK、指定的 arm64 系統映像與 Java 17+。可選的 AGEMU_* 環境變數用於調整守護程序。
安裝前請注意
它會建立並操控裝置,可安裝、啟動、解除安裝應用程式與清除應用程式資料,請只用於測試裝置。它只操作名為 agemu-* 的裝置,但 AGEMU_IOS_ALL_DEVICES 與 AGEMU_IOS_ALLOW_FOREIGN 可將其擴展到其他模擬器。iOS 依賴 Xcode 私有 API,任何 Xcode 版本都可能使其失效;Windows 上的 Android 支援為預覽版。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 agemu,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

agentic-emulator (agemu)

[npm] [CI] [License: MIT]

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 agent task with adb, agent-device, Argent and agemu, on Android and iOS]

The same 18-step shopping flow (sign in, search, cart, checkout) driven by four tool stacks. Montage · Android race · iOS race · method

sh
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.

Where it helps

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, 3 runs per tool, medians):

standard emulator + adbagent-deviceArgentagemu
Android74 s24 s30 s10.5 s
iOS-36 s18 s17 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:

StepStandard toolsagemu
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 iOS8.4 s per call (Maestro)160 ms
Return to a clean state14 s (Android cold boot), 36 s (iOS erase and boot)2.1 s
Notice that the app crashedthe agent waits until its timeoutunder 0.2 s, with the crash's top frames
Read the app's latest logs250 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 deviceStandardagemu
Android emulator, memory7.5 GB4.3-5.4 GB
Android emulator, CPU at idle86% of a core19-24%
Android emulator, CPU in the first minute after boot202% of a core120%
iOS simulator, memory with no app4.0 GB2.5 GB
iOS simulator, CPU at idle20% of a core1.5%
iOS simulator, memory with the app running (the race)4.3-4.6 GB2.1-2.3 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, docs/IOS.md and bench/final/.

What the agent gets

  • 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.

Where it doesn't help

  • 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.

agemu and other tools

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 needUse
A fast loop on an emulator or simulator: millisecond screenshots and screen reads, lighter devices, a 2 s resetagemu
Real phones and tabletsmobile-mcp or agent-device
TVs, HarmonyOS, web and desktop appsagent-device; Argent for TVs and desktop apps
React Native profiling, network inspection, recorded replays or visual diffsArgent

The agent race measures agemu against adb, agent-device and Argent on one task. mobile-mcp is not in it yet.

Install

sh
claude mcp add agemu -- npx -y agentic-emulator@latest mcp   # Claude Codecodex mcp add agemu -- npx -y agentic-emulator@latest mcp    # Codex CLInpx -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:

json
{"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 Maceverything on macOS
or Linux (x86-64, arm64) with KVM, or Windows (x86-64) with WHPXAndroid (Linux and Windows; the image is the x86_64 one on x86-64)
Xcode with an iOS Simulator runtimeiOS
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:

sh
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.

Use

sh
agemu create --platform ios --name iphone              # -> an agemu-iphone simulatoragemu create --platform android --name pixel           # -> android:agemu-pixelagemu boot agemu-iphoneagemu install MyApp.app && agemu launch com.example.appagemu 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 callagemu type "hello"                                     # into the focused fieldagemu key back                                         # home, back, enter, delete, tab, escape, ...agemu screenshot -o shot.pngagemu logs com.example.app --since launch --level warnagemu crashes com.example.app                          # crash, ANR and system-kill reports with top framesagemu open myapp://orders/7 --wait-id order-7          # deep linkagemu permission grant com.example.app camera locationagemu appearance darkagemu profile small-phone                              # another screen sizeagemu reset                                            # back to the clean baselineagemu shutdown

Every command prints JSON, and agemu help lists them all. Coordinates are screenshot pixels on both platforms. With exactly one booted device, -d <device> can be left out. The test capabilities and what reset restores: docs/CAPABILITIES.md.

The MCP server exposes the same functions as 31 tools: devices, profiles, create, boot, shutdown, reset, park, resume, set_profile, screenshot, ui_tree, find, tap, swipe, type_text, press_key, install, launch, terminate, wait_for, open_url, permission, location, clipboard, appearance, apps, uninstall, clear_app_data, push, logs and crashes. While a new Android device prepares, boot returns state preparing at once and the agent polls devices, so no tool call outlasts a client timeout.

Profiles

PlatformProfiles
Androidpixel-9-pro, pixel-9, galaxy-s24, small-phone, pixel-fold-inner, pixel-tablet, or profile --width W --height H --density D. Switches at runtime, without a reboot.
iOSiphone-17-pro-max, iphone-17-pro, iphone-17, iphone-air, iphone-16e, iphone-se-3, ipad-mini, ipad-pro-11. agemu switches to an agemu-<profile> simulator.

Settings

Environment variables for the daemon

The daemon reads them from the process that started it, which may be an MCP client without your shell's environment. Set them in the MCP config's env, or run agemu daemon restart from your shell. Devices keep running across a restart.

VariableDefaultEffect
AGEMU_HOME~/.agemuState directory and the daemon's socket.
AGEMU_IOS_LEANon0: the full Simulator (jobs back from the next boot, keynote mode removed).
AGEMU_IOS_IDLE_EXITonLean simulators end the on-demand daemons that stay idle after boot, except those found behind public app APIs. all: those too (an app's first call to one then waits for its restart, up to 2-3 s); 0: none.
AGEMU_IOS_IDLE_KEEPunsetComma-separated daemon names (executable file names) that are never ended as idle.
AGEMU_ANDROID_LEAN10: keep the Google apps (applies when a baseline is taken).
AGEMU_ANDROID_GPUhost (auto on Linux without a display)auto: software rendering.
AGEMU_ANDROID_SNAPSHOT_COMPRESS10: raw baseline (applies when a baseline is taken).
AGEMU_ANDROID_BASELINE_UPTIME_S420Guest uptime (and a quiet minute) the baseline waits for; a first boot then takes 7-8 min (at most 20), during which the device is preparing; 0: save at once (applies when a baseline is taken).
AGEMU_ANDROID_FIRSTBOOT_REPAIR10: do not boot an AVD whose first boot was interrupted before it ever completed with -wipe-data (two interruptions about 10 s in leave it unbootable otherwise).
AGEMU_ANDROID_STREAM_IDLE_S30Seconds without calls before the frame stream of a changing screen stops; 0: never.
AGEMU_ANDROID_ANIMATIONSnormal0: system animations off.
AGEMU_IOS_ANIMATIONSnormal0: UIKit and SwiftUI animations ×0.05 (or a factor from 0.05 to 1).
AGEMU_ANDROID_TAP_WAIT10: taps by selector do not wait for transitions or motion.
AGEMU_IOS_TAP_HOLD_MS100How long an iOS tap holds the touch down (a SwiftUI Toggle ignores a touch that ends as it begins).
AGEMU_IOS_TAP_SETTLEon0: taps and typing do not wait for a still screen, nor taps for a just-presented element.
AGEMU_ANDROID_LOGS, AGEMU_IOS_LOG_CAPTUREon0: no log capture; logs says so (iOS still watches launched apps' exits and .ips reports).
AGEMU_IOS_MAX_BOOTED2, or 1 while memory is shortagemu simulators booted at once; a boot or iOS profile switch beyond it shuts down the least recently used one.
AGEMU_ANDROID_STANDBY10: shutdown always powers off.
AGEMU_ANDROID_AVDSagemu-AVD name prefixes agemu manages.
AGEMU_IOS_ALL_DEVICES, AGEMU_IOS_ALLOW_FOREIGNoff1: list every simulator (read-only); also act on them.
AGEMU_AUTO_PARKoffA duration (10m, 90s; at least 10 s): park a device the daemon serves once it has had no call for that long; the next call resumes it. See docs/IOS.md.

Known limitations

  • iOS uses private CoreSimulator, SimulatorKit and AccessibilityPlatformTranslation APIs. Any Xcode release can break them. This version was tested on Xcode 26.6 with iOS 26.5.
  • The Simulator is not an iPhone. It runs apps natively on the Mac, so GPU, sensors, memory limits and performance differ from a real device.
  • iOS reset is a soft reset. It removes user apps, privacy grants, the keychain, the pasteboard, appearance and location. Built-in apps' data stays. For a full wipe, use agemu shutdown and xcrun simctl erase.
  • Android: one UiAutomation client per device. While agemu runs, uiautomator dump and UiAutomator-based tests can't connect.
  • Android profiles other than the AVD's native one are resampled. Create the AVD with --profile <name> to make that profile pixel-exact.
  • Rotation isn't handled, and iPad Split View and Slide Over are untested.
  • Android on Windows is a preview. On GitHub's Windows runner the emulator boots under agemu, but the guest's services fail under nested virtualization, so the UI tree and taps are not yet verified on Windows. CI covers the unit tests, the daemon and the installers there, and runs the Android end-to-end test on Linux with KVM. Windows screenshots use the gRPC reply for now (see docs/INSTALL.md).

Documentation

Contributing and license

Bug reports, measurements on other Macs and pull requests are welcome: see CONTRIBUTING.md, and SECURITY.md for vulnerabilities. Tests: make test (no device needed), make android-e2e and make ios-e2e. agemu is released under the MIT License; the code it includes from others is listed in THIRD_PARTY_NOTICES.md.

來源:README.md,提交 7a10d24

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.2.1最新Nov 14, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分