flowdeck ui mac to run automation commands.
What It Does
Use macOS automation to:- Capture screenshots and accessibility trees from any running macOS app.
- Click elements, type text, scroll, drag, and navigate menus.
- Wait for UI state changes and assert UI conditions.
- Manage windows, launch/quit apps, and send keyboard shortcuts.
When to Use It
- Smoke tests for macOS app flows.
- Scripted demos or QA checks on native Mac apps.
- AI-driven interaction loops that need consistent UI state.
- Automating menu-driven workflows or window management.
Prerequisites
macOS automation requires two system permissions:- Accessibility — allows FlowDeck to read the accessibility tree and inject input.
- Screen Recording — allows FlowDeck to capture window screenshots (macOS 14+).
Quick Start
The
--app flag accepts an app name (e.g., "Safari"), bundle ID (e.g., "com.apple.Safari"), or PID (e.g., "12345"). It is required on most commands.Tangible Workflows
1) Automate a macOS app form fill
Use this to fill out a form in a native macOS app and verify the result.2) Drive a menu-based workflow
3) Window management
4) Verify a build output visually
Build and run your macOS app, then capture its UI:/tmp/current-ui.png with the expected design and iterate.
App Targeting
The--app flag resolves targets in this order:
- Numeric — treated as a PID (e.g.,
--app "12345") - Contains a dot — treated as a bundle ID (e.g.,
--app "com.apple.Safari") - Otherwise — fuzzy-matched against running app names (e.g.,
--app "Safari")
Differences from iOS Simulator Automation
| Feature | iOS (ui simulator) | macOS (ui mac) |
|---|---|---|
| Target flag | -S (simulator name/UDID) | --app (name/bundle ID/PID) |
| Click/tap | tap | click (tap is a hidden alias) |
| Right-click | N/A | right-click |
| Drag | N/A | drag --from x,y --to x,y |
| Cursor movement | N/A | move --point x,y |
| Keyboard shortcuts | N/A | hotkey "cmd+s" |
| Key input | HID keycodes only | --name (e.g., return) or --keycode |
| Menu interaction | N/A | menu list / menu click |
| Window management | N/A | window list/move/resize/focus |
| App lifecycle | N/A | launch / activate / quit |
| Sessions | Background capture sessions | No sessions (use screen for one-off) |
| Assert | assert visible/hidden/enabled/disabled/text | assert visible/hidden/enabled/disabled/text |
| Scroll | Fraction-based --distance | Tick-based --amount |
| Scroll until | scroll --until | scroll --until |
| Swipe | Direction argument | --direction flag |
| Multi-touch | pinch, rotate | N/A |
| Hardware buttons | button home/lock/... | N/A |
| Deep links | open-url | N/A |
| Appearance | set-appearance light/dark | N/A |
| Coordinates | Points (normalized) | Screen-absolute points |
| Permissions | None needed | Accessibility + Screen Recording |
Performance and Reliability Tips
- Prefer accessibility identifiers and use
--by-idfor clicks, finds, and assertions (fastest and most reliable). - Use
flowdeck ui mac screen --tree --json --app "MyApp"when you only need the accessibility tree (no screenshot). - Coordinates are screen-absolute points matching the values returned by
find. Do not scale by Retina factors. - Use
flowdeck ui mac findto discover element labels and IDs before interacting. - For smooth scrolling, use
--smoothon thescrollcommand. - Tune input timing with environment variables:
FLOWDECK_HID_STABILIZATION_MS(default 25) for click/gesture stabilityFLOWDECK_TYPE_DELAY_MS(default 1) for typing speed
