Skip to main content

app_tap

This tool on every surface: CLI · MCP · Python · JavaScript · Go · Java · .NET

Tap an element. Give a ref from app_map ("@e5"), a locator ("text=Sign In", "testid=submit", "label=Email", "role=button"), or x and y in device pixels. The element is re-resolved immediately before the tap, so a ref from a screen that has since changed fails rather than tapping the wrong place.

Changes the device, the app or the session: readOnlyHint is false.

Arguments​

NameTypeRequiredWhat it is
devicestringDevice serial to target, e.g. "emulator-5554". Omit when only one device is running.
doublebooleanTap twice, close enough together that the platform reads one gesture rather than two taps. Everything else is identical, including how the target is resolved. The uiautomator dump driver refuses this: it taps one adb call at a time and nothing there controls the 40-300ms interval the gesture is made of.
driverstring: uiautomator2, uiautomator, wdaDriver to use: "uiautomator2" (default for Android; fast, installs a server APK on first use), "uiautomator" (Android, installs nothing, slower, cannot type), or "wda" (WebDriverAgent: iOS simulators and iPhones).
fingersintegerHow many fingers tap at once, 1 to 5. Defaults to 1. With more, they land side by side about the same point, a tenth of the screen width apart, and lift together — a two-finger tap, a three-finger tap. On iOS three fingers can reach the system instead of the app: three-finger gestures are undo, redo, copy and paste there. Not with double.
targetstringA ref from app_map ("@e5") or a locator ("text=Sign In").
xintegerX coordinate in device pixels. Use with y, instead of target.
yintegerY coordinate in device pixels. Use with x, instead of target.

Examples​

Each is the arguments of a tools/call request; the first is shown whole.

Tap an element by its visible text​

{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "app_tap",
"arguments": {
"target": "text=Network & internet"
}
}
}

On an Android 15 emulator the answer's text was:

tapped text=Network & internet at (407, 867)
BeforeAfter
Before: mobium tap "text=Network & internet" on an Android 15 emulatorAfter: mobium tap "text=Network & internet" on an Android 15 emulator

mobium tap "text=Network & internet" on an Android 15 emulator

Tap a ref from the last map​

{
"target": "@e2"
}

Double-tap​

{
"target": "@e2",
"double": true
}

Tap right after work the screen does not show, with the gray box on​

{
"target": "testid=busyRowB"
}

On an Android 15 emulator the answer's text was:

tapped testid=busyRowB at (540, 1095)
gray box: waited 307 ms for the app to go idle (busy: quiet)

mobium tap testid=busyRowB on MobiumApp's Busy Demo, Android 15 emulator, launched with --gray-box: the tap waited for the quiet refresh to finish, and Row B is the new generation's

mobium tap testid=busyRowB on MobiumApp's Busy Demo, Android 15 emulator, launched with --gray-box: the tap waited for the quiet refresh to finish, and Row B is the new generation's

On a device​

BeforeAfter
Before: mobium double-tap testid=pressTarget on an Android 15 emulatorAfter: mobium double-tap testid=pressTarget on an Android 15 emulator

mobium double-tap testid=pressTarget on an Android 15 emulator