Skip to content

Herramientas ​

El servidor publica 36 herramientas. Esta página se genera a partir del propio servidor, así que siempre coincide con el código. Las descripciones están en inglés porque son exactamente las que recibe el modelo.

Casi todas aceptan un parámetro opcional device; consulta El parámetro device.

Dispositivos ​

list_devices ​

List simulators · Lectura

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.

ParámetroTipoObligatorioDescripción
bootedOnlybooleanNoReturn only running simulators.
platformstringNoFilter by platform, e.g. "iOS", "watchOS", "tvOS".

boot_device ​

Boot simulator · Modifica

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.

ParámetroTipoObligatorioDescripción
devicestringSíTarget simulator: UDID or exact name (see list_devices).
showWindowbooleanNoBring the Simulator app window to the foreground (default: true).

shutdown_device ​

Shut down simulator · Modifica

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

ParámetroTipoObligatorioDescripción
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.
allbooleanNoShut down every running simulator.

erase_device ​

Erase simulator · Destructiva

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

ParámetroTipoObligatorioDescripción
devicestringSíTarget simulator: UDID or exact name (see list_devices).

open_simulator_app ​

Open Simulator app · Modifica

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

ParámetroTipoObligatorioDescripción
devicestringNoSimulator to focus: UDID or exact name.

Apps ​

install_app ​

Install app · Modifica

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.

ParámetroTipoObligatorioDescripción
appPathstringSíAbsolute 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 · Destructiva

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

ParámetroTipoObligatorioDescripción
bundleIdstringSíBundle 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 · Modifica

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.

ParámetroTipoObligatorioDescripción
bundleIdstringSíBundle 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 · Modifica

Terminates a running app.

ParámetroTipoObligatorioDescripción
bundleIdstringSíBundle 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 · Lectura

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.

ParámetroTipoObligatorioDescripción
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 · Modifica

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.

ParámetroTipoObligatorioDescripción
urlstringSíURL 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 · Lectura

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

ParámetroTipoObligatorioDescripción
bundleIdstringSíBundle 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.

Interfaz ​

Estas herramientas requieren idb. Las coordenadas se expresan en puntos. Consulta Trabajar rápido para elegir la más eficiente.

ui_describe_screen ​

Describe screen · Lectura

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.

ParámetroTipoObligatorioDescripción
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 · Lectura

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

ParámetroTipoObligatorioDescripción
xnumber (>= 0)SíHorizontal position, in points.
ynumber (>= 0)SíVertical position, in points.
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

ui_tap_element ​

Tap element · Modifica

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.

ParámetroTipoObligatorioDescripción
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 · Lectura

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.

ParámetroTipoObligatorioDescripción
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 · Modifica

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.

ParámetroTipoObligatorioDescripción
textstringSíText 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 · Modifica

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.

ParámetroTipoObligatorioDescripción
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 · Modifica

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"}]
ParámetroTipoObligatorioDescripción
stepsobject[]SíSteps 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 · Modifica

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.

ParámetroTipoObligatorioDescripción
xnumber (>= 0)SíHorizontal position, in points.
ynumber (>= 0)SíVertical 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 · Modifica

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.

ParámetroTipoObligatorioDescripción
fromXnumber (>= 0)SíStarting horizontal position, in points.
fromYnumber (>= 0)SíStarting vertical position, in points.
toXnumber (>= 0)SíEnding horizontal position, in points.
toYnumber (>= 0)SíEnding 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 · Modifica

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.

ParámetroTipoObligatorioDescripción
textstringSíText 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 · Modifica

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

ParámetroTipoObligatorioDescripción
button"HOME" | "LOCK" | "SIDE_BUTTON" | "SIRI" | "APPLE_PAY"SíButton 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 · Modifica

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.

ParámetroTipoObligatorioDescripción
keyCodeinteger (>= 0, <= 255)SíUSB 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.

Multimedia ​

screenshot ​

Take screenshot · Lectura

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.

ParámetroTipoObligatorioDescripción
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 · Modifica

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

ParámetroTipoObligatorioDescripción
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 · Modifica

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

ParámetroTipoObligatorioDescripción
devicestringNoSimulator being recorded: UDID or exact name. Omit when only one recording is active.

add_media ​

Add photos or videos · Modifica

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

ParámetroTipoObligatorioDescripción
pathsstring[]SíPaths of existing image or video files on the Mac.
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

Entorno ​

set_appearance ​

Set light or dark mode · Modifica

Switches the simulator between light and dark appearance.

ParámetroTipoObligatorioDescripción
appearance"light" | "dark"SíAppearance to apply.
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

set_location ​

Simulate location · Modifica

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

ParámetroTipoObligatorioDescripción
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 · Modifica

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

ParámetroTipoObligatorioDescripción
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 · Modifica

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.

ParámetroTipoObligatorioDescripción
action"grant" | "revoke" | "reset"Sí"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"SíPermission 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 · Modifica

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.

ParámetroTipoObligatorioDescripción
bundleIdstringSíBundle identifier of the app, e.g. com.apple.mobilesafari.
payloadobjectSíAPNs 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 · Modifica

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.

ParámetroTipoObligatorioDescripción
textstringSíText 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 · Lectura

Returns the text currently on the simulator clipboard.

ParámetroTipoObligatorioDescripción
devicestringNoTarget simulator: UDID or exact name. Omit to use the only booted simulator.

Logs ​

get_logs ​

Read recent logs · Lectura

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.

ParámetroTipoObligatorioDescripción
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.

Publicado bajo licencia MIT.