Skip to main content
FlowDeck UI automation runs on iOS simulators and exposes commands for capture, interaction, assertions, and app control. Commands live under flowdeck ui simulator.

Common Flags

Most UI automation commands support:
  • --udid, -u to target a specific simulator. Recommended when multiple simulators are booted.
  • For AI agent workflows, always pass --udid explicitly on every flowdeck ui simulator ... command.
  • If --udid is omitted, FlowDeck falls back to session/default simulator selection. This is usually fine when only one simulator is booted (common in CI).
  • --json, -j for machine-readable output.
  • --verbose, -v and --examples, -e on commands that support extra output.

Capture

CommandPurposeKey Options
ui simulator screenScreenshot + accessibility tree--tree, --optimize, --output
ui simulator recordRecord simulator video--duration, --codec, --force, --output
ui simulator session startStart background tree + screenshot capture--interval-ms, --retention-seconds
ui simulator session stopStop the active capture session

Query

CommandPurposeKey Options
ui simulator findLocate elements by label/ID/role--by-id, --by-role, --contains

Interaction

CommandPurposeKey Options
ui simulator tapTap element or coordinates--point, --duration, --by-id
ui simulator double-tapDouble tap element or coordinates--point, --by-id
ui simulator typeType into focused field--clear, --mask
ui simulator swipeSwipe by direction or coordinates--from, --to, --duration, --distance
ui simulator scrollScroll content (gentler than swipe)--direction, --speed, --distance, --until, --timeout
ui simulator pinchPinch to zoom in/outin/out, --scale, --point, --duration
ui simulator rotateRotate with a two-finger gesture<degrees>, --point, --radius, --duration
ui simulator backNavigate back (edge swipe)

Wait and Assert

CommandPurposeKey Options
ui simulator waitWait for element state--timeout, --poll, --gone, --enabled, --stable
ui simulator assert visibleAssert element is visible--by-id
ui simulator assert hiddenAssert element is hidden--by-id
ui simulator assert enabledAssert element is enabled--by-id
ui simulator assert disabledAssert element is disabled--by-id
ui simulator assert textAssert element text--expected, --contains, --by-id

Input and Keyboard

CommandPurposeKey Options
ui simulator eraseErase text from focused field--characters
ui simulator hide-keyboardHide the on-screen keyboard
ui simulator keySend keyboard keycodes--sequence, --hold

App Control

CommandPurposeKey Options
ui simulator open-urlOpen a URL or deep link
ui simulator clear-stateClear app data/state

Hardware

CommandPurposeKey Options
ui simulator buttonPress hardware buttonshome, lock, siri, applepay, volumeup, volumedown, --hold

Advanced

CommandPurposeKey Options
ui simulator touch downTouch down at coordinatesx,y, --udid
ui simulator touch upTouch up at coordinatesx,y, --udid

Key Options Explained

Screen and Record

  • --output uses a file path. Screenshots default to a .png, recordings to a .mov. If omitted, FlowDeck writes to a temp file and prints the path.
  • --tree returns only the accessibility tree (no screenshot data).
  • --optimize shrinks the screenshot output for AI workflows.
  • screen reports size in points; JSON includes point_width/point_height and pixel_width/pixel_height when available.
  • --duration is in seconds (supports decimals like 2.5).
  • --codec accepts h264 or hevc.
  • --force overwrites an existing output file.

Sessions

  • session start captures tree + screenshots every 500ms by default and writes to ./.flowdeck/automation/sessions/<session-short-id>/ (the short ID is the first 8 characters of the session UUID).
  • Starting a session stops any active session first and requires a booted simulator.
  • --interval-ms and --retention-seconds tune capture frequency and retention (default 60s). Retention always keeps at least one capture.
  • Sessions capture screenshots on each interval; entries are written only when the tree or screenshot changes and screenshots are stored only when pixel content changes (JPEG at 50% quality).
  • latest.json points to the most recent capture, latest.jpg symlinks to the latest screenshot, and latest-tree.json symlinks to the latest accessibility tree (no directory listing required).
  • JSON output from session start includes full paths for the session directory, screens, trees, latest pointers, and the current screen size in points (screen).
  • session stop ends the active session and cleans up captured data. Sessions also end automatically if the simulator disappears.

