Touch injection pipeline
Touches are delivered via two paths depending on your setup:idb CLI injects events directly into the simulator kernel via IndigoHID. Your Mac cursor never moves. Install with:
[cursor-free] for idb or [CGEvent fallback].
simulator_tap
Taps at a point on the simulator screen. Usesimulator_snapshot or simulator_screenshot first to identify the coordinates you want to tap.
Parameters
X coordinate in simulator screen points.
Y coordinate in simulator screen points.
Press duration in seconds (decimals allowed, e.g.
0.5). Omit for a normal instantaneous tap. For durations longer than 0.3s when using the CGEvent fallback, the tool automatically uses the long-press path.Device UDID, name, or
"booted". Defaults to the currently booted simulator.Return value
Example
simulator_swipe
Performs a swipe gesture from one point to another. Use this for scrolling, pulling-to-refresh, or triggering edge gestures.Parameters
Start X in simulator screen points. Use
1 to trigger the iOS left-edge swipe-back gesture.Start Y in simulator screen points.
End X in simulator screen points.
End Y in simulator screen points.
Swipe duration in milliseconds. Defaults to
300. Use 400–600 ms for edge-swipe-back gestures.Step size in pixels between touch points (idb only). The idb backend uses this to control swipe granularity. Has no effect when using the CGEvent fallback.
Device UDID, name, or
"booted". Defaults to the currently booted simulator.Return value
Examples
simulator_long_press
Performs a long press at a point. Useful for opening context menus, initiating drag-and-drop, or triggering any gesture that requires a sustained touch.Parameters
X coordinate in simulator screen points.
Y coordinate in simulator screen points.
Press duration in milliseconds. Defaults to
1000 (1 second).Device UDID, name, or
"booted". Defaults to the currently booted simulator.Return value
Example
simulator_type_text
Types text into the currently focused text field. You must tap a text field first to focus it before calling this tool.Text input uses AppleScript to send keystrokes to the Simulator.app window. This works for standard characters. For special characters or emoji, tap the field first and use the on-screen keyboard if needed.
Parameters
The text to type into the focused field.
Device UDID, name, or
"booted". Defaults to the currently booted simulator.Return value
Example
simulator_press_key
Presses a special key, optionally combined with modifier keys. Use this for keyboard shortcuts, form submission (Return), and navigation.Parameters
The key to press. Supported values:
| Category | Keys |
|---|---|
| Navigation | return, escape, delete, tab, space |
| Arrows | up, down, left, right |
| Cursor | home, end, pageup, pagedown |
| Function | f1 through f12 |
Modifier keys to hold while pressing. Supported values:
"command", "shift", "option", "control".Device UDID, name, or
"booted". Defaults to the currently booted simulator.Return value
Examples
simulator_navigate_back
Navigates back in the current app by sending theCmd+[ keyboard shortcut. This is the standard macOS back navigation shortcut recognized by UINavigationController and Safari.
This is a workaround for the limitation that edge-swipe-back gestures can be unreliable with the CGEvent fallback. Prefer
simulator_swipe with startX=1 when idb is installed, as it produces a more authentic iOS gesture. Use this tool as a fallback.Parameters
Device UDID, name, or
"booted". Defaults to the currently booted simulator.