Skip to content

Tools ​

The server publishes 36 tools. This page is generated from the server itself, so it always matches the code. The descriptions are exactly what the model receives.

Almost all of them accept an optional device parameter; see The device parameter.

Devices ​

list_devices ​

List simulators · Read-only

Lists the available simulators with their name, UDID, runtime and state. Use it to find the device to boot or to target with other tools.

ParameterTypeRequiredDescription
bootedOnlybooleanNoReturn only running simulators.
platformstringNoFilter by platform, e.g. "iOS", "watchOS", "tvOS".

boot_device ​

Boot simulator · Mutating

Boots a simulator and waits until it is ready to use. Does nothing if it is already running. If the Simulator window cannot be opened the boot still succeeds and a warning is returned.

ParameterTypeRequiredDescription
devicestringYesTarget simulator: UDID or exact name (see list_devices).
showWindowbooleanNoBring the Simulator app window to the foreground (default: true).

shutdown_device ​

Shut down simulator · Mutating

Shuts down a simulator, or every running simulator when "all" is true.

ParameterTypeRequiredDescription
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.
allbooleanNoShut down every running simulator.

erase_device ​

Erase simulator · Destructive

Restores a simulator to factory settings, permanently deleting its apps, data and settings. The simulator must be shut down first.

ParameterTypeRequiredDescription
devicestringYesTarget simulator: UDID or exact name (see list_devices).

open_simulator_app ​

Open Simulator app · Mutating

Opens the Simulator app window on the Mac, optionally focused on a device.

ParameterTypeRequiredDescription
devicestringNoSimulator to focus: UDID or exact name.

Apps ​

install_app ​

Install app · Mutating

Installs an app built for the simulator from a .app bundle (or .ipa) on the Mac. Reinstalling replaces the binary and keeps the app data.

ParameterTypeRequiredDescription
appPathstringYesAbsolute path of an existing .app bundle on the Mac.
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

uninstall_app ​

Uninstall app · Destructive

Uninstalls an app, permanently deleting its data. Fails if the app is not installed.

ParameterTypeRequiredDescription
bundleIdstringYesBundle identifier of the app, e.g. com.apple.mobilesafari.
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

launch_app ​

Launch app · Mutating

Launches an installed app and returns its process id. The screen can stay black for a few seconds while the app loads: use ui_wait_for_element rather than acting immediately.

ParameterTypeRequiredDescription
bundleIdstringYesBundle identifier of the app, e.g. com.apple.mobilesafari.
argumentsstring[]NoCommand line arguments passed to the app.
terminateRunningbooleanNoTerminate a running instance first so the app starts fresh.
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

terminate_app ​

Terminate app · Mutating

Terminates a running app.

ParameterTypeRequiredDescription
bundleIdstringYesBundle identifier of the app, e.g. com.apple.mobilesafari.
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

list_apps ​

List installed apps · Read-only

Lists the apps installed in a simulator, one per line: bundle id, name and version. Use get_app_container when you need the path of an app on the Mac.

ParameterTypeRequiredDescription
type"User" | "System"No"User" for apps you installed, "System" for built-in apps. Omit for both.
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

open_url ​

Open URL · Mutating