Find, Tap, and Double-Tap

  • --by-id matches accessibility identifiers instead of labels.
  • --by-role matches element roles (e.g. button, textField).
  • --contains does a substring match against labels.
  • --point expects x,y coordinates in points (matches normalized screenshots and tree output).
  • Do not scale by @2x/@3x or device resolution; use the image coordinates directly.
  • Coordinate taps use the provided point exactly; use label/ID taps to target element centers.
  • --geometry accepts points only.
  • Session screenshots are normalized to point size so image coordinates map 1:1 to points.
  • --duration on tap is a long-press hold time in seconds.

Swipe and Scroll

  • swipe supports directions up, down, left, right or explicit --from x,y + --to x,y.
  • --duration for swipe is in seconds (default 0.3).
  • --distance sets swipe/scroll distance as a fraction of the screen (0.05–0.95), not pixels or points. Defaults: swipe 0.4, scroll 0.2.
    • Example: --distance 0.25 scrolls 25% of the screen height.
    • Invalid: --distance 300 (FlowDeck will reject values outside 0.05–0.95).
  • --direction for scroll uses UP, DOWN, LEFT, or RIGHT (default DOWN).
  • --speed is a 0-100 value (higher is faster).
  • --until scrolls until an element is visible. Use id:myElement to match by accessibility identifier.
  • --timeout for scroll --until is in milliseconds.

Pinch and Wait

  • pinch uses a direction argument: in (zoom out) or out (zoom in).
  • --scale overrides the zoom factor (defaults to 2.0 for out, 0.5 for in).
  • --point expects x,y coordinates in points for the pinch center.
  • --geometry accepts points only.
  • --duration for pinch is in seconds.
  • --timeout for wait is in seconds; --poll is in milliseconds.
  • --gone, --enabled, and --stable change the wait condition (default is “exists”).

Text, Key, and App Control

  • type --clear clears the focused field before typing.
  • type --mask hides typed text in terminal output and JSON.
  • erase --characters 5 deletes a specific number of characters; omit to clear all.
  • key 40 sends a single HID keycode (for example, 40 = Enter).
  • key --sequence 11,8,15 sends comma-separated HID keycodes.
  • key --hold 1.0 holds a single key for the given seconds.
  • open-url accepts https://... or custom schemes like myapp://path.
  • clear-state requires a bundle identifier (for example com.example.app) and resets the simulator container for that app.
  • rotate performs a two-finger rotation gesture (degrees, optional center/radius).

Buttons and Touch

  • button --hold 1.5 holds a hardware button for the given seconds.
  • touch down and touch up expect x,y coordinates in points.
  • Do not scale by @2x/@3x or device resolution; use the image coordinates directly.
  • --geometry accepts points only.

Performance and Reliability Tips

  • Use accessibility identifiers and --by-id whenever possible; label matching is slower and more ambiguous.
  • For automation loops, start a session and read latest-tree.json/latest.jpg from disk instead of issuing screen for every step.
  • For one-off tree-only checks, use ui simulator screen --tree --json (no screenshot). Use --optimize when you do need a one-off screenshot.
  • Reduce full-screen captures between actions; prefer find/wait for state checks.
  • Use scroll --until "id:yourElement" to bring off-screen targets into view before tapping.
  • Increase --poll for slow UIs to reduce load; decrease when you need faster detection.
  • Tune input timing with environment variables:
    • FLOWDECK_HID_STABILIZATION_MS (default 25) for tap/gesture stability
    • FLOWDECK_TYPE_DELAY_MS (default 20) for typing speed
For a full help listing, run flowdeck ui simulator --help.