agemu
v0.2.2Fast Android emulator and iOS Simulator control for coding agents: screenshots, UI tree, taps, logs
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
devices
List Android and iOS devices with state, profile and screen size.
profiles
List screen profiles (real device sizes) usable with set_profile.
| Parameter | Type | Description |
|---|---|---|
platform | string | android or ios |
create
Create a new device.
| Parameter | Type | Description |
|---|---|---|
name * | string | Device name |
platform * | string | android or ios |
profile | string | Profile name |
boot
Boot a device to an agent-ready state; from its baseline snapshot this takes seconds and returns state booted. The first boot of a new Android device (or a baseline retake after a GPU mode, AVD configuration or agemu upgrade) prepares the baseline once, which usually takes 7-8 minutes and never more than 20 (then the boot fails): boot then returns at once with state "preparing" and the phase; poll devices every 30-60 s (or call boot again) until the state is booted. Other calls on a preparing device fail at once with an error saying so.
| Parameter | Type | Description |
|---|---|---|
cold | boolean | Force a cold boot |
device | string | Device id or name (optional when exactly one device is booted) |
shutdown
Shut a device down.
| Parameter | Type | Description |
|---|---|---|
device | string | Device id or name (optional when exactly one device is booted) |
reset
Restore a booted device to its clean baseline state (fast).
| Parameter | Type | Description |
|---|---|---|
device | string | Device id or name (optional when exactly one device is booted) |
park
Park a booted device: stop it in place, so it uses no CPU and the host can reclaim its memory, keeping its apps and screen as they are. The next call on it resumes it (or use resume).
| Parameter | Type | Description |
|---|---|---|
device | string | Device id or name (optional when exactly one device is booted) |
resume
Resume a parked device; returns once it is agent-ready. Does nothing on a device that is not parked.
| Parameter | Type | Description |
|---|---|---|
device | string | Device id or name (optional when exactly one device is booted) |
set_profile
Switch the screen to a real-device profile (see profiles) or a custom Android size.
| Parameter | Type | Description |
|---|---|---|
density | number | Custom density dpi (Android) |
device | string | Device id or name (optional when exactly one device is booted) |
height | number | Custom height px (Android) |
profile | string | Profile name |
width | number | Custom width px (Android) |
screenshot
Capture the screen. Returns the image plus its file path. Coordinates on a scale=1 image are tap coordinates.
| Parameter | Type | Description |
|---|---|---|
device | string | Device id or name (optional when exactly one device is booted) |
format | string | png or jpeg |
scale | number | Downscale factor 0-1 for the returned image (default 0.5) |
ui_tree
Accessibility/UI hierarchy as a compact outline: [ref] role "text" id=... @(x,y wxh). Frames are screenshot pixels.
| Parameter | Type | Description |
|---|---|---|
device | string | Device id or name (optional when exactly one device is booted) |
json | boolean | Return full JSON instead of the outline |
find
Find elements by text/label/id/role.
| Parameter | Type | Description |
|---|---|---|
contains | string | Case-insensitive substring of text or label |
device | string | Device id or name (optional when exactly one device is booted) |
id | string | resource-id (Android) or accessibilityIdentifier (iOS) |
index | number | Pick the n-th match (0-based) |
role | string | Normalized role: button, text, textfield, switch, image, cell... |
text | string | Exact text or accessibility label |
tap
Tap at x,y (screenshot pixels) or at the center of the element matching a selector. With waitFor it also waits for the next screen.
| Parameter | Type | Description |
|---|---|---|
contains | string | Case-insensitive substring of text or label |
device | string | Device id or name (optional when exactly one device is booted) |
id | string | resource-id (Android) or accessibilityIdentifier (iOS) |
index | number | Pick the n-th match (0-based) |
returnUi | boolean | Also return the UI outline of the screen the action ends on (act, wait and observe in one call) |
role | string | Normalized role: button, text, textfield, switch, image, cell... |
text | string | Exact text or accessibility label |
waitFor | object | After the action, wait for an element matching this selector (fields: text, contains, id, role) in the same call |
waitGone | boolean | Wait for waitFor to disappear instead |
waitTimeoutMs | number | Timeout for waitFor, default 10000 |
x | number | X in screenshot pixels |
y | number | Y in screenshot pixels |
swipe
Swipe from (x,y) to (x2,y2) in screenshot pixels.
| Parameter | Type | Description |
|---|---|---|
x * | number | start x |
x2 * | number | end x |
y * | number | start y |
y2 * | number | end y |
device | string | Device id or name (optional when exactly one device is booted) |
durationMs | number | duration, default 300 |
returnUi | boolean | Also return the UI outline of the screen the action ends on (act, wait and observe in one call) |
waitFor | object | After the action, wait for an element matching this selector (fields: text, contains, id, role) in the same call |
waitGone | boolean | Wait for waitFor to disappear instead |
waitTimeoutMs | number | Timeout for waitFor, default 10000 |
type_text
Type text into the focused field.
| Parameter | Type | Description |
|---|---|---|
text * | string | Text to type |
device | string | Device id or name (optional when exactly one device is booted) |
keys | boolean | Send one key event per character (slower) instead of setting the field's text (Android) or pasting it (iOS) |
returnUi | boolean | Also return the UI outline of the screen the action ends on (act, wait and observe in one call) |
waitFor | object | After the action, wait for an element matching this selector (fields: text, contains, id, role) in the same call |
waitGone | boolean | Wait for waitFor to disappear instead |
waitTimeoutMs | number | Timeout for waitFor, default 10000 |
press_key
Press a key: home, back, enter, delete, tab, escape, lock, volumeup, volumedown.
| Parameter | Type | Description |
|---|---|---|
key * | string | Key name |
device | string | Device id or name (optional when exactly one device is booted) |
returnUi | boolean | Also return the UI outline of the screen the action ends on (act, wait and observe in one call) |
waitFor | object | After the action, wait for an element matching this selector (fields: text, contains, id, role) in the same call |
waitGone | boolean | Wait for waitFor to disappear instead |
waitTimeoutMs | number | Timeout for waitFor, default 10000 |
install
Install an app (.apk for Android, .app for iOS Simulator).
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute path |
device | string | Device id or name (optional when exactly one device is booted) |
launch
Launch an app by package name / bundle id. iOS also takes process arguments (e.g. an Expo dev client's --initialUrl), environment and relaunch.
| Parameter | Type | Description |
|---|---|---|
app * | string | Package name or bundle id |
args | array | Process arguments (iOS) |
device | string | Device id or name (optional when exactly one device is booted) |
env | object | Process environment (iOS) |
relaunch | boolean | Terminate a running instance first (iOS) |
returnUi | boolean | Also return the UI outline of the screen the action ends on (act, wait and observe in one call) |
waitFor | object | After the action, wait for an element matching this selector (fields: text, contains, id, role) in the same call |
waitGone | boolean | Wait for waitFor to disappear instead |
waitTimeoutMs | number | Timeout for waitFor, default 10000 |
terminate
Force-stop an app.
| Parameter | Type | Description |
|---|---|---|
app * | string | Package name or bundle id |
device | string | Device id or name (optional when exactly one device is booted) |
wait_for
Wait until an element matching the selector appears (or disappears with gone=true).
| Parameter | Type | Description |
|---|---|---|
contains | string | Case-insensitive substring of text or label |
device | string | Device id or name (optional when exactly one device is booted) |
gone | boolean | Wait for disappearance |
id | string | resource-id (Android) or accessibilityIdentifier (iOS) |
index | number | Pick the n-th match (0-based) |
role | string | Normalized role: button, text, textfield, switch, image, cell... |
text | string | Exact text or accessibility label |
timeoutMs | number | Timeout, default 10000 |
open_url
Open a URL or deep link as a link tapped in another app would (Android: VIEW intent with CATEGORY_BROWSABLE). App/universal links open the app only if their domain is verified. With waitFor it also waits for the next screen.
| Parameter | Type | Description |
|---|---|---|
url * | string | URL with a scheme: https://..., myapp://path, exp+app://... |
device | string | Device id or name (optional when exactly one device is booted) |
returnUi | boolean | Also return the UI outline of the screen the action ends on (act, wait and observe in one call) |
waitFor | object | After the action, wait for an element matching this selector (fields: text, contains, id, role) in the same call |
waitGone | boolean | Wait for waitFor to disappear instead |
waitTimeoutMs | number | Timeout for waitFor, default 10000 |
permission
Grant, revoke or reset an app's privacy permissions without the system dialog. revoke = denied without asking again; reset = ask again on next use. Android kills the app when one is revoked or reset. A grant the app could not get on a device (not in its manifest / no Info.plist usage description) is refused.
| Parameter | Type | Description |
|---|---|---|
action * | string | What to do |
app * | string | Package name or bundle id |
device | string | Device id or name (optional when exactly one device is booted) |
permissions | array | Names: camera, microphone, photos, photos-add, location, location-always, contacts, contacts-limited, calendar, reminders, notifications, motion, media-library, siri; or a raw Android permission (andr… |
location
Set the simulated GPS location, or clear it (back to the device's baseline).
| Parameter | Type | Description |
|---|---|---|
action | string | set (default when coordinates are given) or clear |
device | string | Device id or name (optional when exactly one device is booted) |
latitude | number | Degrees, -90..90 |
longitude | number | Degrees, -180..180 |
clipboard
Read the device clipboard (plain text), or set it.
| Parameter | Type | Description |
|---|---|---|
action | string | get (default) or set (default when text is given) |
device | string | Device id or name (optional when exactly one device is booted) |
text | string | Text to put on the clipboard (action set; empty clears it) |
appearance
Read the system appearance, or switch light/dark mode.
| Parameter | Type | Description |
|---|---|---|
device | string | Device id or name (optional when exactly one device is booted) |
mode | string | Omit to read the current appearance |
apps
List installed user apps (not the system image's).
| Parameter | Type | Description |
|---|---|---|
device | string | Device id or name (optional when exactly one device is booted) |
uninstall
Uninstall a user app with its data.
| Parameter | Type | Description |
|---|---|---|
app * | string | Package name or bundle id |
device | string | Device id or name (optional when exactly one device is booted) |
clear_app_data
Clear one app's data so it starts like a fresh install (stopped, data and permissions gone; iOS keeps keychain items, as a reinstall does on a device).
| Parameter | Type | Description |
|---|---|---|
app * | string | Package name or bundle id |
device | string | Device id or name (optional when exactly one device is booted) |
push
Send a push notification to an app (iOS; Android has no faithful path). It shows only if the app may post notifications. With waitFor it also waits for the banner or screen.
| Parameter | Type | Description |
|---|---|---|
app * | string | Bundle id |
payload * | object | APNs payload with an "aps" object, at most 4096 bytes, e.g. {"aps":{"alert":{"title":"Hi","body":"Hello"}}} |
device | string | Device id or name (optional when exactly one device is booted) |
returnUi | boolean | Also return the UI outline of the screen the action ends on (act, wait and observe in one call) |
waitFor | object | After the action, wait for an element matching this selector (fields: text, contains, id, role) in the same call |
waitGone | boolean | Wait for waitFor to disappear instead |
waitTimeoutMs | number | Timeout for waitFor, default 10000 |
logs
Recent log lines of one app (or the whole device), oldest first, as `time level process[pid] tag: message`. Filter by time, minimum level and text; the newest lines that fit limit and maxBytes are returned. The last line gives a cursor: pass it as since to read only newer lines.
| Parameter | Type | Description |
|---|---|---|
app | string | Package name or bundle id: only its processes' lines (default: every process) |
contains | string | Case-insensitive substring of the tag or the message |
device | string | Device id or name (optional when exactly one device is booted) |
json | boolean | Return JSON instead of text lines |
level | string | Minimum level (iOS: debug lines are not captured; info includes iOS default) |
limit | number | At most this many lines, the newest (default 100, max 10000) |
maxBytes | number | At most about this many bytes of lines (default 16384, max 1048576) |
regex | string | RE2 regular expression matched against the tag or the message |
since | string | Only lines from this point: a time (2026-11-07T10:00:00Z), a duration back from now (30s, 5m), "launch" (the app's last launch through agemu) or a cursor from a previous logs result (c123...) |
crashes
Crash, ANR (Android), system-kill (iOS watchdog, jetsam) and unexpected-exit reports of the device's apps, oldest first: time, kind, exception, reason and the crashing thread's top frames.
| Parameter | Type | Description |
|---|---|---|
app | string | Package name or bundle id (default: every app) |
device | string | Device id or name (optional when exactly one device is booted) |
json | boolean | Return JSON instead of text |
limit | number | At most this many reports, the newest (default 10, max 100) |
since | string | A time (2026-11-07T10:00:00Z), a duration back from now (5m) or "launch" (the app's last launch through agemu) |