Opens a URL in the simulator: a web page in Safari, or a deep link / universal link handled by an installed app (e.g. myapp://profile/42). iOS may ask to confirm opening the app: if so, tap the "Open" button with ui_tap_element.

ParameterTypeRequiredDescription
urlstringYesURL to open. It must include its scheme, e.g. https:// or myapp://.
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

get_app_container ​

Get app container path · Read-only

Returns the path on the Mac of a container of an installed app, so its files (documents, databases, preferences) can be inspected directly.

ParameterTypeRequiredDescription
bundleIdstringYesBundle identifier of the app, e.g. com.apple.mobilesafari.
kind"app" | "data" | "groups"No"app" for the bundle, "data" for the sandbox (default), "groups" for app groups.
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

User interface ​

These tools require idb. Coordinates are expressed in points. See Working fast to pick the most efficient one.

ui_describe_screen ​

Describe screen · Read-only

Lists the accessibility elements on screen, one per line: type, label, value, identifier, the point to tap it at and its size, all in points. Prefer it over a screenshot: it is faster, cheaper and gives exact coordinates. Requires idb.

ParameterTypeRequiredDescription
containingstringNoOnly elements whose label, value or identifier contains this text (case-insensitive).
includeUnlabeledbooleanNoInclude elements with no label, value or identifier (default: false).
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

ui_describe_point ​

Describe element at point · Read-only

Returns the accessibility element located at a screen coordinate. Requires idb.

ParameterTypeRequiredDescription
xnumber (>= 0)YesHorizontal position, in points.
ynumber (>= 0)YesVertical position, in points.
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

ui_tap_element ​

Tap element · Mutating

Finds an element by its visible text, identifier or type and taps it, in a single call. This is the fastest way to press a button or focus a field: no coordinates needed. Waits briefly for the element to appear, so it can follow a screen transition. Requires idb.

ParameterTypeRequiredDescription
labelstringNoVisible text of the element (label or value), case-insensitive. Exact matches win over partial ones.
identifierstringNoExact accessibilityIdentifier of the element.
typestringNoAccessibility type to restrict the match to, e.g. "Button".
indexinteger (>= 0)NoWhich match to use (0 = first) when several elements qualify.
durationSecondsnumber (<= 30)NoHow long to hold the touch, for a long press.
timeoutSecondsnumber (>= 0, <= 60)NoHow long to wait for the element to appear (default: 3).
describeAfterbooleanNoAlso return the elements on screen after the action, saving a ui_describe_screen call.
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

ui_wait_for_element ​

Wait for element · Read-only

Waits until an element is on screen, e.g. after launching an app or submitting a form, and returns it. Use it instead of polling with ui_describe_screen. Requires idb.

ParameterTypeRequiredDescription
labelstringNoVisible text of the element (label or value), case-insensitive. Exact matches win over partial ones.
identifierstringNoExact accessibilityIdentifier of the element.
typestringNoAccessibility type to restrict the match to, e.g. "Button".
indexinteger (>= 0)NoWhich match to use (0 = first) when several elements qualify.
timeoutSecondsnumber (>= 0, <= 60)NoHow long to wait (default: 10).
describeAfterbooleanNoAlso return the elements on screen after the action, saving a ui_describe_screen call.
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

ui_paste_text ​

Paste text into a field · Mutating

Enters any text into a text field through the clipboard: accents, ñ, emoji and non-Latin scripts included. Use it whenever ui_type_text cannot type the text. It copies the text, long-presses the field and taps "Paste" in the menu that appears, all in one call. The text is inserted at the cursor; it does not replace what the field already contains. Requires idb.

ParameterTypeRequiredDescription
textstringYesText to enter. Any Unicode text is accepted.
labelstringNoVisible text of the element (label or value), case-insensitive. Exact matches win over partial ones.
identifierstringNoExact accessibilityIdentifier of the element.
typestringNoAccessibility type to restrict the match to, e.g. "Button".
indexinteger (>= 0)NoWhich match to use (0 = first) when several elements qualify.
timeoutSecondsnumber (>= 0, <= 60)NoHow long to wait for the field to appear (default: 3).
describeAfterbooleanNoAlso return the elements on screen after the action, saving a ui_describe_screen call.
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

ui_scroll_to_element ​

Scroll to element · Mutating

Scrolls the screen until an element is visible and returns it, in one call. Use it for items further down a list instead of repeating ui_swipe and ui_describe_screen. Stops when the element appears, when the end of the content is reached or after maxSwipes. Requires idb.

ParameterTypeRequiredDescription
labelstringNoVisible text of the element (label or value), case-insensitive. Exact matches win over partial ones.
identifierstringNoExact accessibilityIdentifier of the element.
typestringNoAccessibility type to restrict the match to, e.g. "Button".
indexinteger (>= 0)NoWhich match to use (0 = first) when several elements qualify.
direction"down" | "up"No"down" (default) looks further down the content; "up" goes back towards the top.
maxSwipesinteger (>= 1, <= 50)NoSwipes to attempt before giving up (default: 10).
describeAfterbooleanNoAlso return the elements on screen after the action, saving a ui_describe_screen call.
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

ui_sequence ​

Run a sequence of UI steps · Mutating

Runs several UI steps in one call, which is much faster than one call per step. Use it for any flow you can plan ahead, such as filling a form. Stops at the first failing step and reports which steps completed, the error and the current screen. Requires idb.
Each step is an object with an "action":

  • tap: x, y, durationSeconds?
  • tap_element: label?, identifier?, type?, index?, durationSeconds?, timeoutSeconds?
  • type_text: text
  • swipe: fromX, fromY, toX, toY, durationSeconds?
  • press_button: button (HOME, LOCK, SIDE_BUTTON, SIRI, APPLE_PAY)
  • press_key: keyCode
  • wait: seconds
  • wait_for_element: label?, identifier?, type?, index?, timeoutSeconds?
  • paste_text: text, label?, identifier?, type?, index?, timeoutSeconds?
  • scroll_to_element: label?, identifier?, type?, index?, direction?, maxSwipes?
    Example: [{"action":"tap_element","label":"Email"},{"action":"type_text","text":"a@b.co"},{"action":"tap_element","label":"Sign in"},{"action":"wait_for_element","label":"Welcome"}]
ParameterTypeRequiredDescription
stepsobject[]YesSteps to run, in order.
describeAfterbooleanNoAlso return the elements on screen after the action, saving a ui_describe_screen call.
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

ui_tap ​

Tap · Mutating

Taps a screen coordinate in points. Prefer ui_tap_element when the target has a label or identifier. Coordinates come from ui_describe_screen or from a screenshot taken at the default "points" resolution. Set a duration to long-press. Requires idb.

ParameterTypeRequiredDescription
xnumber (>= 0)YesHorizontal position, in points.
ynumber (>= 0)YesVertical position, in points.
durationSecondsnumber (<= 30)NoHow long to hold the touch, for a long press.
describeAfterbooleanNoAlso return the elements on screen after the action, saving a ui_describe_screen call.
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

ui_swipe ​

Swipe · Mutating

Drags a finger between two coordinates in points. To scroll content down, swipe from a lower point to a higher one (larger y to smaller y). Limitation: swipes that start at a screen edge do not trigger system gestures such as Notification Center, Control Center or the app switcher. Requires idb.

ParameterTypeRequiredDescription
fromXnumber (>= 0)YesStarting horizontal position, in points.
fromYnumber (>= 0)YesStarting vertical position, in points.
toXnumber (>= 0)YesEnding horizontal position, in points.
toYnumber (>= 0)YesEnding vertical position, in points.
durationSecondsnumber (<= 30)NoDuration of the gesture.
stepSizenumberNoDistance in points between intermediate touch events.
describeAfterbooleanNoAlso return the elements on screen after the action, saving a ui_describe_screen call.
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

ui_type_text ​

Type text · Mutating

Types text into the focused field, as if using the keyboard; line breaks press Return. Tap a text field first to give it focus. Limitation: only unaccented Latin letters, digits and common punctuation can be typed. For accents, ñ, emoji or any other script, use ui_paste_text instead. Requires idb.

ParameterTypeRequiredDescription
textstringYesText to type (printable ASCII, line breaks and tabs).
describeAfterbooleanNoAlso return the elements on screen after the action, saving a ui_describe_screen call.
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

ui_press_button ​

Press hardware button · Mutating

Presses a hardware button, e.g. HOME to return to the home screen. Requires idb.

ParameterTypeRequiredDescription
button"HOME" | "LOCK" | "SIDE_BUTTON" | "SIRI" | "APPLE_PAY"YesButton to press.
describeAfterbooleanNoAlso return the elements on screen after the action, saving a ui_describe_screen call.
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

ui_press_key ​

Press keyboard key · Mutating

Presses a keyboard key by its USB HID usage code. Common codes: 40 Return, 41 Escape, 42 Backspace, 43 Tab, 44 Space, 79 Right, 80 Left, 81 Down, 82 Up. Requires idb.

ParameterTypeRequiredDescription
keyCodeinteger (>= 0, <= 255)YesUSB HID keyboard usage code.
describeAfterbooleanNoAlso return the elements on screen after the action, saving a ui_describe_screen call.
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

Media ​

screenshot ​

Take screenshot · Read-only

Captures the simulator screen and returns the image. By default the image is scaled to one pixel per point, so positions in it are the coordinates ui_tap and ui_swipe expect. Use it to check how things look; to find or tap elements, ui_describe_screen and ui_tap_element are faster. A screen that is black right after launching an app is still loading.

ParameterTypeRequiredDescription
format"png" | "jpeg"NoImage format (default: jpeg, which is smaller).
resolution"points" | "full"No"points" (default): small image whose coordinates match the UI tools. "full": native device pixels.
outputPathstringNoAlso save the image to this path on the Mac.
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

start_recording ​

Start screen recording · Mutating

Starts recording the simulator screen to a video file. The file is only complete after calling stop_recording.

ParameterTypeRequiredDescription
outputPathstringNoDestination .mp4 path on the Mac. Defaults to a timestamped file in the output directory.
codec"h264" | "hevc"NoVideo codec (default: h264).
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

stop_recording ​

Stop screen recording · Mutating

Stops a screen recording and returns the path of the finished video.

ParameterTypeRequiredDescription
devicestringNoSimulator being recorded: UDID or exact name. Omit when only one recording is active.

add_media ​

Add photos or videos · Mutating

Adds photos or videos from the Mac to the simulator's Photos library.

ParameterTypeRequiredDescription
pathsstring[]YesPaths of existing image or video files on the Mac.
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

Environment ​

set_appearance ​

Set light or dark mode · Mutating

Switches the simulator between light and dark appearance.

ParameterTypeRequiredDescription
appearance"light" | "dark"YesAppearance to apply.
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

set_location ​

Simulate location · Mutating

Simulates a GPS location, or stops simulating one when "clear" is true.

ParameterTypeRequiredDescription
latitudenumber (>= -90, <= 90)NoLatitude in decimal degrees.
longitudenumber (>= -180, <= 180)NoLongitude in decimal degrees.
clearbooleanNoStop simulating a location instead of setting one.
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

set_status_bar ​

Override status bar · Mutating

Overrides what the status bar shows (clock, network, battery), which is useful for clean screenshots. Pass "clear": true to restore the real values.

ParameterTypeRequiredDescription
timestringNoClock text, e.g. "9:41".
dataNetwork"hide" | "wifi" | "3g" | "4g" | "lte" | "lte-a" | "lte+" | "5g" | "5g+" | "5g-uwb" | "5g-uc"NoData network indicator.
wifiMode"searching" | "failed" | "active"No
wifiBarsinteger (>= 0, <= 3)NoWi-Fi signal strength, 0-3.
cellularMode"notSupported" | "searching" | "failed" | "active"No
cellularBarsinteger (>= 0, <= 4)NoCellular signal strength, 0-4.
operatorNamestringNoCarrier name.
batteryState"charging" | "charged" | "discharging"No
batteryLevelinteger (>= 0, <= 100)NoBattery percentage, 0-100.
clearbooleanNoRemove every override instead of setting values.
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

set_permission ​

Change privacy permission · Mutating

Grants, revokes or resets a privacy permission (photos, location, contacts, microphone…) so permission dialogs do not need to be answered by hand. Changing a permission may terminate the affected app.

ParameterTypeRequiredDescription
action"grant" | "revoke" | "reset"Yes"reset" returns the permission to "not asked yet".
service"all" | "calendar" | "contacts-limited" | "contacts" | "location" | "location-always" | "photos-add" | "photos" | "media-library" | "microphone" | "motion" | "reminders" | "siri"YesPermission to change; "all" applies to every service.
bundleIdstringNoApp the change applies to. Required for grant and revoke; omit on reset to affect all apps.
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

send_push_notification ​

Send push notification · Mutating

Delivers a simulated remote push notification to an app. The payload is a standard APNs payload, e.g. {"aps": {"alert": {"title": "Hi", "body": "Hello"}, "badge": 1}}. The app must already have asked for, and been granted, permission to show notifications.

ParameterTypeRequiredDescription
bundleIdstringYesBundle identifier of the app, e.g. com.apple.mobilesafari.
payloadobjectYesAPNs payload; custom keys are allowed next to "aps".
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

set_clipboard ​

Set clipboard text · Mutating

Puts text on the simulator clipboard, e.g. to test how an app reads it. To enter text into a field, ui_paste_text does the copy and the paste in one call.

ParameterTypeRequiredDescription
textstringYesText to copy. Any Unicode text is accepted.
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

get_clipboard ​

Get clipboard text · Read-only

Returns the text currently on the simulator clipboard.

ParameterTypeRequiredDescription
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

Logs ​

get_logs ​

Read recent logs · Read-only

Reads recent entries of the simulator system log (os_log, NSLog, print output captured by the system). Filter by process to see only your app; unfiltered logs are very noisy.

ParameterTypeRequiredDescription
processNamestringNoOnly entries from this process, usually the app executable name (e.g. "MyApp").
messageContainsstringNoOnly entries whose message contains this text.
predicatestringNoAdvanced: NSPredicate in "log show" syntax, e.g. subsystem == "com.example.app".
minutesinteger (>= 1, <= 60)NoHow far back to look (default: 1).
maxLinesinteger (>= 1, <= 2000)NoMaximum number of most recent lines to return (default: 200).
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

Released under the MIT License.