# Give Your Agent Eyes and Hands Source: https://docs.flowdeck.studio/cli/ai-agents Your AI agent can see the simulator screen, tap buttons, run tests, and build your iOS and macOS apps FlowDeck turns your AI agent into an iOS/macOS developer. Instead of copying terminal commands back and forth, your agent gets direct access to the full Apple development toolchain: building apps, running tests, tapping buttons on screen, reading logs, and capturing screenshots. You describe what you want in plain language. The agent does the rest. ```text theme={null} Run my app, navigate to the settings screen, toggle dark mode, and verify all text is still readable. Fix any contrast issues. ``` That's a real prompt. The agent will build your app, launch it on a simulator, find the settings button, tap it, toggle the switch, verify the UI, and fix any problems it finds - all without you touching Xcode or the simulator. ## What can your agent do? > [card] [UI Automation](/cli/ai-agents/ui-automation) > > Your agent can see the simulator screen, tap buttons, type text, scroll, swipe, and verify results. It reads the accessibility tree to find elements and captures screenshots to confirm what happened. > [card] [Design to Code](/cli/ai-agents/ui-implementation) > > Hand your agent a mockup image and it will implement the SwiftUI view, run the app, compare the result against the design, and iterate until it matches. > [card] [Testing](/cli/ai-agents/testing) > > Run your full test suite or specific test classes. The agent reads failures, traces them to the source, and can fix bugs in the production code or the tests themselves. > [card] [Building and Running](/cli/ai-agents/building) > > Build your app, stream runtime logs, fix compiler errors, and debug runtime issues - all from natural language. > [card] [Infrastructure](/cli/ai-agents/infrastructure) > > Manage simulators, runtimes, devices, Swift packages, cleaning, project configuration, and licensing without memorizing any commands. ## Watch the demo [YouTube video player](https://www.youtube.com/embed/1ANlOys4bTI) ## How it works FlowDeck installs a **skill pack** into your AI agent. The skill pack teaches the agent how to use FlowDeck commands, when to use them, and how to interpret the results. You don't need to learn the commands yourself - the agent already knows them. The skill pack works with: * **Claude Code** (Anthropic) * **Codex** (OpenAI) * **Gemini** (Google) * **OpenCode** * **Cursor** ## Setup Install the skill pack in under a minute: ```bash theme={null} flowdeck -i ``` Then: 1. Press `A` to open **AI Settings** 2. Select **Install Skills** 3. Choose your agent 4. Choose **Project Only** (for this repo) or **Global** (for all projects) 5. Restart your AI agent That's it. Start prompting. > [!TIP] > > **Project Only** is recommended for teams - it keeps the skill pack in the repo so every contributor gets the same behavior. **Global** is convenient for personal use across all projects. ### Manual install (CLI fallback) If you prefer the command line: ```bash theme={null} flowdeck ai install-skill --agent claude --mode project ``` Supported agents: `claude`, `codex`, `opencode`, `cursor`, `gemini` `--mode project` writes the skill pack into the current repo's agent config (e.g. `.claude/skills/flowdeck/`, `.codex/skills/flowdeck/`) — this is the **Project Only** install in the interactive UI. `--mode user` writes into the agent's user-scope config directory (e.g. `~/.claude/skills/flowdeck/`, `~/.codex/skills/flowdeck/`) — this is the **Global** install in the interactive UI. ### Skill install paths | Agent | Project Install | Global Install | | - | - | - | | Claude | `.claude/skills/flowdeck/` | `~/.claude/skills/flowdeck/` | | Codex | `.codex/skills/flowdeck/` | `~/.codex/skills/flowdeck/` | | OpenCode | `.opencode/skills/flowdeck/` | `~/.config/opencode/skills/flowdeck/` | | Cursor | `.cursor/skills/flowdeck/` | `~/.cursor/skills/flowdeck/` | | Gemini | `.gemini/skills/flowdeck/` | `~/.gemini/skills/flowdeck/` | ## Troubleshooting ### Agent not listed in the install menu Open the agent once so its config directory is created, then relaunch `flowdeck -i` and press `A` again. ### Agent doesn't use FlowDeck commands Make sure you restarted the agent after installing the skill pack. The agent needs to reload its configuration to pick up the new skills. ### Agent uses xcodebuild or simctl directly The skill pack explicitly tells agents to use FlowDeck instead of raw Apple tools. If your agent still reaches for `xcodebuild`, try reinstalling the skill pack - an older version may be cached. # Building and Running with AI Source: https://docs.flowdeck.studio/cli/ai-agents/building Build apps, stream logs, fix errors, and debug runtime issues with your AI agent Your AI agent can handle the full build-run-debug cycle. It builds your app, launches it on the simulator, streams runtime logs, and reacts to errors. If the build fails, it reads the compiler errors and fixes them. If the app crashes, it traces the issue in the logs. No more switching between your editor and terminal to copy error messages. > [!TIP] > > Looking for simulator management, runtimes, Swift packages, or project setup? See [Infrastructure with AI](/cli/ai-agents/infrastructure). *** ## What you can ask ### Build and fix errors ``` Build my app. If there are errors, read them and fix the code. ``` The agent builds the project, parses any compiler errors from the output, opens the relevant source files, and applies fixes. It rebuilds to confirm the fix worked. If there are multiple errors, it works through them one at a time. ### Run the app and monitor for errors ``` Run my app and watch the logs. If there are any errors or warnings, diagnose the issue and fix it. ``` The agent launches the app on the simulator and streams runtime logs. It watches for error-level messages, exceptions, unexpected state changes, and crash reports. If something goes wrong, it traces the issue back to the source and fixes the code. ### Run on a specific simulator ``` Run my app on iPhone SE. ``` The agent resolves the simulator by name, boots it if needed, builds, and launches the app. You can target any simulator that's installed on your system. ``` Run my app on iPad Pro (13-inch). ``` Same thing with a different device. The agent handles simulator resolution automatically. ### Run on a physical device ``` Run my app on my connected iPhone. ``` The agent detects your connected device, builds for it, and launches the app. This requires your provisioning profiles to be set up. ### Investigate and fix a runtime issue ``` Run my app and navigate to the profile screen. I'm seeing a blank screen there. Check the logs, find the root cause, and fix it. ``` The agent launches the app with log streaming, navigates to the screen using UI automation, reads the logs for errors or missing data, and traces the issue to its source. Whether it's a missing API call, nil data, or a layout constraint error, it fixes the code and re-runs to verify the screen loads correctly. ### Build for release ``` Build my app in Release configuration. ``` The agent runs a release build with optimizations enabled. Useful for checking that your code compiles correctly with optimizations (some issues only appear in release builds). ### Clean and rebuild ``` Clean the build and rebuild from scratch. ``` The agent cleans all build artifacts and derived data, then performs a fresh build. This solves stale cache issues and incremental build problems. *** ## Tips for better results > [!TIP] > > **Mention the specific error if you have one.** Instead of "my app doesn't build", try "I'm getting a 'cannot find type NetworkManager' error in LoginService.swift". The agent can jump straight to the fix. > [!TIP] > > **Ask for logs when debugging runtime issues.** Adding "check the logs" tells the agent to stream runtime output, which is often the fastest way to diagnose crashes and unexpected behavior. > [!TIP] > > **Let the agent iterate.** "Build and keep fixing until it compiles" is a perfectly valid prompt. The agent will loop through errors, fixing each one and rebuilding until the build succeeds. # Infrastructure with AI Source: https://docs.flowdeck.studio/cli/ai-agents/infrastructure Manage simulators, runtimes, devices, packages, cleaning, and project configuration with your AI agent Your AI agent can handle all the infrastructure work that usually means switching to Terminal and remembering obscure `simctl` flags. Simulators, runtimes, devices, Swift packages, cleaning, project setup - just describe what you need and the agent takes care of it. ## Simulators ### List available simulators ``` What simulators do I have installed? Which ones are booted? ``` The agent will list all installed simulators with their names, OS versions, and current state (booted, shutdown). It highlights which ones are currently running. ### Create a simulator ``` Create an iPhone 16 Pro Max simulator with iOS 18. ``` The agent will check if the iOS 18 runtime is installed, create the simulator with the correct device type and runtime pairing, and report the new simulator's name and UDID. ### Boot and open a simulator ``` Boot my iPhone 16 simulator and open the Simulator app so I can see it. ``` The agent will boot the simulator and launch the Simulator.app window so you can watch what's happening on screen. ### Shut down simulators ``` Shut down all running simulators. ``` The agent will find all booted simulators and shut them down. This frees up system resources when you're done testing. ### Delete old simulators ``` Delete all simulators running iOS 16 or older. Keep everything else. ``` The agent will list simulators, identify the ones matching your criteria, confirm what it plans to delete, and remove them. This frees up disk space from simulators you no longer need. ### Prune stale simulators ``` Clean up simulators I haven't used recently. ``` The agent will identify and remove simulators that have never been booted, have not been booted in 90+ days, or are unavailable because their runtime is no longer installed. ### Reset a simulator to clean state ``` Erase my iPhone 16 simulator so it's like a fresh install. ``` The agent will erase all content and settings from the simulator, returning it to its factory state. Useful for testing first-launch experiences or onboarding flows. ### Clone a simulator ``` Clone my iPhone 16 Pro simulator and name it "iPhone 16 Pro - QA". ``` The agent will duplicate the existing simulator with all its settings, installed apps, and data. Cloning is faster than creating from scratch when you need an identical copy of a configured environment. ### Rename a simulator ``` Rename my iPhone 16 simulator to "iPhone 16 - CI". ``` The agent will rename the existing simulator in place. The UDID stays the same, so saved destinations and scripts that target that device keep working. Only the display name in `flowdeck simulator list` and the Simulators & Runtimes window changes. ### Set up multiple simulators ``` I want to test on both iPhone SE and iPhone 16 Pro Max at the same time. Make sure both exist and are booted. ``` The agent will check if both simulators exist, create any that are missing, and boot both so you can run your app on either one. ### Set simulator location ``` Set my simulator's location to San Francisco. ``` The agent will set the GPS coordinates on the simulator. Useful for testing location-based features without physically being there. ### Add media to a simulator ``` Add this photo to my simulator's camera roll. ``` The agent will push the image file to the simulator's photo library so you can test image picker flows and photo-related features. *** ## Runtimes ### List installed runtimes ``` What iOS runtimes do I have installed? ``` The agent will list all installed simulator runtimes with their version numbers and disk usage. ### Check available runtimes ``` What iOS runtimes can I download? ``` The agent will check Apple's available runtimes and show you which versions you can install, including beta releases if available. ### Install a new runtime ``` Install the iOS 17.5 runtime. ``` The agent will download and install the runtime. This can take a while depending on your internet connection, since runtimes are several gigabytes. ### Install a runtime and create a simulator ``` I need to test on iOS 17. Install the latest iOS 17 runtime and create an iPhone 15 simulator with it. ``` The agent will install the runtime, wait for it to complete, then create a new simulator paired with that runtime. You'll be ready to build and run on it immediately. ### Remove old runtimes ``` Delete the iOS 16 runtime to free up disk space. ``` The agent will check for simulators that depend on the runtime, remove or prune them first if needed, then delete the runtime itself. ### List available device types ``` What device types can I create simulators for? ``` The agent will list all available device types (iPhone models, iPad models, Apple Watch, Apple TV, etc.) that you can pair with your installed runtimes. *** ## Physical devices ### List connected devices ``` What devices are connected to my Mac? ``` The agent will list all connected physical devices with their names, model identifiers, OS versions, and connection state. ### Install an app on a device ``` Install the built app on my connected iPhone. ``` The agent will find the built .app bundle and install it on your connected device. ### Uninstall an app from a device ``` Uninstall MyApp from my connected iPhone. ``` The agent will remove the app from the device by its bundle identifier. *** ## Cleaning ### Clean build artifacts ``` Clean the build. ``` The agent will clean the scheme's build artifacts from derived data. This is the standard clean that matches Xcode's "Clean Build Folder" behavior. ### Deep clean everything ``` Clean everything - build artifacts, caches, all of it. ``` The agent will clean scheme artifacts, FlowDeck's derived data, and Xcode's module and build caches. This is the nuclear option for when incremental builds are acting up. ### Clean and rebuild ``` Clean the build and rebuild from scratch. ``` The agent will clean all artifacts first, then perform a fresh build. This solves stale cache issues and ensures a clean starting point. ### Clear simulator caches ``` Clear my simulator caches. ``` The agent will clear cached data from simulators, which can fix issues with stale resources or unexpected behavior after updates. *** ## Swift packages ### List installed packages ``` What Swift packages does this project use? ``` The agent will list all Swift Package Manager dependencies in the project with their names and resolved versions. ### Add a package ``` Add the Alamofire package to my project. ``` The agent will add the package dependency to your project with the appropriate version constraints. ### Remove a package ``` Remove the unused SnapKit package from my project. ``` The agent will remove the package dependency from your project. ### Resolve packages ``` Resolve my Swift packages. ``` The agent will run SPM package resolution, downloading any missing dependencies and updating the package graph. ### Update all packages ``` Update all my Swift packages to their latest compatible versions. ``` The agent will update every package dependency to the newest version allowed by your version constraints. It reports which packages were updated and to what versions. ### Fix package resolution issues ``` My packages won't resolve. It keeps failing with a dependency conflict. Help me fix it. ``` The agent will try an escalating series of fixes: resolve, then update, then clear the package cache, then clean and retry. If there's a version conflict, it will read your Package.swift or .xcodeproj to understand the constraints and suggest how to resolve the conflict. ### Clear package cache ``` Clear my Swift package cache. Something seems corrupted. ``` The agent will clear the local package cache and re-resolve from scratch. This fixes most "weird" package issues caused by corrupted downloads or stale caches. ### Link a package to a target ``` Link the Alamofire package product to my MyApp target. ``` The agent will link the specified package product to your build target so you can import and use it in your code. *** ## App management ### List running apps ``` What apps has FlowDeck launched? Are any still running? ``` The agent will list all apps tracked by FlowDeck, showing their app IDs, bundle identifiers, and current state. ### Stop a running app ``` Stop the running app. ``` The agent will terminate the app that FlowDeck launched on the simulator or device. ### Uninstall an app ``` Uninstall MyApp from the simulator. ``` The agent will remove the app from the target simulator by its app ID or bundle identifier. ### Stream logs from a running app ``` Stream the logs from the running app. Flag any errors or warnings. ``` The agent will attach to the running app's log stream, capturing real-time output including `print()` statements and OSLog messages, and flagging anything that looks like an error or unexpected behavior. *** ## Project configuration ### Discover the project ``` What workspaces, schemes, and build configurations does this project have? ``` The agent will inspect your project and give you a complete inventory: workspaces, schemes, build configurations (Debug, Release, etc.), available simulators, and connected devices. ### Save a default configuration ``` Configure FlowDeck to use the MyApp scheme with iPhone 16 by default. ``` The agent will save these settings so all subsequent build, run, and test commands use them automatically. No more passing flags every time. ### Reset configuration ``` Reset my FlowDeck configuration for this project. ``` The agent will clear the saved settings, so you can start fresh or reconfigure with different options. ### Create a new Xcode project ``` Create a new iOS app project called WeatherApp. ``` The agent will generate a new Xcode project from a template with the specified name, ready to build and run. ### Create a multi-platform project ``` Create a new app called MediaPlayer that targets iOS, tvOS, and watchOS. ``` The agent will create a project configured for all the specified platforms, with the correct deployment targets and build settings for each. ### Create an iOS app with a watchOS companion ``` Create a new app called FitnessTracker with a companion watchOS app. ``` The agent will generate a project with an iOS app and a paired watchOS companion app that shares data and functionality. ### Sync provisioning profiles ``` Sync my provisioning profiles for this project. ``` The agent will refresh the provisioning profiles from your developer account, resolving signing issues that come up after certificate or profile changes. *** ## Licensing ### Check license status ``` What's my FlowDeck license status? ``` The agent will check whether your license is active, what tier it is, and when it expires. ### Activate a license ``` Activate my FlowDeck license with this key: XXXX-XXXX-XXXX ``` The agent will activate the license on your machine. *** ## Tips for better results > [!TIP] > > **Be specific about versions.** "Install iOS 18" is clearer than "install the latest runtime". The agent can figure it out either way, but explicit versions avoid surprises. > [!TIP] > > **Ask the agent to clean up.** Old simulators and runtimes eat disk space. Periodically ask "what simulators and runtimes do I have, and which ones can I safely delete?" to reclaim space. > [!TIP] > > **Combine setup steps.** "Install iOS 17, create an iPhone 15 simulator with it, and run my app on it" is a single prompt that handles the full setup chain. > [!TIP] > > **Use deep clean sparingly.** A regular `clean` is usually enough. The full clean (everything + caches) is slower because it forces a complete rebuild, but it's the right tool when something feels genuinely broken. # Testing with AI Source: https://docs.flowdeck.studio/cli/ai-agents/testing Run tests, diagnose failures, and fix bugs with your AI agent Your AI agent can run your test suite, read the results, understand why tests failed, and fix the code. It doesn't just report "3 tests failed" - it traces each failure to the root cause and determines whether the bug is in the production code or the test itself. ## How the agent handles test failures When a test fails, the agent doesn't stop at the error message. It: 1. Reads the full test output to identify which tests failed and why 2. Opens the failing test file and reads the test expectations 3. Opens the code under test and reads the implementation 4. Determines whether the test expectation is wrong or the implementation has a bug 5. Applies the fix and re-runs the tests to confirm This means you can hand off a red test suite and come back to a green one. *** ## What you can ask ### Run all tests ``` Run my tests. If anything fails, fix it. ``` The agent will execute the full test suite, identify any failures, trace each one to its root cause, and fix the code. It re-runs to confirm everything passes. ### Run a specific test class or method ``` Run only the CheckoutTests and fix whatever is failing. ``` The agent filters the run to just that class, identifies failures, and fixes them. This is useful when you're working on a specific feature and don't want to wait for the full suite. ``` Run CheckoutTests.testApplyDiscountCode. If it fails, figure out whether the bug is in the test or the implementation and fix it. ``` You can go as specific as a single test method. The agent will run it, read the assertion error, compare the test expectation against the implementation, and fix whichever side has the bug. ### Fix failing tests ``` Run tests. If anything fails, figure out why and fix it. ``` The agent runs the suite, identifies failures, and for each one, reads the test and the production code to understand what went wrong. It applies fixes (to whichever side has the bug) and re-runs to confirm everything passes. ### Run tests after a code change ``` I just refactored the PaymentService. Run the tests for that module and make sure nothing broke. Fix any regressions. ``` The agent will find the relevant test files, run them, and if your refactor broke something, it traces exactly which behavior changed and fixes the code to make the tests pass again. ### Audit test coverage for a feature area ``` Run all tests related to authentication. Identify any gaps in coverage and write tests for any untested paths. ``` The agent will discover test files matching the area (by name or by searching for relevant imports), run them, and analyze what's covered. If it finds gaps - like missing tests for the password reset flow or error handling - it writes the missing tests and runs them to confirm they pass. ### Write tests for new code ``` I just added a CartManager class. Write unit tests for the addItem, removeItem, and calculateTotal methods. Make sure they all pass. ``` The agent will read the CartManager implementation, write tests covering the happy path and edge cases (empty cart, duplicate items, negative quantities), add them to the test target, and run the suite to verify they all pass. ### Fix a flaky test ``` CheckoutTests.testConcurrentAddToCart fails intermittently. Run it 5 times, find the root cause, and fix it. ``` The agent will run the test multiple times, compare the outputs, and look for patterns: race conditions, timing dependencies, shared state leaking between runs. Once it identifies the root cause, it fixes the underlying issue and re-runs to confirm the test is stable. ### Run tests on a different simulator ``` Run the UI tests on iPad Pro. Make sure all layout assertions pass on the larger screen size. ``` The agent will resolve the iPad simulator, boot it if needed, and run the UI test suite. This catches layout issues that only appear on different screen sizes. If any tests fail, it traces and fixes the layout problems. *** ## Tips for better results > [!TIP] > > **Name your tests clearly.** Tests like `testCalculateTotal_withDiscountCode_appliesPercentageOff` give the agent immediate context about the expected behavior without reading the implementation. > [!TIP] > > **Tell the agent which module or area to focus on.** "Run the payment tests" is faster and more focused than "run all tests" when you're iterating on a specific feature. > [!TIP] > > **Ask the agent to explain, not just fix.** "Explain why this test fails" often gives you better insight than "fix the failing test", especially when the root cause might be a design issue rather than a simple bug. # UI Automation with AI Source: https://docs.flowdeck.studio/cli/ai-agents/ui-automation Let your AI agent see, tap, type, scroll, and verify your app's UI This is where FlowDeck gets interesting. Your AI agent doesn't just build and run your app - it can **see the screen**, **read every element**, and **interact with the UI** like a real user. FlowDeck gives the agent access to live UI automation on both **iOS Simulators** and **macOS apps**. The agent captures the screen and the full accessibility tree, so it always knows what's visible, what's tappable, and what changed after an interaction. ## How the agent sees your app ### iOS Simulator When the agent starts a UI automation session on the simulator, FlowDeck captures two things on an adaptive loop that begins at 500ms: * **A screenshot** - a JPEG image the agent can read and analyze visually * **The accessibility tree** - a structured JSON representation of every element on screen, including labels, accessibility identifiers, roles, frames, and enabled/visible state The agent uses both: the screenshot for visual context and the tree for precise element targeting. After every action (tap, type, scroll), it re-reads both to verify what changed. Simulator sessions keep one framebuffer attachment open and avoid copying or encoding pixels while the screen is unchanged. If that private interface is unavailable, FlowDeck warns once and automatically uses its legacy screenshot backend for the rest of the session. Agents can inspect `capture_backend` (`framebuffer` or `legacy_screenshot`) and the optional `capture_warning` in `session start --json` and `session list --json`; the `latest_screenshot` and `latest_tree` paths stay the same with either backend. ### macOS Apps When the agent starts a UI automation session for a macOS app, FlowDeck captures the same two things it does for iOS: * **A screenshot** - a JPEG image the agent can read and analyze visually * **The accessibility tree** - a structured JSON representation of every element in the app UI, including labels, accessibility identifiers, roles, frames, and enabled/visible state The agent uses both: the screenshot for visual context and the tree for precise targeting. After every action (click, type, scroll, menu navigation), it re-reads both to verify what changed. For one-off checks, it can still fall back to `flowdeck ui mac screen`. macOS automation requires Accessibility and Screen Recording permissions (the agent can check and request these automatically). In both cases, the agent doesn't guess. It acts, observes, and confirms. *** ## What you can ask ### Validate a user flow end-to-end ```text theme={null} Run the app, log in with "test@example.com" and "password123", navigate to Settings, and validate that the account email is displayed correctly. Fix any issues you find. ``` The agent will launch the app, start a UI session, fill in the login form, submit it, wait for the main screen, navigate to Settings, and read the accessibility tree to confirm the email label matches. If anything is off - wrong label, missing element, broken navigation - it flags the issue and fixes the code. ### Validate onboarding flow ```text theme={null} Run the app from a clean state. Walk through every onboarding screen, tapping whatever button advances to the next step. Make sure every screen loads correctly and the flow completes without errors. ``` The agent clears any existing app data using your app's bundle identifier, then launches a fresh instance. It reads the screen at each step, identifies the correct button (even when labels change from "Next" to "Continue" to "Get Started"), taps it, waits for the transition, and verifies the next screen loaded. If any step breaks - missing button, stuck transition, crash - it reports exactly where the flow failed. ### Reproduce and diagnose a bug ```text theme={null} A user says the checkout button stops working after removing an item from the cart. Run the app, add two items to the cart, remove one, then try to tap Checkout. Verify the button is still functional and check the logs for errors. Fix the issue if you find one. ``` The agent launches the app with log streaming, navigates to a product, adds items, opens the cart, removes one, and attempts to tap Checkout. It reads the accessibility tree to check if the button is enabled, verifies the visual state, and reviews the runtime logs for errors. If the button is broken, it traces the root cause and fixes it. ### Scroll and validate an element ```text theme={null} Run the app, go to the settings screen, and scroll down until you find "Delete Account". Tap it and verify a confirmation dialog appears with a cancel option. ``` The agent navigates to settings, then scrolls incrementally while reading the accessibility tree after each scroll. When "Delete Account" appears, it taps it and validates the alert dialog - checking that the title, message, and expected buttons (including a cancel option) are all present and correct. ### Validate form error handling ```text theme={null} Run the app, go to the registration form, and test these cases: 1. Submit with all fields empty 2. Enter an invalid email and submit 3. Enter a password with only 3 characters and submit Verify that each case shows the correct validation error. Fix any missing or incorrect error messages. ``` The agent tests each case one by one: fills the fields, taps submit, reads the error labels from the accessibility tree, verifies the message matches the expected validation rule, then clears the form for the next case. If any validation is missing or shows the wrong message, it fixes the code and re-verifies. ### Validate accessibility identifiers ```text theme={null} Run the app, navigate to the login screen, and verify that these accessibility IDs exist and are visible: emailField, passwordField, loginButton, forgotPasswordLink. Fix any that are missing. ``` The agent starts a session, reads the accessibility tree, and checks each identifier - present or missing, visible or hidden, enabled or disabled. If any IDs are missing or misconfigured, it opens the relevant SwiftUI view and adds or fixes them. ### Validate a deep link ```text theme={null} Run the app, then open the deep link myapp://orders/12345 and verify the order detail screen loads with the correct order number displayed. ``` The agent builds and launches the app first (the app must be running or at least installed for deep links to work), then opens the URL in the simulator, waits for the screen to settle, and reads the accessibility tree to confirm the order detail screen loaded with the expected content. If the wrong screen appears or the order number is missing, it reports the failure. ### Validate navigation across multiple screens ```text theme={null} Verify this flow works: Home -> tap "Browse" tab -> tap first category -> tap first product -> tap "Add to Cart" -> tap cart icon -> verify cart has one item. Fix any broken navigation or missing elements. ``` The agent walks through the entire flow, tapping the correct element at each step, waiting for transitions, and verifying the expected screen loaded. If any step fails - element not found, unexpected screen, wrong content - it identifies exactly where the flow broke, traces the issue in the code, and fixes it. ### Validate dark mode appearance ```text theme={null} Run the app, switch to dark mode, and verify that all text on the Home screen is still readable and no elements are invisible against the background. Fix any contrast issues. ``` The agent switches the simulator appearance, waits for the UI to update, and reads the accessibility tree to verify all text elements are still present and visible. It compares against the light mode state and flags any elements that disappeared or lost contrast. If it finds issues, it adjusts the color scheme in the code. ### Validate layout across screen sizes ```text theme={null} Run the app on iPhone SE and iPhone 16 Pro Max. Navigate to the checkout screen on both and verify that nothing is clipped, truncated, or overlapping. Fix any layout issues. ``` The agent runs the app on each simulator, navigates to the same screen, and checks for layout problems - clipped text, overlapping elements, broken constraints. If it finds issues on either screen size, it adjusts the layout code and re-verifies on both devices. ### Verify a code change didn't break the UI ```text theme={null} Run the app and check the profile screen. I'm going to make some changes. When I say "done", rebuild and verify the profile screen still renders correctly with no visual regressions. ``` The agent captures the baseline state, waits for you to finish editing, rebuilds, navigates back to the same screen, and compares against the original. It flags any visual differences - missing elements, shifted layout, changed colors - so you catch regressions immediately. *** ## macOS automation workflows FlowDeck's macOS automation (`flowdeck ui mac`) lets the agent drive native Mac apps the same way it drives iOS simulators. Here are workflows specific to macOS. > [!NOTE] > > **The agent never takes your screen.** macOS actions are delivered straight to the target app, so your cursor doesn't move and your frontmost window doesn't change — you can keep working through any of the workflows below. The handful of commands that genuinely can't work that way (`drag`, `swipe`, `move`, `activate`, `window focus`) refuse to run unless the agent passes `--foreground`, which it is instructed to do only after asking you about that specific step. See [macOS Automation](/cli/macos-automation#foreground-mode-foreground). ### Automate a macOS app form ```text theme={null} Run my macOS app, fill in the registration form with test data, submit it, and verify the success message appears. Fix any issues. ``` The agent launches the app, starts a macOS UI session, uses the accessibility tree to find form fields by their identifiers, fills them in, clicks the submit button, and verifies the expected result. If validation messages are missing or wrong, it traces the issue and fixes the code. ### Test menu-driven workflows ```text theme={null} Open my macOS app, use the File menu to create a new document, type some text, then use File > Export as PDF. Verify the export dialog appears. ``` The agent starts a session, navigates menu hierarchies using `flowdeck ui mac menu click`, types content, triggers the export, and confirms the dialog appeared with the expected options. ### Validate window management ```text theme={null} Launch my macOS app, resize the main window to 800x600, then verify that all UI elements are still visible and nothing is clipped or truncated. ``` The agent starts a session, resizes the window using `flowdeck ui mac window resize`, re-reads the latest capture, and checks that all expected elements are present and within the visible frame. ### Test keyboard shortcuts ```text theme={null} Open my macOS app, press Cmd+N to create a new item, type a name, press Cmd+S to save, then verify the item appears in the list. ``` The agent starts a session, sends hotkey combinations via `flowdeck ui mac hotkey`, types text, and re-reads the accessibility tree to confirm the expected state changes after each action. ### Verify macOS dark mode ```text theme={null} Run my macOS app, switch system appearance to dark mode, and verify all text is readable and no elements disappear against the background. ``` The agent starts a session, captures the UI state before and after the appearance change, and compares the accessibility trees to find elements that became invisible or lost their expected properties. ### Drive a multi-window workflow ```text theme={null} In my macOS app, open the preferences window using Cmd+comma, change the theme setting, close preferences, and verify the main window updated to reflect the new theme. ``` The agent starts a session, manages multiple windows, interacts with controls in the preferences panel, then switches focus back to the main window and re-reads the latest capture to verify the change took effect. *** ## Tips for better results > [!TIP] > > **Use accessibility identifiers in your prompts.** Instead of "tap the login button", say "tap the element with ID loginButton". The agent will use `--by-id` targeting, which is faster and more reliable than label matching. > [!TIP] > > **Be specific about what "verify" means.** Instead of "verify it works", say "verify the Home screen appears and shows the user's name". The agent needs concrete criteria to check against. > [!TIP] > > **Ask for screenshots at key moments.** The agent captures them automatically during verification, but explicitly asking "screenshot each step" gives you a visual audit trail. > [!TIP] > > **Mention logs when debugging.** Adding "check the logs for errors" tells the agent to stream runtime output alongside UI automation, giving you both visual and runtime evidence. > [!TIP] > > **For macOS apps, specify the app name.** The agent needs to know which app to target. Say "in Safari" or "in my app MyTool" so it uses the correct `--app` flag. > [!TIP] > > **Use menu paths for macOS.** Instead of "click the save button", say "use File > Save" when you want the agent to navigate menus. Menu paths are more reliable than finding toolbar buttons. # Design to Code with AI Source: https://docs.flowdeck.studio/cli/ai-agents/ui-implementation Turn mockups into SwiftUI views with AI-driven implementation and visual verification Hand your AI agent a design mockup and watch it turn into working SwiftUI code. The agent doesn't just write the code - it runs the app, compares the result against your design, and iterates until it matches. This works because FlowDeck gives the agent the ability to **see the simulator screen**. After every code change, the agent rebuilds, navigates to the screen, captures a screenshot, and compares it to your original mockup. No manual back-and-forth needed. ## How it works 1. You provide a design reference - an image, a screenshot, or a description 2. The agent analyzes it to extract layout, spacing, typography, colors, and effects 3. It writes the SwiftUI view 4. It builds and runs the app on the simulator 5. It captures a screenshot and compares against the original 6. If something doesn't match, it adjusts the code and repeats The agent does this loop automatically. You can jump in at any point to give feedback ("the padding is too tight", "use a bolder font"), and the agent will incorporate it into the next iteration. *** ## What you can ask ### Implement a full screen from a mockup ``` I attached a mockup of the profile screen. Implement it in SwiftUI, run the app, and validate it matches the design closely. Then iterate until you get a pixel-perfect implementation. ``` The agent will study the image - visual hierarchy, spacing rhythm, typography, colors, corner radii, shadows - and implement it as a SwiftUI view. It builds and runs the app, captures the result, compares it against the mockup, and keeps adjusting until the implementation matches the design precisely. ### Iterate on specific details ``` The card shadow is too harsh compared to the mockup. Make it softer and verify it matches the design. ``` The agent reads the current implementation, identifies the shadow modifier, adjusts the radius and opacity, rebuilds, and compares against the mockup. One change at a time, verified visually each time. ### Match spacing precisely ``` The spacing between the header and the first card looks like about 24pt in the mockup, but it looks tighter in the app. Fix it and verify the spacing matches the design. ``` The agent adjusts the spacing value, rebuilds, and compares the result against the mockup. If it's still off, keep iterating - the agent remembers the context and will keep refining. ### Build a reusable component ``` I attached a mockup of a rating stars component. Build it as a reusable SwiftUI view that takes a rating from 0 to 5. Verify it renders correctly with 3.5 stars and matches the mockup. ``` The agent implements the component with the specified API, adds it to a preview or test screen, runs the app, and validates the output matches the design. You get both the reusable code and confirmation it renders correctly. ### Build and verify interactions ``` I attached a mockup of a quantity stepper (minus button, count label, plus button). Build it in SwiftUI, run the app, and verify that tapping + increments and - decrements the count. ``` The agent implements the component, runs the app, starts a UI session, locates the stepper on screen, taps the plus button, reads the label to confirm it incremented, taps minus, confirms it decremented. You get the implementation and proof that it works. ### Implement a complex layout ``` I attached a mockup of a product card with an image, title, price, rating stars, and an "Add to Cart" button. The card has rounded corners and a subtle shadow. Implement it and iterate until it matches the design. ``` The agent breaks down the visual hierarchy - image at the top, text stack in the middle, button at the bottom - and implements each layer. It uses explicit spacing, exact hex colors from the mockup, continuous corner radius for the Apple-style squircle, and multi-layer shadows for realistic depth. It rebuilds and compares until the result matches. ### Validate across screen sizes ``` Build the settings screen from this mockup, then verify it renders correctly on both iPhone SE and iPhone 16 Pro Max. Fix any layout issues on either screen size. ``` The agent implements the screen, runs on iPhone SE and validates the layout, then runs on the larger device and checks again. If anything clips on the small screen or has excessive whitespace on the large one, it adjusts the layout and re-verifies on both. ### Dark mode variant ``` I built the Home screen for light mode. Now implement the dark mode variant to match this second mockup. Verify both modes render correctly and match their respective designs. ``` The agent reads the dark mode mockup, adjusts colors and backgrounds in the implementation (or adds a proper color scheme), then validates both light and dark mode against their respective designs. It iterates until both variants match. *** ## Tips for better results > [!TIP] > > **Provide high-quality mockups.** The sharper and more detailed the image, the better the agent can extract measurements. Figma exports at 2x work well. > [!TIP] > > **Call out non-obvious details.** If your design uses a specific font, custom colors, or unusual spacing, mention it in the prompt. The agent can estimate from the image, but explicit values are more reliable. > [!TIP] > > **Iterate in small steps.** Instead of "everything looks wrong", say "the title font is too small and the padding on the left side needs to increase by about 8pt". Specific feedback produces specific fixes. > [!TIP] > > **Ask for validation against the mockup.** Say "compare the result to the mockup and fix any differences" - the agent will iterate on its own until it matches, and you can jump in with specific feedback at any point. # App Launch Settings Source: https://docs.flowdeck.studio/cli/app-launch-settings Pass custom arguments and environment variables to your app at launch FlowDeck lets you pass arguments and environment variables to your app when it launches. This is useful for: * Skipping onboarding flows during development * Setting debug flags * Configuring API environments * Testing different locales ### Platform Support Both `args` and `env` are honored on every launch target: | Target | Args | Env | | - | - | - | | iOS/tvOS/watchOS/visionOS Simulator | ✅ | ✅ | | Physical device | ✅ | ✅ | | macOS (native) | ✅ | ✅ | | Mac Catalyst | ✅ | ✅ | > [!WARNING] > > Launch env is delivered by prefixing the child process's environment — `SIMCTL_CHILD_` for simulator launches, `DEVICECTL_CHILD_` for physical devices — never as part of the printed `xcrun simctl launch ...` or `devicectl ...` command line. Reading the verbose command line alone can never tell you whether an env var was applied, even when it worked correctly. > > Run with `--verbose` to see the actually-resolved config root, launch args, and launch env (including the literal `SIMCTL_CHILD_*`/`DEVICECTL_CHILD_*` keys sent to the process), printed directly instead of inferred from the command line. ## Methods Overview | Method | Best For | Priority | | - | - | - | | [CLI Options](#cli-options) | Quick testing from command line | Highest | | [Legacy Local Settings](#legacy-local-settings) | Compatibility with older project setups | Medium | | [Config File](#config-file) | CI/CD, reproducible builds | Lowest | When multiple sources provide settings, they're merged with CLI taking highest priority. ## Preferred Project Settings Format For shared project settings, prefer storing app launch settings in: * `.flowdeck/config.json` * `.flowdeck/config.local.json` Example: ```json theme={null} { "appLaunch": { "args": ["-SkipOnboarding"], "env": { "API_ENVIRONMENT": "staging" } }, "schemes": { "MyApp": { "appLaunch": { "args": ["-AppleLanguages", "(en)"], "env": { "DEBUG_MODE": "1" } } } } } ``` Use the top-level `appLaunch` block for project-wide defaults, and `schemes..appLaunch` for per-scheme overrides. ## CLI Options ### App Launch Arguments Use `--launch-options` to pass arguments to your app: ```bash theme={null} flowdeck run -w App.xcworkspace -s MyApp -S "iPhone 16" \ --launch-options='-AppleLanguages (en) -SkipOnboarding' ``` ### App Launch Environment Use `--launch-env` to set environment variables for your app: ```bash theme={null} flowdeck run -w App.xcworkspace -s MyApp -S "iPhone 16" \ --launch-env='DEBUG=1 API_ENV=staging' ``` ### Xcodebuild Arguments Use `--xcodebuild-options` to pass arguments to xcodebuild: ```bash theme={null} flowdeck run -w App.xcworkspace -s MyApp -S "iPhone 16" \ --xcodebuild-options='-quiet -enableCodeCoverage YES' ``` ### Xcodebuild Environment Use `--xcodebuild-env` to set environment variables for the build: ```bash theme={null} flowdeck run -w App.xcworkspace -s MyApp -S "iPhone 16" \ --xcodebuild-env='CI=true DEVELOPER_DIR=/Applications/Xcode-15.4.app/Contents/Developer' ``` ### Combining Options All options can be combined in any order: ```bash theme={null} flowdeck run -w App.xcworkspace -s MyApp -S "iPhone 16" \ --launch-options='-AppleLanguages (en) -SkipOnboarding' \ --launch-env='DEBUG=1' \ --xcodebuild-options='-quiet' \ --xcodebuild-env='CI=true' ``` > [!TIP] > > Use `=` syntax when values start with `-` to avoid argument parsing issues. ## Legacy Local Settings Create `.flowdeck/app-launch-settings.json` in your project root for settings that apply automatically: ```json theme={null} { "args": [ "-AppleLanguages", "(en)", "-SkipOnboarding", "-UITestingDisabled", "NO" ], "env": { "DEBUG_MODE": "1", "API_ENVIRONMENT": "staging" } } ``` This file is a legacy compatibility format and is still auto-loaded by current CLI runtime paths. > [!NOTE] > > Prefer `.flowdeck/config.json` or `.flowdeck/config.local.json` for new setup. Keep `.flowdeck/app-launch-settings.json` only when you need compatibility with older workflows. ### Structure | Field | Type | Description | | - | - | - | | `args` | array | Arguments passed to the app at launch | | `env` | object | Environment variables set for the app process | ## Config File Include app launch settings in your `--config` JSON file: ```json theme={null} { "workspace": "MyApp.xcworkspace", "scheme": "MyApp", "appLaunch": { "args": [ "-AppleLanguages", "(en)", "-SkipOnboarding" ], "env": { "API_ENVIRONMENT": "staging" } } } ``` Use with: ```bash theme={null} flowdeck run --config path/to/config.json -S "iPhone 16" ``` > [!NOTE] > > `--config` uses the explicit command config format, which is separate from `.flowdeck/config.json` and `.flowdeck/config.local.json`. See [Configuration File](/cli/configuration-file) for the difference. ## Priority and Merging When settings come from multiple sources, they're combined in this order: 1. **Config file** (lowest priority) - base configuration 2. **Local app-launch-settings.json** - compatibility override for current CLI auto-load behavior 3. **CLI options** (highest priority) - overrides everything **Args** are appended in order (config + local + CLI). **Environment variables** are merged, with higher priority sources overwriting lower priority values for the same key. > [!NOTE] > > The canonical shared project-settings format is `appLaunch` inside `.flowdeck/config.json` or `.flowdeck/config.local.json`. The separate `app-launch-settings.json` file remains a legacy compatibility input. ## Common Arguments Reference ### Apple System Arguments | Argument | Description | | - | - | | `-AppleLanguages (en)` | Force app language to English | | `-AppleLanguages (es)` | Force app language to Spanish | | `-AppleLocale en_US` | Force locale to US English | | `-AppleTextDirection` | Override text direction (LTR/RTL) | | `-NSDoubleLocalizedStrings YES` | Double all localized strings (find truncation issues) | | `-NSShowNonLocalizedStrings YES` | Highlight non-localized strings | ### Common App Flags | Argument | Description | | - | - | | `-SkipOnboarding` | Skip onboarding flow (if your app supports it) | | `-UITestingDisabled NO` | Enable/disable UI testing mode | | `-FIRAnalyticsDebugEnabled` | Enable Firebase Analytics debug mode | | `-FIRDebugEnabled` | Enable Firebase debug mode | ### UserDefaults Style You can pass any UserDefaults value: ```bash theme={null} --launch-options='-MyCustomFlag true -FeatureFlag_NewUI enabled' ``` Your app reads these with: ```swift theme={null} UserDefaults.standard.bool(forKey: "MyCustomFlag") UserDefaults.standard.string(forKey: "FeatureFlag_NewUI") ``` ## Environment Variables Set environment variables for the app process: ```bash theme={null} --launch-env='API_BASE_URL=https://staging.api.example.com DEBUG_MODE=1 LOG_LEVEL=verbose' ``` Your app reads these with: ```swift theme={null} ProcessInfo.processInfo.environment["API_BASE_URL"] ProcessInfo.processInfo.environment["DEBUG_MODE"] ``` ## Use Cases > [accordion] Skip Onboarding During Development > > ```bash theme={null} > flowdeck run -w App.xcworkspace -s MyApp -S "iPhone 16" \ > --launch-options='-SkipOnboarding -SkipTutorial' > ``` > [accordion] Test Different Locales > > ```bash theme={null} > flowdeck run -w App.xcworkspace -s MyApp -S "iPhone 16" \ > --launch-options='-AppleLanguages (ja) -AppleLocale ja_JP' > ``` > [accordion] Staging API Environment > > ```bash theme={null} > flowdeck run -w App.xcworkspace -s MyApp -S "iPhone 16" \ > --launch-env='API_ENVIRONMENT=staging API_BASE_URL=https://staging.api.example.com' > ``` > [accordion] Debug Firebase > > ```bash theme={null} > flowdeck run -w App.xcworkspace -s MyApp -S "iPhone 16" \ > --launch-options='-FIRDebugEnabled -FIRAnalyticsDebugEnabled' > ``` > [accordion] Find Localization Issues > > ```bash theme={null} > flowdeck run -w App.xcworkspace -s MyApp -S "iPhone 16" \ > --launch-options='-NSDoubleLocalizedStrings YES -NSShowNonLocalizedStrings YES' > ``` > [accordion] Full Development Setup > > ```bash theme={null} > flowdeck run -w App.xcworkspace -s MyApp -S "iPhone 16" \ > --launch-options='-AppleLanguages (en) -SkipOnboarding -EnableDevMenu' \ > --launch-env='DEBUG_MODE=1 API_ENVIRONMENT=development LOG_LEVEL=verbose' > ``` > [accordion] CI Build with Coverage > > ```bash theme={null} > flowdeck run -w App.xcworkspace -s MyApp -S "iPhone 16" \ > --xcodebuild-options='-quiet -enableCodeCoverage YES' \ > --xcodebuild-env='CI=true' > ``` ## Troubleshooting ### Arguments Not Taking Effect 1. **Check the source** - Make sure your JSON is valid: ```bash theme={null} cat .flowdeck/app-launch-settings.json | jq . ``` 2. **Verify priority** - CLI options override local settings which override config file 3. **Check your app** - Your app must read these values: ```swift theme={null} // For args UserDefaults.standard.bool(forKey: "SkipOnboarding") // For env ProcessInfo.processInfo.environment["DEBUG_MODE"] ``` ### Values Starting with Dash Use `=` syntax when values start with `-`: ```bash theme={null} # Won't work - ArgumentParser sees -AppleLanguages as new option flowdeck run ... --launch-options -AppleLanguages "(en)" # Works - use = syntax flowdeck run ... --launch-options='-AppleLanguages (en)' ``` ### JSON Array Format Arguments are individual array elements: ```json theme={null} { "args": ["-AppleLanguages", "(en)"] } ``` Not: ```json theme={null} { "args": ["-AppleLanguages (en)"] } ``` # Automation & Scripting Source: https://docs.flowdeck.studio/cli/automation Use FlowDeck programmatically with JSON output, config files, and shell scripting FlowDeck is designed for automation. Every command supports JSON output for machine parsing and configuration files for reproducible builds, making it ideal for CI/CD pipelines, shell scripts, and AI-powered development tools. ## Quick Start ```bash theme={null} # Save project settings once flowdeck config set -w MyApp.xcworkspace -s MyApp -S "iPhone 16" # Run commands without repeating options flowdeck build --json flowdeck test --json flowdeck run ``` ## Previewing mutations Supported mutating commands accept `--dry-run`. Combine it with `--json` to receive a normalized object containing `type: "dry_run"`, a display-safe `command`, and an argument-safe `argv` array without performing the mutation. ```bash theme={null} flowdeck simulator erase SIMULATOR-UDID --dry-run --json ``` See [Dry-Run Previews](/cli/dry-run) for the single-command and multi-command schemas. ## JSON Output Mode Add `--json` or `-j` to any command for machine-readable NDJSON (newline-delimited JSON) output: ```bash theme={null} flowdeck build --json flowdeck test --json flowdeck simulator list --json ``` ### Event Types FlowDeck emits structured events that you can parse line-by-line: | Event Type | Description | When Emitted | | - | - | - | | `status` | Progress updates | During operations (building, testing, launching) | | `output` | Raw process output | Build output, test output, logs | | `diagnostic` | Compiler diagnostics | Errors on failures; warnings when `--show-warnings` is enabled | | `result` | Operation completion | At end of build, test, clean operations | | `app_log` | Informational messages | Status messages, configuration info | | `message` | Structured messages | Warnings, errors, info with context | | `test_started` | Test case started | When a test begins | | `test_passed` | Test case passed | When a test succeeds | | `test_failed` | Test case failed | When a test fails (includes failure details) | | `test_skipped` | Test case skipped | When a test is skipped | | `configuration` | Build configuration | At start of build/run/test | `configuration` events include the resolved Derived Data path so automation can trace build artifacts. `flowdeck test --json` finishes with a top-level `flowdeck.test` snapshot in addition to the streamed events. That final object is the authoritative verdict and aggregate count source; for a real test phase, it also reports the selected absolute `resultBundlePath`. ### Event Structure All events follow a standardized structure: ```json theme={null} { "type": "status", "timestamp": "2025-01-13T10:30:45.123Z", "operation": "BUILD", "message": "Building", "stage": "BUILDING", "data": { "progress": 0.5, "phase": "Compiling" } } ``` ### Parsing JSON Output Use `jq` or similar tools to extract specific information: ```bash theme={null} # Check if build succeeded flowdeck build --json | jq -s 'last | select(.type == "result") | .data.success' # Get all errors flowdeck build --json | jq 'select(.type == "diagnostic") | select(.data.severity == "error")' # Get warning diagnostics (opt-in) flowdeck build --json --show-warnings | jq 'select(.type == "diagnostic") | select(.data.severity == "warning")' # Warning snapshots are always reconciled into DerivedData # /Warnings/*.json # Count test failures flowdeck test --json | jq -s '[.[] | select(.type == "test_failed")] | length' # Get the authoritative test summary flowdeck test --json | \ jq 'select(.schema == "flowdeck.test") | {success, totalTests, passedTests, failedTests, skippedTests, resultBundlePath}' ``` ### Shell Script Example ```bash theme={null} #!/bin/bash set -e # Build and check result flowdeck build --json | while IFS= read -r line; do type=$(echo "$line" | jq -r '.type') if [ "$type" = "diagnostic" ]; then severity=$(echo "$line" | jq -r '.data.severity') message=$(echo "$line" | jq -r '.message') if [ "$severity" = "error" ]; then echo "ERROR: $message" >&2 fi fi if [ "$type" = "result" ]; then success=$(echo "$line" | jq -r '.data.success') if [ "$success" = "true" ]; then echo "Build succeeded" else echo "Build failed" >&2 exit 1 fi fi done ``` ## Configuration Files Store build settings in JSON files for reproducible builds: ```bash theme={null} flowdeck build --config .flowdeck/ci-config.json flowdeck test --config .flowdeck/ci-config.json --json ``` > [!NOTE] > > These examples use the explicit `--config` file format for scripted runs. That format is separate from the project settings files at `.flowdeck/config.json` and `.flowdeck/config.local.json`. ### Config File Structure ```json theme={null} { "workspace": "MyApp.xcworkspace", "scheme": "MyApp", "configuration": "Debug", "platform": "iOS", "version": "18.0", "simulatorUdid": "A1B2C3D4-E5F6-7890-ABCD-EF1234567890", "derivedDataPath": "/tmp/flowdeck-derived-data", "xcodebuild": { "args": ["-enableCodeCoverage", "YES"], "env": { "CI": "true" } }, "appLaunch": { "args": ["-SkipOnboarding"], "env": { "DEBUG_MODE": "1" } } } ``` ### Config File Fields | Field | Type | Required | Description | | - | - | - | - | | `workspace` | string | Yes | Path to `.xcworkspace` or `.xcodeproj` | | `scheme` | string | Yes | Scheme name to build | | `configuration` | string | No | Build configuration (`Debug`/`Release`) | | `platform` | string | No | Target platform: `iOS`, `macOS`, `watchOS`, `tvOS`, `visionOS` | | `version` | string | No | OS version (e.g., `18.0`) | | `simulatorUdid` | string | No | Specific simulator UDID | | `deviceUdid` | string | No | Physical device UDID | | `derivedDataPath` | string | No | Custom derived data directory (default: `~/Library/Developer/FlowDeck/DerivedData`) | | `xcodebuild` | object | No | Passthrough settings for xcodebuild | | `appLaunch` | object | No | Arguments and env vars passed to app at launch | > [!NOTE] > > See [Configuration File](/cli/configuration-file) for complete reference and examples. ## Init Command Save project settings to avoid repeating options on every command: ```bash theme={null} # Save settings flowdeck config set -w MyApp.xcworkspace -s MyApp -S "iPhone 16" # Now run commands without options flowdeck build flowdeck test flowdeck run ``` Settings are saved to `~/.flowdeck/` and automatically loaded by subsequent commands. ### Init Options | Option | Short | Description | | - | - | - | | `--workspace` | `-w` | Path to workspace or project | | `--scheme` | `-s` | Scheme name | | `--simulator` | `-S` | Simulator name or UDID | | `--device` | `-D` | Device name or UDID | | `--configuration` | `-C` | Build configuration | ## Exit Codes All commands return appropriate exit codes for scripting: | Code | Description | | - | - | | `0` | Success | | `1` | Failure (build failed, tests failed, etc.) | | `64` | Usage error (invalid arguments) | ```bash theme={null} flowdeck build --json && echo "Build passed" || echo "Build failed" ``` For test runs, any nonzero underlying xcodebuild status—including status 65—is a failure. Use the command exit status for pipeline control and the final `flowdeck.test` object for the authoritative verdict, counts, and result-bundle location. ## Environment Variables | Variable | Description | | - | - | | `FLOWDECK_LICENSE_KEY` | License key for CI/CD (no activation needed) | | `DEVELOPER_DIR` | Override Xcode installation path | | `FLOWDECK_NO_UPDATE_CHECK` | Set to `1` to disable update notifications | ## Common Automation Patterns ### Pattern 1: Config-Driven Builds ```bash theme={null} # Create config files for different scenarios flowdeck build --config .flowdeck/debug-config.json flowdeck build --config .flowdeck/release-config.json flowdeck test --config .flowdeck/ci-config.json --json ``` ### Pattern 2: State-Driven Shortcuts ```bash theme={null} # Setup once flowdeck config set -w MyApp.xcworkspace -s MyApp -S "iPhone 16" # Run repeatedly without options flowdeck build flowdeck test flowdeck run ``` ### Pattern 3: JSON Streaming ```bash theme={null} # Parse events as they stream flowdeck build --json | while read -r event; do echo "$event" | jq -r 'select(.type == "status") | .message' done ``` ### Pattern 4: CI/CD Pipeline ```bash theme={null} # Full CI workflow flowdeck clean --all flowdeck build --config .flowdeck/ci-config.json --json flowdeck test --config .flowdeck/ci-config.json --json # Check results if flowdeck test --json | jq -e 'select(.schema == "flowdeck.test") | .success' >/dev/null; then echo "All tests passed" else echo "Tests failed" exit 1 fi ``` ### Pattern 5: Dynamic Simulator Selection ```bash theme={null} # Find and use a specific simulator UDID=$(flowdeck simulator list -P iOS --json | \ jq -r '.[] | select(.name | contains("iPhone 16")) | .udid' | head -1) flowdeck config set -w MyApp.xcworkspace -s MyApp -S "$UDID" flowdeck build --json ``` ## Commands with JSON Support Most commands support `--json` output: | Command | JSON Support | Notes | | - | - | - | | `build` | Yes | Full event streaming | | `run` | Yes | Includes app logs | | `test` | Yes | Test results with details | | `clean` | Yes | Clean status events | | `logs` | Yes | Structured log events | | `simulator list` | Yes | Array of simulators | | `simulator boot` | Yes | Boot status | | `device list` | Yes | Array of devices | | `project schemes` | Yes | Array of schemes | | `project configs` | Yes | Array of configurations | | `apps` | Yes | Running app list | | `license status` | Yes | License details | ## AI Agent Integration FlowDeck's JSON output makes it ideal for AI-powered development tools like Claude Code, Cursor, and CodeX. The structured output allows AI agents to: * Parse build errors and suggest fixes * Monitor test results and identify failing tests * Automate build-test-fix cycles * Track simulator and device state > [!NOTE] > > See [AI Agent Integration](/cli/ai-agents) for setup guides for specific AI tools. ## Next Steps * [CI/CD Integration](/cli/ci-cd) - Complete CI/CD setup guide * [Configuration File](/cli/configuration-file) - Full config file reference * [Xcodebuild Arguments](/cli/xcodebuild-args) - Passthrough options for xcodebuild * [App Launch Settings](/cli/app-launch-settings) - App launch arguments and environment # Building & Running Source: https://docs.flowdeck.studio/cli/building Build and run iOS/macOS apps from the command line FlowDeck CLI provides powerful build and run capabilities optimized for command-line workflows and CI/CD integration. ## Recommended Workflow The recommended workflow is to use `flowdeck config set` to save project settings, then run commands without parameters: ```bash theme={null} # 1. Discover project structure flowdeck context --json # 2. Initialize with discovered settings flowdeck config set -w MyApp.xcworkspace -s MyApp -S "iPhone 16" # 3. Run commands without parameters flowdeck build flowdeck run flowdeck test flowdeck clean ``` > [!TIP] > > After running `flowdeck config set`, all subsequent commands use the saved settings automatically. You only need to specify parameters when you want to override the defaults. > [!NOTE] > > `flowdeck config set` saves runtime selection state. Shared project settings live separately in `.flowdeck/config.json` and `.flowdeck/config.local.json`, while explicit `--config` files remain the portable way to script a full command invocation. ## Project Context The `context` command gives you (or your AI agent) everything needed to understand your project at a glance. Available schemes, build configurations, simulators, and connected devices. ```bash theme={null} # Get app context flowdeck context # JSON output (recommended for AI agents) flowdeck context --json ``` ## Building Your App ### Basic Build ```bash theme={null} # After config set, build using saved settings flowdeck build # Or specify parameters directly flowdeck build -w MyApp.xcworkspace -s MyApp -S "iPhone 16" ``` ### Build for macOS Use `--device "My Mac"` for macOS targets: ```bash theme={null} flowdeck build -w MyApp.xcworkspace -s MyApp -D "My Mac" ``` ### Build for Physical Device Use `--device` with the device name or UDID: ```bash theme={null} # By device name (partial match, case-insensitive) flowdeck build -w MyApp.xcworkspace -s MyApp -D "iPhone" flowdeck build -w MyApp.xcworkspace -s MyApp -D "John's iPhone" # By device UDID (exact match) flowdeck build -w MyApp.xcworkspace -s MyApp -D "00008130-001245110C08001C" ``` > [!TIP] > > Use `flowdeck device list` to see available devices and their UDIDs. ### Build Configurations Specify Debug or Release configuration: ```bash theme={null} # Debug build (default) flowdeck build -C Debug # Release build flowdeck build -C Release ``` ### Custom Xcodebuild Options Pass arguments directly to xcodebuild: ```bash theme={null} # Code coverage flowdeck build --xcodebuild-options='-enableCodeCoverage YES' # Quiet mode flowdeck build --xcodebuild-options='-quiet' # Environment variables flowdeck build --xcodebuild-env='CI=true' ``` > [!NOTE] > > For the complete list of build options, see the [Build Command Reference](/cli/commands/build). ## Running Your App ### Build and Run on Simulator ```bash theme={null} # After config set, run using saved settings flowdeck run # Or specify parameters directly flowdeck run -w MyApp.xcworkspace -s MyApp -S "iPhone 16" ``` This command: 1. Builds the app 2. Opens Simulator.app (if iOS) 3. Boots the simulator (or uses already running) 4. Installs the app 5. Launches the app > [!NOTE] > > `flowdeck run` launches app bundle schemes only. Pure Swift Package targets should use `flowdeck build` or `flowdeck test`; use `-w` with an Xcode app workspace or project when the goal is to launch an app. ### Build and Run on macOS ```bash theme={null} flowdeck run -w MyApp.xcworkspace -s MyApp -D "My Mac" ``` ### Mac Catalyst Run an iOS app as Mac Catalyst using `--device "My Mac Catalyst"`: ```bash theme={null} flowdeck run -w MyApp.xcworkspace -s MyApp -D "My Mac Catalyst" ``` This builds the app with `platform=macOS,variant=Mac Catalyst` and runs it natively on your Mac. > [!TIP] > > Use `flowdeck device list` to see all available targets including "My Mac" and "My Mac Catalyst". ### Build and Run on Physical Device ```bash theme={null} flowdeck run -w MyApp.xcworkspace -s MyApp -D "John's iPhone" ``` > [!NOTE] > > For the complete list of run options including `--interactive` and `--wait-for-debugger`, see the [Run Command Reference](/cli/commands/build#flowdeck-run). ### Run with Log Streaming Stream app logs after launching: ```bash theme={null} flowdeck run -S "iPhone 16" --log flowdeck run -S "iPhone 16" -l # Short form flowdeck run -D "John's iPhone" --log ``` ### Run Without Building Skip the build step and launch an existing app with `--no-build`: ```bash theme={null} # Run the last built app without rebuilding flowdeck run --no-build # Or specify a target flowdeck run -S "iPhone 16" --no-build flowdeck run -D "My Mac" --no-build ``` This is useful for: * Quick iteration when you haven't changed code * Testing different launch configurations * Launching after a manual Xcode build **Behavior:** * If a built app exists, it shows "⏭️ Running build from X ago" and launches immediately * If no built app is found, it automatically falls back to building from source with "⚠️ No built app found. Building from source..." > [!TIP] > > In interactive mode, use Shift+R to run without building. ### App Launch Arguments Pass arguments and environment variables to your app: ```bash theme={null} # Launch arguments flowdeck run -S "iPhone 16" --launch-options='-AppleLanguages (en) -SkipOnboarding' # Environment variables flowdeck run -S "iPhone 16" --launch-env='DEBUG=1 API_ENV=staging' ``` ## JSON Output for Automation Use `--json` for machine-readable output, essential for CI/CD pipelines: ```bash theme={null} flowdeck build --json flowdeck build --json --show-warnings flowdeck run --json flowdeck run --json --show-warnings flowdeck test --json ``` > [!NOTE] > > Compiler warnings are hidden by default in regular and JSON output. Add `--show-warnings` to `build` or `run` to surface them (console output in text mode, `diagnostic` events in JSON mode). Warning snapshots are always reconciled and stored in `/Warnings`, even without `--show-warnings`. > [!NOTE] > > For complete CI/CD setup including license configuration and pipeline examples, see [CI/CD Integration](/cli/ci-cd). This outputs NDJSON (newline-delimited JSON) events: ```json theme={null} {"type":"app_log","message":"Build Started"} {"type":"app_log","message":"Resolving Packages"} {"type":"app_log","message":"Building"} {"type":"app_log","message":"Build Completed"} ``` ## Custom Derived Data FlowDeck uses `~/Library/Developer/FlowDeck/DerivedData` by default. Override it when you need isolation across builds: ```bash theme={null} flowdeck build -d ~/Library/Developer/FlowDeck/DerivedData-CI ``` ## Cleaning Clean build artifacts before rebuilding: ```bash theme={null} # After config set, clean using saved settings flowdeck clean # Clean scheme artifacts flowdeck clean -w MyApp.xcworkspace -s MyApp # Clean all FlowDeck derived data flowdeck clean --derived-data # Clean all Xcode derived data flowdeck clean --xcode-derived-data # Clean Xcode cache flowdeck clean --xcode-cache # Clean everything flowdeck clean --all ``` ## Config Files Use the `--config` option to pass a set of pre-defined parameters from a JSON file. This is especially useful for CI/CD pipelines and complex build configurations. ```bash theme={null} # Build with a config file flowdeck build --config .flowdeck/ci-config.json # Run with a config file flowdeck run --config .flowdeck/ci-config.json ``` This `--config` file is the explicit command config format, not the same as `.flowdeck/config.json` or `.flowdeck/config.local.json`. See [Configuration File](/cli/configuration-file) for the complete reference and the distinction between the two formats. ## Performance Optimization FlowDeck CLI automatically: * Detects CPU core count for parallel builds * Uses optimized build settings * Enables incremental compilation ## Troubleshooting ### "Workspace not found" Ensure you're specifying the correct path: ```bash theme={null} # Use full path if needed flowdeck build -w /path/to/MyApp.xcworkspace -s MyApp -S "iPhone 16" # Or navigate to the project directory and configure once cd ~/Projects/MyApp flowdeck config set -w MyApp.xcworkspace -s MyApp -S "iPhone 16" flowdeck build ``` ### "Scheme not found" Use `flowdeck context --json` to discover available schemes: ```bash theme={null} flowdeck context --json | jq '.schemes' ``` ### "Simulator not found" List available simulators first: ```bash theme={null} flowdeck simulator list -P iOS -A ``` ### "Build failed" Try cleaning and rebuilding: ```bash theme={null} flowdeck clean --all flowdeck build ``` Check the error output for specific issues like missing dependencies or code signing problems. # CI/CD Integration Source: https://docs.flowdeck.studio/cli/ci-cd Run FlowDeck in continuous integration and deployment pipelines FlowDeck CLI is designed to work seamlessly in CI/CD environments like GitHub Actions, GitLab CI, CircleCI, Bitrise, and other automation platforms. ## License Configuration In CI environments, FlowDeck validates your license through an environment variable instead of machine activation. This approach: * Does not consume activation slots * Works across ephemeral CI runners * Requires no persistent storage > [!WARNING] > > Using your license as an environment variable does not count against your activation limit, but this functionality is restricted to **CI/CD environments only**. For local development, you must activate the license using `flowdeck license activate `. ### Setting the License Key Set the `FLOWDECK_LICENSE_KEY` environment variable in your CI configuration: ```yaml GitHub Actions theme={null} env: FLOWDECK_LICENSE_KEY: ${{ secrets.FLOWDECK_LICENSE_KEY }} ``` ```yaml GitLab CI theme={null} variables: FLOWDECK_LICENSE_KEY: $FLOWDECK_LICENSE_KEY ``` ```yaml CircleCI theme={null} environment: FLOWDECK_LICENSE_KEY: $FLOWDECK_LICENSE_KEY ``` ```yaml Bitrise theme={null} envs: - FLOWDECK_LICENSE_KEY: $FLOWDECK_LICENSE_KEY ``` > [!TIP] > > Store your license key as a secret in your CI platform. Never commit license keys to version control. ### Supported CI Platforms FlowDeck automatically detects these CI environments: | Platform | Detection Variable | | - | - | | GitHub Actions | `GITHUB_ACTIONS` | | GitLab CI | `GITLAB_CI` | | CircleCI | `CIRCLECI` | | Jenkins | `JENKINS_URL` | | Travis CI | `TRAVIS` | | Bitrise | `BITRISE_IO` | | Buildkite | `BUILDKITE` | | TeamCity | `TEAMCITY_VERSION` | | Azure Pipelines | `TF_BUILD` | | AWS CodeBuild | `CODEBUILD_BUILD_ID` | | Xcode Cloud | `XCODE_CLOUD` | | Codemagic | `CODEMAGIC` | | Appcircle | `APPCIRCLE` | | Bitbucket Pipelines | `BITBUCKET_BUILD_NUMBER` | | Semaphore CI | `SEMAPHORE` | | Drone CI | `DRONE` | | AppVeyor | `APPVEYOR` | For other CI systems, set `CI=true` along with your license key. ## Installing FlowDeck in CI ### Using the Install Script ```bash theme={null} curl -fsSL https://flowdeck.studio/install.sh | bash ``` ### GitHub Actions Example ```yaml theme={null} name: Build and Test on: push: branches: [main] pull_request: branches: [main] jobs: build: runs-on: macos-14 env: FLOWDECK_LICENSE_KEY: ${{ secrets.FLOWDECK_LICENSE_KEY }} steps: - uses: actions/checkout@v4 - name: Install FlowDeck run: | curl -fsSL https://flowdeck.studio/install.sh | bash echo "$HOME/.local/bin" >> "$GITHUB_PATH" - name: Initialize FlowDeck run: | flowdeck config set -w MyApp.xcworkspace -s MyApp -S "iPhone 16" - name: Build run: flowdeck build --verbose - name: Test run: flowdeck test --streaming ``` ### Alternative: Using Config Files ```yaml theme={null} - name: Build run: flowdeck build --config .flowdeck/ci-config.json --streaming - name: Test run: flowdeck test --config .flowdeck/ci-config.json --streaming ``` ## Configuration File For reproducible CI builds, use a configuration file instead of command-line arguments: ### Create a Config File Create `.flowdeck/ci-config.json` in your repository: ```json theme={null} { "workspace": "MyApp.xcworkspace", "scheme": "MyApp", "configuration": "Release", "platform": "iOS", "version": "18.0", "xcodebuild": { "args": ["-enableCodeCoverage", "YES"], "env": { "CI": "true" } } } ``` ### Use in CI ```bash theme={null} flowdeck build -c .flowdeck/ci-config.json --json flowdeck test -c .flowdeck/ci-config.json --json ``` > [!NOTE] > > These CI examples use the explicit `--config` file format for one complete command invocation. That format is separate from the project settings files at `.flowdeck/config.json` and `.flowdeck/config.local.json`. ### Config File Reference | Field | Type | Required | Description | | - | - | - | - | | `workspace` | string | **Yes** | Path to `.xcworkspace` or `.xcodeproj` | | `scheme` | string | **Yes** | Scheme name to build | | `configuration` | string | No | Build configuration (`Debug`/`Release`). Default: `Debug` | | `platform` | string | No | Target platform: `iOS`, `macOS`, `watchOS`, `tvOS`, `visionOS` | | `version` | string | No | OS version (e.g., `18.0`). Uses latest if not specified | | `simulatorUdid` | string | No | Specific simulator UDID | | `derivedDataPath` | string | No | Custom derived data path (default: `~/Library/Developer/FlowDeck/DerivedData`) | | `xcodebuild` | object | No | Passthrough settings for xcodebuild | | `xcodebuild.args` | array | No | Arguments appended to xcodebuild | | `xcodebuild.env` | object | No | Environment variables for xcodebuild | > [!NOTE] > > See [Xcodebuild Arguments](/cli/xcodebuild-args) for complete passthrough options and [Configuration File](/cli/configuration-file) for all config fields. ## Output Modes ### JSON (Default for CI) Use `--json` for machine-readable output: ```bash theme={null} flowdeck build --config .flowdeck/ci-config.json --json ``` This outputs NDJSON (newline-delimited JSON) events that can be parsed by CI tools: ```json theme={null} {"type":"app_log","level":"info","message":"Build Started"} {"type":"app_log","level":"info","message":"Resolving Packages"} {"type":"app_log","level":"info","message":"Building"} {"type":"result","operation":"build","success":true} ``` ### Streaming (Human-Readable) Use `--streaming` for clean, human-readable output in CI logs. This shows individual pass/fail results grouped by test class, with a summary at the end: ```bash theme={null} flowdeck build --config .flowdeck/ci-config.json --streaming flowdeck test --config .flowdeck/ci-config.json --streaming ``` ### Parsing JSON Results ```bash theme={null} # Check if build succeeded flowdeck build --config .flowdeck/ci-config.json --json | \ jq -s 'last | select(.success == true)' && echo "Build passed" # Extract errors flowdeck build --config .flowdeck/ci-config.json --json | \ jq 'select(.level == "error")' ``` ## Simulator Management in CI ### Boot a Specific Simulator ```bash theme={null} # List available simulators flowdeck simulator list -P iOS -A --json # Boot by name flowdeck simulator boot "iPhone 16" # Boot by UDID (more reliable in CI) flowdeck simulator boot "A1B2C3D4-E5F6-7890-ABCD-EF1234567890" ``` ### Create a Simulator (if needed) ```bash theme={null} flowdeck simulator create -n "CI-iPhone" --device-type "iPhone 16" --runtime "iOS 18.0" ``` ## Best Practices ### 1. Use Config Set or Configuration Files For reproducibility, either use `flowdeck config set` or config files: ```bash theme={null} # Option 1: Save settings once flowdeck config set -w MyApp.xcworkspace -s MyApp -S "iPhone 16" flowdeck build --json # Option 2: Use config file flowdeck build -c .flowdeck/ci-config.json --json ``` ### 2. Choose the Right Output Mode Use `--json` when you need machine-readable output for parsers or dashboards. Use `--streaming` when you want clean, human-readable CI logs: ```bash theme={null} flowdeck build --json # Machine-readable NDJSON events flowdeck test --streaming # Human-readable grouped results ``` ### 3. Specify Simulator by UDID Simulator names can vary across CI runners. Use UDIDs for consistency: ```json theme={null} { "workspace": "MyApp.xcworkspace", "scheme": "MyApp", "simulatorUdid": "A1B2C3D4-E5F6-7890-ABCD-EF1234567890" } ``` Or resolve dynamically: ```bash theme={null} # Get the first available iPhone 16 simulator UDID SIMULATOR_UDID=$(flowdeck simulator list -P iOS --json | \ jq -r '.[] | select(.name | contains("iPhone 16")) | .udid' | head -1) flowdeck config set -w MyApp.xcworkspace -s MyApp -S "$SIMULATOR_UDID" flowdeck build --json ``` ### 4. Clean Before Release Builds ```bash theme={null} flowdeck clean --all flowdeck build -c .flowdeck/release-config.json --json ``` ### 5. Use Derived Data Paths Avoid conflicts with concurrent builds: ```json theme={null} { "workspace": "MyApp.xcworkspace", "scheme": "MyApp", "derivedDataPath": "/tmp/flowdeck-derived-data" } ``` ## Troubleshooting ### "License validation failed" Ensure `FLOWDECK_LICENSE_KEY` is set correctly: ```bash theme={null} # Check if variable is set echo $FLOWDECK_LICENSE_KEY # Verify CI detection flowdeck license status ``` ### "Simulator not found" List available simulators and use exact names or UDIDs: ```bash theme={null} flowdeck simulator list -P iOS -A --json ``` ### Build Timeout Increase timeout for large projects: ```yaml theme={null} # GitHub Actions - name: Build timeout-minutes: 30 run: flowdeck build --config .flowdeck/ci-config.json --json ``` # Activity Source: https://docs.flowdeck.studio/cli/commands/activity Show recent FlowDeck CLI command activity and status `flowdeck activity` reports recent FlowDeck CLI commands run on this machine, including completed records and any currently active command. Use it to inspect what ran, in what order, and whether it succeeded — useful for debugging automation, CI runs, or agent workflows. ```bash theme={null} # Show recent activity (default 20 completed records) flowdeck activity # Include more history flowdeck activity --limit 50 # Read only the latest completed command flowdeck activity --limit 1 --json # JSON output for scripting flowdeck activity --json ``` ## Options | Option | Short | Description | | - | - | - | | `--limit ` | | Maximum number of completed records to include (default: 20) | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | ## What is included * **Completed records:** the most recent finished commands, up to `--limit`. Each record includes the command, its status (success/failure), and timing. * **Active command:** if a FlowDeck CLI command is currently running, it is reported alongside the completed history. > [!NOTE] > > `--limit` affects only the recent completed records. The currently active command (if any) is always included regardless of `--limit`. ## JSON Output `flowdeck activity --json` returns a single JSON object with the active command (if any) and the recent completed records, so it can be parsed by scripts and CI to detect the last command's outcome. # AI Agent Skills Source: https://docs.flowdeck.studio/cli/commands/ai Install and remove FlowDeck skill packs for AI agents `flowdeck ai` installs and removes the FlowDeck skill pack for an AI coding agent. The skill pack teaches the agent how to use FlowDeck's `flowdeck` CLI for Apple-platform build, run, test, simulator, device, log, and UI automation work, so the agent reaches for `flowdeck` commands instead of `xcodebuild`, `simctl`, or `devicectl`. ## flowdeck ai install-skill Install the FlowDeck skill pack for a supported agent. The skill pack version matches the installed FlowDeck CLI version. ```bash theme={null} # Project install (skill lives in this project) flowdeck ai install-skill --agent codex --mode project flowdeck ai install-skill --agent claude --mode project flowdeck ai install-skill --agent gemini --mode project flowdeck ai install-skill --agent pi --mode project # User install (skill available across all projects) flowdeck ai install-skill --agent cursor --mode user flowdeck ai install-skill --agent opencode --mode user flowdeck ai install-skill --agent gemini --mode user flowdeck ai install-skill --agent pi --mode user # JSON output flowdeck ai install-skill --agent claude --mode project --json ``` ### Options | Option | Short | Description | | - | - | - | | `--agent ` | | Agent to install the skill for: `codex`, `claude`, `opencode`, `cursor`, `gemini`, `pi` | | `--mode ` | | Install mode: `user` (across all projects) or `project` (this project only) | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | ### JSON Output With `--json`, `install-skill` reports the agent, mode, installed version, and destination path: ```json theme={null} { "success": true, "agent": "claude", "mode": "project", "version": "1.2.3", "path": "/path/to/skill/destination" } ``` > [!NOTE] > > Restart your AI agent after installing or updating the skill pack so it picks up the new skills. *** ## flowdeck ai uninstall-skill Remove the FlowDeck skill pack for a supported agent. ```bash theme={null} flowdeck ai uninstall-skill --agent claude --mode project flowdeck ai uninstall-skill --agent codex --mode user # JSON output flowdeck ai uninstall-skill --agent claude --mode project --json ``` ### Options | Option | Short | Description | | - | - | - | | `--agent ` | | Agent to uninstall the skill for: `codex`, `claude`, `opencode`, `cursor`, `gemini`, `pi` | | `--mode ` | | Uninstall mode: `user` or `project` (must match how it was installed) | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | ## Supported Agents | Agent | `--agent` value | | - | - | | Codex CLI | `codex` | | Claude Code | `claude` | | OpenCode | `opencode` | | Cursor | `cursor` | | Gemini CLI | `gemini` | | Pi | `pi` | ## Install Modes * **`project`** — installs the skill into the current project so it applies only here. Useful when a project wants a specific FlowDeck workflow pinned to it. * **`user`** — installs the skill into the user's agent configuration so it applies across every project for that agent. # Apps Source: https://docs.flowdeck.studio/cli/commands/apps List apps launched by FlowDeck List apps that were launched by FlowDeck, including their status and identifiers. ```bash theme={null} # List running apps flowdeck apps # Include stopped, crashed, and exited apps flowdeck apps --all # Validate and prune stale entries flowdeck apps --prune # JSON output flowdeck apps --json # Show usage examples flowdeck apps --examples ``` ## Options | Option | Short | Description | | - | - | - | | `--examples` | `-e` | Show usage examples | | `--json` | `-j` | Output JSON/NDJSON events | | `--all` | `-a` | Show all apps, including stopped, crashed, and exited | | `--prune` | | Validate and prune stale entries | ## Status icons Each row in the text output is prefixed with a status icon. The default mode (`flowdeck apps`) only lists running apps, so you'll only see the running icon there. The other icons appear when you pass `--all`. | Icon | Status | Meaning | | - | - | - | | 🟢 | `running` | App process is active | | 🔴 | `stopped` | Terminated via `flowdeck stop` | | 💥 | `crashed` | Process exited unexpectedly | | ⚪ | `exited` | Process exited normally (user closed the app) | | ⏸️ | `waitingForDebugger` | Launched with `--wait-for-debugger`, not yet attached | | ❓ | `unknown` | State could not be determined | ## Registry lifecycle FlowDeck records every app it launches and keeps the entry until the registry is pruned. Stopped, crashed, and exited entries persist so you can still reference them by ID (for example, to fetch logs with `flowdeck logs `). Run `flowdeck apps --prune` to remove non-running entries from the registry. ## JSON Output When `--json` is set, apps emits an NDJSON event with type `app_list`. The payload includes totals and the app list under `data.apps`. # Build Source: https://docs.flowdeck.studio/cli/commands/build Build the project for simulator, device, or macOS Build an Xcode project or workspace for a simulator, a physical device, or macOS. After running `flowdeck config set`, you can call `flowdeck build` with no extra flags. ```bash theme={null} # After config set, build using saved settings flowdeck build # Build for iOS simulator flowdeck build -w MyApp.xcworkspace -s MyApp -S "iPhone 16" # Build for macOS flowdeck build -w MyApp.xcworkspace -s MyApp -D "My Mac" # Build for a physical device flowdeck build -w MyApp.xcworkspace -s MyApp -D "John's iPhone" # Release configuration flowdeck build -C Release # JSON output for automation flowdeck build --json flowdeck build --json --show-warnings # Verbose output (show xcodebuild output) flowdeck build -v # Extra xcodebuild arguments flowdeck build --xcodebuild-options='-quiet' flowdeck build --xcodebuild-env='CI=true' # Load settings from config file flowdeck build --config .flowdeck/ci-config.json # Show usage examples flowdeck build --examples ``` ## Options | Option | Short | Description | | - | - | - | | `--examples` | `-e` | Show usage examples | | `--project ` | `-p` | Project directory | | `--workspace ` | `-w` | Path to workspace (.xcworkspace) or project (.xcodeproj) | | `--scheme ` | `-s` | Scheme name | | `--configuration ` | `-C` | Build configuration (Debug/Release) | | `--simulator ` | `-S` | Simulator name/UDID (use `none` for legacy macOS builds) | | `--device ` | `-D` | Device name/UDID (use "My Mac" or "My Mac Catalyst" for macOS) | | `--derived-data-path ` | `-d` | Derived data path (default: `~/Library/Developer/FlowDeck/DerivedData`) | | `--json` | `-j` | Output JSON/NDJSON events | | `--show-warnings` | | Show compiler warnings (console output in text mode, `diagnostic` events in JSON mode) | | `--verbose` | `-v` | Show build output in console | | `--config ` | `-c` | Load settings from an explicit command config file | | `--xcodebuild-options ` | | Extra xcodebuild arguments | | `--xcodebuild-env ` | | Xcodebuild environment variables | > [!NOTE] > > If both `--simulator` and `--device` are omitted, FlowDeck uses the saved target from `flowdeck config set` or interactive mode. > [!NOTE] > > `--config` here means the explicit command config file format. It is separate from `.flowdeck/config.json` and `.flowdeck/config.local.json`. > [!NOTE] > > On failed builds, FlowDeck prints the extracted failure reason plus the absolute persisted build log path. Read that log before rerunning with `--verbose`. ## JSON Output When `--json` is set, build emits NDJSON events (one JSON object per line). Example: > [!NOTE] > > Compiler errors are always emitted in JSON failure events. Warning diagnostics are opt-in and emitted when `--show-warnings` is set. Warning snapshots are always reconciled and stored under DerivedData (`/Warnings`) on every build. ```json theme={null} {"type":"status","stage":"COMPILING","message":"Compiling sources..."} {"type":"result","success":true,"operation":"build","duration":12.5} ``` On failure, a `build_errors` event lists each error and warning. Items include an optional `language` token (`swift`, `cpp`, `objc`, `objcpp`, `c`, or `metal`) so you can tell which compiler produced each diagnostic. The field is omitted when the language can't be determined — issues with no source file (linker, code signing) or ambiguous files (such as `.h` headers). A grouped multi-target compile error has no single `file` but is still tagged when all of its diagnostics share one language, so `language` can appear without a `file`. Consumers should ignore unknown future values. ```json theme={null} {"type":"build_errors","operation":"build","message":"Build failed with 2 errors","data":{"errors":[{"error_type":"compile","message":"cannot find type 'Foo'","file":"/App/View.swift","line":12,"column":5,"language":"swift"},{"error_type":"compile","message":"use of undeclared identifier","file":"/App/Shader.metal","line":3,"column":1,"language":"metal"}],"error_count":2,"warning_count":0,"log_path":"~/.flowdeck/logs//build.log"}} ``` In text mode the same language appears as a bracket tag on each issue line (for example `✗ [Swift] cannot find type 'Foo'`). # Clean Source: https://docs.flowdeck.studio/cli/commands/clean Clean scheme artifacts, FlowDeck Derived Data, and Xcode cache Use `clean` to remove build artifacts and caches. With no flags, it cleans scheme build artifacts using your saved project settings. ```bash theme={null} # Clean scheme artifacts (after config set) flowdeck clean # Clean FlowDeck/Xcode Derived Data or Xcode cache flowdeck clean --derived-data flowdeck clean --xcode-derived-data flowdeck clean --xcode-cache # Clean everything flowdeck clean --all # Show usage examples flowdeck clean --examples ``` ## Options | Option | Short | Description | | - | - | - | | `--derived-data` | | Delete all FlowDeck Derived Data | | `--xcode-derived-data` | | Delete all Xcode Derived Data | | `--xcode-cache` | | Delete Xcode cache | | `--all` | | Clean scheme artifacts, FlowDeck/Xcode Derived Data, and cache | | `--project ` | `-p` | Project directory | | `--workspace ` | `-w` | Path to workspace (.xcworkspace) or project (.xcodeproj) | | `--scheme ` | `-s` | Scheme name | | `--derived-data-path ` | `-d` | Custom derived data path (default: `~/Library/Developer/FlowDeck/DerivedData`) | | `--config ` | `-c` | Load settings from an explicit command config file | | `--json` | `-j` | Output JSON/NDJSON events | | `--verbose` | `-v` | Show clean output | | `--examples` | `-e` | Show usage examples | ## JSON Output When `--json` is set, clean emits NDJSON events and a final result event. # Config Source: https://docs.flowdeck.studio/cli/commands/config Show, save, and reset project settings for streamlined CLI usage Use `config` to manage saved runtime project selection state (workspace, scheme, target, configuration). > [!NOTE] > > `flowdeck config set` is not the same as editing `.flowdeck/config.json` or `.flowdeck/config.local.json`. The `config` command saves per-project runtime defaults, while the `.flowdeck/config*.json` files are the shared project settings format. ## Read Saved Settings `flowdeck config` shows command help. Use `flowdeck config get` to read saved settings for the current project folder. ```bash theme={null} # Show config command help and subcommands flowdeck config # Read saved config for current folder flowdeck config get # Read from a different project folder flowdeck config get -p /path/to/project # JSON output flowdeck config get --json ``` ## Save Settings Use `flowdeck config set` to store workspace/scheme/target defaults: ```bash theme={null} # iOS Simulator flowdeck config set -w App.xcworkspace -s MyApp -S "iPhone 16" # macOS target flowdeck config set -w App.xcworkspace -s MyApp -D "My Mac" # Physical device flowdeck config set -w App.xcworkspace -s MyApp -D "John's iPhone" # Build configuration flowdeck config set -w App.xcworkspace -s MyApp -S "iPhone 16" -C Release # Overwrite existing config flowdeck config set -w App.xcworkspace -s MyApp -S "iPhone 16" --force # JSON output flowdeck config set -w App.xcworkspace -s MyApp -S "iPhone 16" --json ``` ## Reset Saved Settings Use `flowdeck config reset` to clear saved settings for a project folder: ```bash theme={null} # Clear saved config for current folder flowdeck config reset # Clear saved config for another project folder flowdeck config reset -p /path/to/project # JSON output flowdeck config reset --json ``` ## Options (`config get`) | Option | Short | Description | | - | - | - | | `--project ` | `-p` | Project directory (defaults to current) | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | ## Options (`config set`) | Option | Short | Description | | - | - | - | | `--project ` | `-p` | Project directory (defaults to current) | | `--workspace ` | `-w` | Path to .xcworkspace or .xcodeproj (required) | | `--scheme ` | `-s` | Scheme name | | `--configuration ` | `-C` | Build configuration (Debug/Release) | | `--simulator ` | `-S` | Simulator name or UDID | | `--device ` | `-D` | Device name or UDID (use "My Mac" for macOS) | | `--force` | `-f` | Overwrite an existing saved config | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | ## Options (`config reset`) | Option | Short | Description | | - | - | - | | `--project ` | `-p` | Project directory (defaults to current) | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | ## JSON Output (`config get`) ```json theme={null} { "schema": "flowdeck.config", "schemaVersion": "1.0.0", "success": true, "projectPath": "/path/to/project", "workspace": "/path/to/project/App.xcworkspace", "scheme": "MyApp", "configuration": "Debug", "target": "iPhone 16", "targetType": "simulator", "simulator": { "name": "iPhone 16", "udid": "12345678-1234-1234-1234-123456789012", "platform": "iOS", "os": "iOS 18.0" } } ``` When the saved target is a device (or a virtual macOS target), the response carries a `device` object instead of `simulator`: ```json theme={null} { "schema": "flowdeck.config", "schemaVersion": "1.0.0", "success": true, "projectPath": "/path/to/project", "workspace": "/path/to/project/App.xcworkspace", "scheme": "MyApp", "configuration": "Debug", "target": "My Mac", "targetType": "macOS", "device": { "name": "My Mac", "udid": "00000000-0000-0000-0000-000000000001", "platform": "macOS" } } ``` ## JSON Output (`config set`) ```json theme={null} { "schema": "flowdeck.config", "schemaVersion": "1.0.0", "success": true, "message": "Project configuration saved", "workspace": "App.xcworkspace", "scheme": "MyApp", "target": "iPhone 16", "targetType": "simulator", "configuration": "Debug" } ``` ## JSON Output (`config reset`) ```json theme={null} { "schema": "flowdeck.config", "schemaVersion": "1.0.0", "success": true, "message": "Project configuration reset", "projectPath": "/path/to/project", "cleared": true } ``` # Context Source: https://docs.flowdeck.studio/cli/commands/context Discover workspace, schemes, simulators, and build configs Use `context` to inspect a project and output all available build options. ```bash theme={null} # Show project context (human readable) flowdeck context # JSON output for agents/automation flowdeck context --json # Point to a specific project directory flowdeck context --project /path/to/project ``` ## Options | Option | Short | Description | | - | - | - | | `--project ` | `-p` | Project directory | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | ## JSON Output When the project has a saved workspace selection (via `flowdeck config set`), the top-level fields describe **that** workspace, and `projects[]` lists **every** discovered workspace inside the project root with its own schemes, configurations, and simulators. ```json theme={null} { "schema": "flowdeck.context", "schemaVersion": "1.1.0", "workspace": "iOS/MyApp.xcodeproj", "schemes": [ { "name": "MyApp", "category": "iOS", "platform": "iOS", "defaultConfiguration": "Debug", "actionConfigurations": ["Debug", "Release"], "availableConfigurations": ["Debug", "Release", "Staging"] } ], "buildConfigurations": ["Debug", "Release"], "derivedDataPath": "/Users/you/Library/Developer/FlowDeck/DerivedData/...", "simulators": [ {"name": "iPhone 16", "udid": "...", "platform": "iOS", "osVersion": "18.0", "state": "Shutdown"} ], "projects": [ { "workspace": "iOS/MyApp.xcodeproj", "schemes": [ { "name": "MyApp", "category": "iOS", "platform": "iOS", "defaultConfiguration": "Debug", "actionConfigurations": ["Debug", "Release"], "availableConfigurations": ["Debug", "Release", "Staging"] } ], "buildConfigurations": ["Debug", "Release"], "derivedDataPath": "/Users/you/Library/Developer/FlowDeck/DerivedData/..." }, { "workspace": "test/IntegrationTests.xcodeproj", "schemes": [ { "name": "IntegrationTests", "category": "Tests", "platform": "iOS", "defaultConfiguration": "Debug", "actionConfigurations": ["Debug", "Release"], "availableConfigurations": ["Debug", "Release"] } ], "buildConfigurations": ["Debug", "Release"], "derivedDataPath": "/Users/you/Library/Developer/FlowDeck/DerivedData/..." } ] } ``` When **no** saved workspace exists yet (discovery mode), the top-level `workspace`/`schemes`/`buildConfigurations`/`simulators` fields are absent and the response wraps the per-workspace list with onboarding metadata: ```json theme={null} { "schema": "flowdeck.context", "schemaVersion": "1.1.0", "mode": "discovery", "projectPath": "/path/to/project", "requiresConfiguration": true, "multipleProjectsFound": true, "discoveredCount": 2, "message": "No saved config found. Multiple projects/workspaces were discovered (2)…", "projects": [ { "workspace": "iOS/MyApp.xcodeproj", "schemes": [...], "buildConfigurations": [...], "simulators": [...], "derivedDataPath": "..." }, { "workspace": "test/IntegrationTests.xcodeproj", "schemes": [...], "buildConfigurations": [...], "simulators": [...], "derivedDataPath": "..." } ] } ``` The `projects[]` array is the canonical way to enumerate every workspace and its scheme list in a single call — useful for monorepos that ship multiple `.xcodeproj` / `.xcworkspace` bundles, and for tools (the FlowDeck macOS app, agents) that need to flip between workspaces without making a second CLI roundtrip. The top-level response includes: * `schema`: the output contract identifier, currently `flowdeck.context` * `schemaVersion`: the version for that specific output contract, currently `1.1.0` Each scheme now exposes three configuration views: * `defaultConfiguration`: the scheme's `LaunchAction.buildConfiguration` * `actionConfigurations`: the unique union of config names referenced by the scheme actions * `availableConfigurations`: the ordered configuration list from the primary buildable target's `XCConfigurationList`, which is the closest match to Xcode's Edit Scheme picker # Device Commands Source: https://docs.flowdeck.studio/cli/commands/device Manage physical iOS, iPadOS, watchOS, tvOS, and visionOS devices FlowDeck provides physical device management via USB and WiFi. Alias: `dev`. ## flowdeck device list List connected physical devices (and virtual macOS targets). ```bash theme={null} # List all connected devices flowdeck device list # Filter by platform flowdeck device list -P iOS flowdeck device list --platform iOS # Show only available devices flowdeck device list -A flowdeck device list --available-only # JSON output flowdeck device list --json # Show usage examples flowdeck device list --examples ``` ### Options | Option | Short | Description | | - | - | - | | `--examples` | `-e` | Show usage examples | | `--platform ` | `-P` | Filter by platform: iOS, iPadOS, watchOS, tvOS, visionOS | | `--available-only` | `-A` | Show only available devices | | `--json` | `-j` | Output as JSON | ### JSON Output ```json theme={null} [ { "name": "My Mac", "platform": "macOS", "isAvailable": true, "isVirtual": true, "description": "Build and run as native macOS app" }, { "name": "My Mac Catalyst", "platform": "macOS", "isAvailable": true, "isVirtual": true, "description": "Build and run iOS app via Mac Catalyst" }, { "udid": "00008030-001234567890ABCD", "name": "John's iPhone", "platform": "iOS", "osVersion": "18.1", "deviceType": "iPhone 16 Pro", "connectionType": "USB", "isAvailable": true, "isVirtual": false } ] ``` > [!NOTE] > > Virtual macOS entries (`My Mac`, `My Mac Catalyst`) only carry `name`, `platform`, `isVirtual: true`, `isAvailable`, and `description`. They have no `udid`, `osVersion`, `deviceType`, or `connectionType` — those fields are only present on physical devices. *** ## flowdeck device install Install an app bundle (.app) on a physical device. ```bash theme={null} # Install app on device flowdeck device install /path/to/MyApp.app # Install with verbose output flowdeck device install /path/to/MyApp.app --verbose # Install with JSON output flowdeck device install /path/to/MyApp.app --json ``` ### Options | Option | Short | Description | | - | - | - | | `--verbose` | `-v` | Show command output | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | *** ## flowdeck device uninstall Remove an installed app from a physical device. ```bash theme={null} # Uninstall app from device flowdeck device uninstall com.example.MyApp # Uninstall with verbose output flowdeck device uninstall com.example.MyApp --verbose # Uninstall with JSON output flowdeck device uninstall com.example.MyApp --json ``` ### Options | Option | Short | Description | | - | - | - | | `--verbose` | `-v` | Show command output | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | *** ## flowdeck device launch Launch an installed app on a physical device. ```bash theme={null} # Launch app on device flowdeck device launch com.example.MyApp # Launch with verbose output flowdeck device launch com.example.MyApp --verbose # Launch with JSON output flowdeck device launch com.example.MyApp --json ``` ### Options | Option | Short | Description | | - | - | - | | `--verbose` | `-v` | Show command output | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | > [!TIP] > > Use `flowdeck device list --json` to get device UDIDs. # License Source: https://docs.flowdeck.studio/cli/commands/license Check status, activate, deactivate, validate, start a 14-day trial, or purchase a license Use the `license` command to manage activation. ```bash theme={null} # Show license status flowdeck license status # Activate a license key flowdeck license activate # Deactivate this machine flowdeck license deactivate # Force an immediate server validation flowdeck license validate # Start a 14-day trial flowdeck license trial start --name "Daniel" --email me@example.com # Open the purchase page flowdeck license purchase ``` ## Subcommands | Subcommand | Purpose | | - | - | | `status` | Show license status | | `activate` | Activate a license key on this machine | | `deactivate` | Deactivate this machine | | `validate` | Force an immediate server license validation | | `trial` | Start or verify a 14-day FlowDeck CLI trial | | `purchase` | Open the FlowDeck pricing page in your browser | ## JSON Output `license` subcommands support `--json` (long flag only). Each `license --json` invocation emits a single JSON object (status, activation result, validation outcome, trial pendingId, etc.). ## flowdeck license validate Force an immediate server-side license validation, bypassing the once-per-day cache. Useful when: * You just renewed or extended your license. * You activated on another machine and want to confirm this machine still has a slot. * Cached state seems stale (e.g. status shows "activated" but features are locked). ```bash theme={null} flowdeck license validate flowdeck license validate --json ``` Exits with code `0` when the license is valid, or `1` for invalid / network error / not activated. ## flowdeck license trial Two-step flow to activate a 14-day FlowDeck CLI trial. The license-manager emails you a 6-digit verification code; you confirm it with `trial verify`. ### flowdeck license trial start Request a verification code by name + email. ```bash theme={null} flowdeck license trial start --name "Daniel" --email me@example.com flowdeck license trial start --name "CI" --email ci@example.com --json ``` | Option | Description | | - | - | | `--name ` | Your name | | `--email ` | Email that receives the verification code | | `--no-email` | Dev-only: skip the email send (server returns `devCode` instead) | | `--json` | Output as JSON | Constraints: one trial per email, one trial per machine. The code expires after a few minutes — capture the `pendingId` from the response, then call `verify` with the code from the email. ### flowdeck license trial verify Confirm the OTP and persist the trial license locally. ```bash theme={null} flowdeck license trial verify --pending-id --code 123456 flowdeck license trial verify --pending-id --code 123456 --json ``` | Option | Description | | - | - | | `--pending-id ` | `pendingId` returned by `trial start` | | `--code ` | 6-digit code from the verification email | | `--json` | Output as JSON | On success the trial license (`TRIAL-…` key) is stored just like an activated paid license. Check it with `flowdeck license status`. ## flowdeck license purchase Open the FlowDeck pricing page in your default browser. If the browser cannot be launched (headless / CI / piped output), the URL is printed so it can be copy-pasted. Prefer this over hardcoding the pricing URL in scripts or docs — the URL is owned by the CLI and updated centrally. ```bash theme={null} flowdeck license purchase flowdeck license purchase --json ``` > [!NOTE] > > For CI/CD, set `FLOWDECK_LICENSE_KEY` in the environment and call `flowdeck license activate "$FLOWDECK_LICENSE_KEY"` at the start of the job instead of activating interactively. # Logs Source: https://docs.flowdeck.studio/cli/commands/logs Stream real-time logs from a running app Stream logs for an app launched by FlowDeck. The identifier can be a short ID, full ID, or bundle ID. ```bash theme={null} # Stream logs for an app ID flowdeck logs # Stream logs for a bundle ID flowdeck logs com.example.MyApp # JSON output flowdeck logs --json # Show usage examples flowdeck logs --examples ``` ## Arguments | Argument | Description | | - | - | | `` | App identifier (short ID, full ID, or bundle ID) | ## Options | Option | Short | Description | | - | - | - | | `--json` | `-j` | Output as JSON/NDJSON | | `--examples` | `-e` | Show usage examples | > [!NOTE] > > Logs are supported for simulator, macOS, and physical device launches started by FlowDeck. Physical-device logs are replayed from the FlowDeck-owned device console file. ## JSON Output When `--json` is set, log output is NDJSON (one JSON object per line). # MCP Source: https://docs.flowdeck.studio/cli/commands/mcp Call FlowDeck's active MCP tools from the CLI FlowDeck exposes its user-facing tools as an MCP server. `flowdeck mcp` lets you call those tools directly from the command line, which is how agent hosts that cannot hold a long-lived MCP connection (such as Cursor's direct client) invoke FlowDeck's blocking tools through a single foreground command. ## flowdeck mcp call Call a FlowDeck MCP tool by name and pass its arguments as a JSON object. The tool runs against the same active FlowDeck MCP server the app exposes, and the result is printed to stdout. ```bash theme={null} # Call a tool with no arguments (defaults to {}) flowdeck mcp call flowdeck_worktree_list # Pass arguments as a JSON object flowdeck mcp call flowdeck_update_tasks --json '{"tasks":[{"title":"Ship feature","status":"in_progress"}]}' # Ask the user a question (blocks until they answer) flowdeck mcp call flowdeck_ask_user --json '{"questions":[...]}' # Show usage examples flowdeck mcp call --examples ``` ### Options | Option | Short | Description | | - | - | - | | `` | | FlowDeck MCP tool name, for example `flowdeck_update_tasks` | | `--json ` | | JSON object to pass as the tool arguments (default: `{}`) | | `--examples` | `-e` | Show usage examples | ### When to use it * **Blocking tools:** `flowdeck_ask_user` and `flowdeck_plan` block until the user responds. From agent hosts whose direct MCP client has a short deadline, call them through `flowdeck mcp call --json ''` as a single foreground command so the call can wait for a real human response. * **Task and worktree tools:** `flowdeck_update_tasks`, `flowdeck_worktree_list`, `flowdeck_worktree_create`, and `flowdeck_worktree_delete` can be invoked the same way when a host does not expose them as direct tools. > [!NOTE] > > `flowdeck mcp call` is the required transport for `flowdeck_ask_user` and `flowdeck_plan` from agent hosts that cannot hold a long-lived MCP connection. Do not attempt a direct MCP call for either tool from such hosts. # Command Overview Source: https://docs.flowdeck.studio/cli/commands/overview Complete command and option index for FlowDeck CLI FlowDeck CLI provides commands for building, running, testing, and managing Xcode projects, simulators, and devices. ## Command Structure ```bash theme={null} flowdeck [subcommand] [options] ``` ## Command Index ### Core Actions | Command | Description | | - | - | | `config` | Show or save project settings (workspace, scheme, target, configuration) | | `context` | Inspect workspace, schemes, simulators, and build configs | | `build` | Build for simulator, device, or macOS | | `run` | Build and launch on simulator, device, or macOS | | `test` | Run unit/UI tests | | `test discover` | Discover tests without building | | `test plans` | List test plans referenced by a scheme | | `clean` | Clean scheme artifacts, FlowDeck Derived Data, and Xcode cache | | `logs` | Stream logs for a running app | | `stop` | Stop a running app | | `uninstall` | Uninstall an app from a simulator or device | | `apps` | List apps launched by FlowDeck | | `activity` | Read recent CLI activity and active commands | ### Project Tools | Command | Description | | - | - | | `project create` | Create a new Xcode project from template | | `project schemes` | List schemes | | `project configs` | List build configurations | | `project packages list` | List installed Swift packages | | `project packages add` | Add a package dependency | | `project packages remove` | Remove a package dependency | | `project packages resolve` | Resolve package dependencies | | `project packages update` | Update packages to latest allowed versions | | `project packages clear` | Clear package cache | | `project packages link` | Link package products to a target | | `project packages unlink` | Unlink package products from a target | | `project packages targets` | List project targets with their product types | | `project sync-profiles` | Sync provisioning profiles via build | ### App Store & TestFlight See [Account](/cli/commands/ship/account) and [TestFlight](/cli/commands/ship/testflight). | Command | Description | | - | - | | `ship auth add` | Connect an App Store Connect API key | | `ship auth list` | List connected accounts | | `ship auth use` | Choose which account this project ships with | | `ship auth status` | Show the connected account | | `ship auth remove` | Remove a stored credential | | `ship app list` | List apps this account can reach | | `ship app init` | Register a bundle ID and guide app record creation | | `ship app link` | Link this repository to an app record | | `ship app status` | Where this project stands on the App Store | | `ship build next-version` | Which version a build would attach to | | `ship build next-build-number` | The next unused build number | | `ship build archive` | Archive, sign, and export | | `ship build upload` | Upload an existing archive | | `ship build deliver` | Archive and upload in one step | | `ship build status` | Recent builds and what Apple did with them | | `ship testflight groups list` | List TestFlight groups | | `ship testflight groups create` | Create a group, internal or external | | `ship testflight groups rename` | Rename a group | | `ship testflight groups delete` | Delete an empty group | | `ship testflight groups add-testers` | Add testers to a group | | `ship testflight groups remove-testers` | Remove testers from a group | | `ship testflight testers list` | List testers with groups and usage | | `ship testflight testers add` | Add a tester | | `ship testflight testers invite` | Send the invitation again | | `ship testflight testers remove` | Remove a tester from the app | | `ship testflight distribute` | Send a build to a group | | `ship testflight submit-review` | Submit a build to Beta App Review | | `ship testflight notes` | Write the "What to Test" notes | | `ship testflight expire` | Stop offering a build to testers | | `ship doctor` | Check signing and release readiness | ### Simulators | Command | Description | | - | - | | `simulator list` | List simulators | | `simulator list-apps` | List installed apps on a simulator | | `simulator boot` | Boot a simulator | | `simulator shutdown` | Shut down a simulator | | `simulator open` | Open Simulator.app | | `simulator launch` | Launch an installed app on a booted simulator by bundle ID | | `simulator erase` | Erase simulator data | | `simulator clear-cache` | Clear simulator caches | | `simulator create` | Create a simulator | | `simulator clone` | Clone an existing simulator | | `simulator delete` | Delete a simulator | | `simulator prune` | Delete never-booted, stale, and unavailable simulators | | `simulator rename` | Rename a simulator | | `simulator update` | Upgrade a simulator to a newer runtime in place | | `simulator device-types` | List available device types | | `simulator runtime list` | List installed runtimes | | `simulator runtime available` | List downloadable runtimes | | `simulator runtime install` | Download and install a runtime | | `simulator runtime delete` | Remove a runtime | | `simulator runtime prune` | Delete simulators for a runtime | | `simulator location` | Set or clear simulator location | | `simulator media` | Add media to a simulator | | `simulator record` | Record simulator video | | `simulator frames` | Capture frames as a contact sheet or individual images | | `simulator orientation` | Get or set simulator orientation | | `simulator button` | Press simulator hardware buttons | | `simulator keyboard hardware` | Connect or disconnect the hardware keyboard | | `simulator memory-warning` | Simulate a memory warning | | `simulator ca-debug` | Toggle CoreAnimation debug overlays | | `simulator appearance` | Set simulator light or dark appearance | | `simulator content-size` | Get, set, or reset Dynamic Type (content size category) | | `simulator increase-contrast` | Get, set, or reset the Increase Contrast accessibility setting | | `simulator language` | Get, set, or reset the simulator system language and locale | | `simulator reduce-motion` | Get, set, or reset the Reduce Motion accessibility setting | | `simulator reduce-transparency` | Get, set, or reset the Reduce Transparency accessibility setting | | `simulator show-borders` | Get, set, or reset the Show Borders (button shapes) accessibility setting | | `simulator voiceover` | Get, set, or reset the VoiceOver accessibility setting | | `simulator color-filter` | Get, set, or reset the Color Filter accessibility setting | | `simulator liquid-glass` | Get, set, or reset the Liquid Glass opacity and look and feel | | `simulator audio` | Get, set, or reset the simulator audio output, input, and volume | | `simulator audio devices` | List the host's audio devices available to a simulator | | `simulator status-bar` | Override, clear, or list simulator status bar values | | `simulator push` | Send a simulated push notification from a JSON payload | | `simulator privacy` | Grant, revoke, or reset app privacy permissions | | `simulator pasteboard` | Get, set, or clear the simulator pasteboard | | `simulator keychain` | Reset the simulator keychain or add a certificate | | `simulator pair` | Manage watch+phone simulator pairs (create, delete, list, activate) | | `simulator app` | Inspect an installed app (container path, info) | ### UI Automation Core UI automation commands under `flowdeck ui simulator`: | Command | Description | | - | - | | `ui simulator screen` | Capture screenshot and accessibility tree | | `ui simulator session start` | Start background tree + screenshot capture | | `ui simulator session list` | List active simulator capture sessions | | `ui simulator session stop` | Stop one or all active capture sessions | | `ui simulator find` | Locate elements by label/ID/role | | `ui simulator tap` | Tap elements or coordinates | | `ui simulator double-tap` | Double tap elements or coordinates | | `ui simulator type` | Type into the focused element | | `ui simulator swipe` | Swipe by direction or coordinates | | `ui simulator scroll` | Scroll content (gentler than swipe) | | `ui simulator back` | Navigate back (edge swipe) | | `ui simulator pinch` | Pinch to zoom in/out | | `ui simulator wait` | Wait for an element or state | | `ui simulator assert visible` | Assert element visibility | | `ui simulator assert hidden` | Assert element is hidden | | `ui simulator assert enabled` | Assert element is enabled | | `ui simulator assert disabled` | Assert element is disabled | | `ui simulator assert text` | Assert element text | | `ui simulator erase` | Erase text from focused field | | `ui simulator hide-keyboard` | Hide the on-screen keyboard | | `ui simulator key` | Send keyboard keycodes | | `ui simulator open-url` | Open a URL or deep link | | `ui simulator clear-state` | Clear app data/state | | `ui simulator rotate` | Rotate with a two-finger gesture | | `ui simulator touch down` | Touch down at coordinates | | `ui simulator touch up` | Touch up at coordinates | | `ui simulator batch` | Run a whole UI flow in one invocation (spans screens, auto-scrolls, asserts) | `ui simulator button`, `ui simulator set-appearance`, and `ui simulator orientation` remain as compatibility aliases. Prefer `simulator button`, `simulator appearance`, and `simulator orientation` in new scripts. ### Device Management | Command | Description | | - | - | | `device list` | List connected devices | | `device install` | Install an app on a device | | `device uninstall` | Remove an app from a device | | `device launch` | Launch an app on a device | ### AI Agent Skills | Command | Description | | - | - | | `ai install-skill` | Install FlowDeck skill pack for an AI agent | | `ai uninstall-skill` | Remove FlowDeck skill pack for an AI agent | ### Licensing & Updates | Command | Description | | - | - | | `license status` | Show license status | | `license activate` | Activate a license on this machine | | `license deactivate` | Deactivate this machine | | `license validate` | Force an immediate server license validation | | `license trial` | Start or verify a 14-day FlowDeck CLI trial | | `license purchase` | Open the FlowDeck pricing page in your browser | | `update` | Update FlowDeck CLI | | `mcp call` | Call a FlowDeck MCP tool from the CLI | ### Aliases Hidden aliases are still supported for backward compatibility: | Alias | Command | | - | - | | `sim` | `simulator` | | `dev` | `device` | | `log` | `logs` | | `up` | `update` | ## JSON Output Commands that stream progress (build/run/test/logs/apps/stop/context) output newline-delimited JSON (NDJSON) events when `--json` is set. Snapshot commands such as `status` and `activity` return a single JSON object. Supported mutating commands accept `--dry-run` to preview their operations. With `--json`, previews use the normalized `type: "dry_run"` contract. See [Dry-Run Previews](/cli/dry-run). ## Environment Variables | Variable | Description | | - | - | | `FLOWDECK_LICENSE_KEY` | License key for CI/CD environments | | `DEVELOPER_DIR` | Override Xcode installation path | | `FLOWDECK_NO_UPDATE_CHECK` | Set to `1` to disable update checks | ## Global Flags | Flag | Description | | - | - | | `-i, --interactive` | Launch interactive mode | | `--changelog` | Show release notes | | `--version` | Show CLI version | | `-h, --help` | Show help | # Build Configurations Source: https://docs.flowdeck.studio/cli/commands/project/configs List build configurations List available build configurations (Debug, Release, and any custom configs). ```bash theme={null} # List configurations flowdeck project configs -w App.xcworkspace # List as JSON flowdeck project configs --json # Show usage examples flowdeck project configs --examples ``` ## Options | Option | Short | Description | | - | - | - | | `--examples` | `-e` | Show usage examples | | `--workspace ` | `-w` | Path to workspace (.xcworkspace) or project (.xcodeproj) | | `--project ` | `-p` | Project directory | | `--json` | `-j` | Output as JSON | ## JSON Output ```json theme={null} ["Debug", "Release"] ``` # Create Project Source: https://docs.flowdeck.studio/cli/commands/project/create Create a new SwiftUI-based Xcode project Create a new Xcode project using FlowDeck's built-in SwiftUI template. A single multi-platform app target covers iOS, macOS, tvOS, and visionOS (via XcodeGen `supportedDestinations`), depending on the SDKs installed in Xcode. watchOS is handled separately — see [watchOS apps](#watchos-apps) below. ```bash theme={null} # Create an iOS project in the current directory flowdeck project create MyApp # Create the project in a specific directory flowdeck project create MyApp --path ~/Projects # Create a multi-platform project (iOS, macOS, tvOS, visionOS share one target) flowdeck project create MyApp --platforms ios,macos,visionos # Create a standalone watchOS app flowdeck project create MyWatchApp --platforms watchos # Create an iOS app with an embedded companion watchOS app flowdeck project create MyApp --watch-companion # Set a custom bundle identifier flowdeck project create MyApp --bundle-id com.acme.MyApp # Customize deployment targets flowdeck project create MyApp --ios-target 17.0 --macos-target 14.0 # JSON output for automation flowdeck project create MyApp --json # Preview generated files without writing them flowdeck project create MyApp --dry-run --json ``` ## Arguments | Argument | Description | | - | - | | `` | App name (e.g., `MyApp`) | ## Options | Option | Short | Description | | - | - | - | | `--bundle-id ` | `-b` | Bundle identifier (default: `com.example.`) | | `--platforms ` | | Comma-separated platforms: `ios`, `macos`, `tvos`, `watchos`, `visionos` (default: `ios`) | | `--path ` | `-o` | Output directory (default: current directory) | | `--ios-target ` | | iOS deployment target (default: 26.0) | | `--macos-target ` | | macOS deployment target (default: 26.0) | | `--tvos-target ` | | tvOS deployment target (default: 26.0) | | `--watchos-target ` | | watchOS deployment target (default: 26.0) | | `--visionos-target ` | | visionOS deployment target (default: 26.0) | | `--watch-companion` | | Add an embedded companion watchOS app (requires `ios` in `--platforms`) | | `--dry-run` | | Preview project generation without writing files | | `--json` | `-j` | Output as JSON | ## watchOS apps A watch app is always its own target — Xcode and XcodeGen do not allow `watchos` as a shared multiplatform destination, so it can't be listed alongside the others in `--platforms`. There are two ways to create one: * **Standalone watch app** — pass `--platforms watchos` on its own. Runs on Apple Watch without an iPhone app. Set its deployment target with `--watchos-target`. ```bash theme={null} flowdeck project create MyWatchApp --platforms watchos --watchos-target 11.0 ``` * **Companion watch app** — pass `--watch-companion` alongside an iOS app. This generates the multi-platform app plus a second, embedded `watchOS` target (bundle id `.watchkitapp`) that ships inside the iOS app and auto-installs on the paired Watch. It reuses the app's SwiftUI sources, so the same views build for both. `--watch-companion` requires `ios` in `--platforms` (a companion needs an iPhone host) and honors `--watchos-target`. ```bash theme={null} flowdeck project create MyApp --watch-companion --watchos-target 11.0 flowdeck project create MyApp --platforms ios,macos --watch-companion # multi-platform app + companion watch ``` > [!NOTE] > > Combining `watchos` with other platforms in `--platforms` (e.g. `--platforms ios,watchos`) is rejected. Use `--watch-companion` for a companion, or `--platforms watchos` on its own for a standalone watch app. ## JSON Output ```json theme={null} { "success": true, "projectPath": "/Users/me/Projects/MyApp", "xcodeproj": "/Users/me/Projects/MyApp/MyApp.xcodeproj", "bundleIdentifier": "com.example.MyApp", "platforms": ["iOS"] } ``` With `--watch-companion`, the embedded watch app is reported in `platforms` as `"watchOS (Companion)"` alongside the app's destinations (e.g. `["iOS", "watchOS (Companion)"]`). # Swift Packages Source: https://docs.flowdeck.studio/cli/commands/project/packages Manage Swift Package Manager dependencies Commands for managing Swift Package Manager (SPM) dependencies in your Xcode project. ## flowdeck project packages list List packages (direct and transitive). ```bash theme={null} flowdeck project packages list flowdeck project packages list --json flowdeck project packages list --verbose ``` ### Options | Option | Short | Description | | - | - | - | | `--project ` | `-p` | Project directory | | `--workspace ` | `-w` | Path to workspace or project | | `--json` | `-j` | Output as JSON | | `--verbose` | `-v` | Show detailed output | *** ## flowdeck project packages add Add a package dependency. ```bash theme={null} # Remote package flowdeck project packages add https://github.com/Alamofire/Alamofire.git \ --kind upToNextMajor --value 5.0.0 # Local package flowdeck project packages add ../MyLocalPackage ``` ### Options | Option | Short | Description | | - | - | - | | `--kind ` | `-k` | Version rule type (required for remote packages) | | `--value ` | `-V` | Version/branch/revision (required for remote packages) | | `--project ` | `-p` | Project directory | | `--workspace ` | `-w` | Path to workspace or project | | `--dry-run` | | Preview package addition without modifying the project | | `--json` | `-j` | Output as JSON | | `--verbose` | `-v` | Show detailed output | Supported rule types: `upToNextMajor`, `upToNextMinor`, `exact`, `branch`, `revision`. *** ## flowdeck project packages remove Remove a package dependency by identity or URL. Removal also clears linked products, orphaned local-package objects, shared-scheme test references, and matching targets in shared test plans. ```bash theme={null} flowdeck project packages remove alamofire flowdeck project packages remove https://github.com/Alamofire/Alamofire.git ``` ### Options | Option | Short | Description | | - | - | - | | `--project ` | `-p` | Project directory | | `--workspace ` | `-w` | Path to workspace or project | | `--dry-run` | | Preview removal without modifying the project | | `--json` | `-j` | Output as JSON | | `--verbose` | `-v` | Show detailed output | *** ## flowdeck project packages resolve Resolve package dependencies without updating to newer versions. ```bash theme={null} flowdeck project packages resolve flowdeck project packages resolve --scheme MyApp ``` ### Options | Option | Short | Description | | - | - | - | | `--project ` | `-p` | Project directory | | `--workspace ` | `-w` | Path to workspace or project | | `--scheme ` | `-s` | Scheme name | | `--derived-data-path ` | | Custom derived data path (default: `~/Library/Developer/FlowDeck/DerivedData`) | | `--dry-run` | | Preview package resolution without running it | | `--json` | `-j` | Output as JSON | | `--verbose` | `-v` | Show detailed xcodebuild output | *** ## flowdeck project packages update Update packages (clears cache and re-resolves). ```bash theme={null} flowdeck project packages update flowdeck project packages update --scheme MyApp ``` ### Options | Option | Short | Description | | - | - | - | | `--project ` | `-p` | Project directory | | `--workspace ` | `-w` | Path to workspace or project | | `--scheme ` | `-s` | Scheme name | | `--derived-data-path ` | | Custom derived data path (default: `~/Library/Developer/FlowDeck/DerivedData`) | | `--dry-run` | | Preview the cache clear and package update operations | | `--json` | `-j` | Output as JSON | | `--verbose` | `-v` | Show detailed xcodebuild output | *** ## flowdeck project packages clear Clear the Swift package cache (SourcePackages). ```bash theme={null} flowdeck project packages clear ``` ### Options | Option | Short | Description | | - | - | - | | `--project ` | `-p` | Project directory | | `--workspace ` | `-w` | Path to workspace or project | | `--derived-data-path ` | | Custom derived data path (default: `~/Library/Developer/FlowDeck/DerivedData`) | | `--dry-run` | | Preview cache removal without deleting files | | `--json` | `-j` | Output as JSON | | `--verbose` | `-v` | Show detailed output | *** ## flowdeck project packages link Link package products to a target. ```bash theme={null} flowdeck project packages link https://github.com/apple/swift-collections \ --target MyApp --products Collections,DequeModule ``` The package may be identified by its remote URL or local path: ```bash theme={null} flowdeck project packages link ./Packages/MyFeature \ --target MyApp --products MyFeature ``` ### Options | Option | Short | Description | | - | - | - | | `--target ` | `-t` | Target name to link products to | | `--products ` | | Comma-separated products to link | | `--project ` | `-p` | Project directory | | `--workspace ` | `-w` | Path to workspace or project | | `--dry-run` | | Preview product links without modifying the project | | `--json` | `-j` | Output as JSON | | `--verbose` | `-v` | Show detailed output | *** ## flowdeck project packages unlink Unlink package products from a target. ```bash theme={null} flowdeck project packages unlink https://github.com/apple/swift-collections \ --target MyApp --products DequeModule ``` Local package products use the same path passed to `packages add`: ```bash theme={null} flowdeck project packages unlink ./Packages/MyFeature \ --target MyApp --products MyFeature ``` ### Options | Option | Short | Description | | - | - | - | | `--target ` | `-t` | Target name to unlink products from | | `--products ` | | Comma-separated products to unlink | | `--project ` | `-p` | Project directory | | `--workspace ` | `-w` | Path to workspace or project | | `--dry-run` | | Preview product unlinking without modifying the project | | `--json` | `-j` | Output as JSON | | `--verbose` | `-v` | Show detailed output | *** ## flowdeck project packages targets List project targets with their product types (application, framework, unit-test bundle, etc.). Use this to discover the valid `--target` values for `link` and `unlink`. ```bash theme={null} flowdeck project packages targets flowdeck project packages targets --json ``` ### Options | Option | Short | Description | | - | - | - | | `--project ` | `-p` | Project directory | | `--workspace ` | `-w` | Path to workspace or project | | `--json` | `-j` | Output as JSON | | `--verbose` | `-v` | Show detailed output | # Schemes Source: https://docs.flowdeck.studio/cli/commands/project/schemes List schemes in a workspace or project List all schemes available in a workspace or project. ```bash theme={null} # List schemes in a workspace flowdeck project schemes -w App.xcworkspace # List schemes as JSON flowdeck project schemes -w App.xcworkspace --json # Show usage examples flowdeck project schemes --examples ``` ## Options | Option | Short | Description | | - | - | - | | `--examples` | `-e` | Show usage examples | | `--project ` | `-p` | Project directory | | `--workspace ` | `-w` | Path to workspace (.xcworkspace) or project (.xcodeproj) | | `--json` | `-j` | Output as JSON | ## JSON Output ```json theme={null} [ { "name": "MyApp", "category": "iOS", "isShared": true, "productType": "com.apple.product-type.application", "platform": "auto" }, { "name": "MyPackage", "category": "Packages", "isShared": false, "productType": "com.apple.product-type.library.static", "platform": "macOS" } ] ``` `category` is the platform group the scheme belongs to (`iOS`, `macOS`, `tvOS`, `watchOS`, `visionOS`, or `Packages` for SPM library/test schemes). `platform` is the resolved destination platform for the scheme: app schemes typically report `auto` (xcodebuild picks at build time), while package schemes report the concrete platform (`macOS`, `iOS`, etc.). # Provisioning Profiles Source: https://docs.flowdeck.studio/cli/commands/project/sync-profiles Sync provisioning profiles Sync provisioning profiles by triggering a build with automatic signing. This downloads and updates provisioning profiles from Apple Developer Portal. ```bash theme={null} # Sync provisioning profiles (uses saved state) flowdeck project sync-profiles # Sync with explicit workspace and scheme flowdeck project sync-profiles -w App.xcworkspace -s MyApp # Show detailed build output flowdeck project sync-profiles --verbose ``` ## Options | Option | Short | Description | | - | - | - | | `--project ` | `-p` | Project directory (defaults to current directory) | | `--workspace ` | `-w` | Path to workspace (.xcworkspace) or project (.xcodeproj) | | `--scheme ` | `-s` | Scheme name | | `--verbose` | `-v` | Show detailed xcodebuild output | | `--json` | `-j` | Output as JSON | ## How It Works This command triggers a build with the `-allowProvisioningUpdates` and `-allowProvisioningDeviceRegistration` flags, which allows Xcode to: 1. Download missing provisioning profiles from your Apple Developer account 2. Register new devices if needed 3. Update expired profiles > [!TIP] > > Run this command when you see signing errors related to expired or missing provisioning profiles. ## Use Cases ### Fix Signing Errors ```bash theme={null} # When you see "Provisioning profile not found" errors flowdeck project sync-profiles -w MyApp.xcworkspace -s MyApp ``` ### After Adding New Team Members ```bash theme={null} # Sync profiles after team membership changes flowdeck project sync-profiles --verbose ``` ### CI/CD Setup ```bash theme={null} # Ensure profiles are up-to-date in CI flowdeck project sync-profiles -w MyApp.xcworkspace -s MyApp --json ``` # Run Source: https://docs.flowdeck.studio/cli/commands/run Build and launch an app on a simulator, device, or macOS `run` builds (unless skipped) and launches your app on the selected target. After `flowdeck config set`, you can run without extra flags. ```bash theme={null} # After config set, run with saved settings flowdeck run # Run on a simulator flowdeck run -w MyApp.xcworkspace -s MyApp -S "iPhone 16" # Run on macOS flowdeck run -D "My Mac" # Skip build and launch existing app flowdeck run --no-build # Stream logs after launch flowdeck run --log # Run on the simulator without opening Simulator.app (headless) flowdeck run -S "iPhone 16" --headless # Wait for debugger flowdeck run --wait-for-debugger # Pass launch arguments and env vars flowdeck run --launch-options='-AppleLanguages (en) -SkipOnboarding' flowdeck run --launch-env='DEBUG=1 API_ENV=staging' # Extra xcodebuild options flowdeck run --xcodebuild-options='-quiet' flowdeck run --xcodebuild-env='CI=true' # JSON output flowdeck run --json flowdeck run --json --show-warnings # Show usage examples flowdeck run --examples ``` ## Options | Option | Short | Description | | - | - | - | | `--examples` | `-e` | Show usage examples | | `--project ` | `-p` | Project directory | | `--workspace ` | `-w` | Path to workspace (.xcworkspace) or project (.xcodeproj) | | `--scheme ` | `-s` | Scheme name | | `--configuration ` | `-C` | Build configuration | | `--simulator ` | `-S` | Simulator name/UDID (use `none` for legacy macOS builds) | | `--device ` | `-D` | Device name/UDID (use "My Mac" or "My Mac Catalyst" for macOS) | | `--derived-data-path ` | `-d` | Derived data path (default: `~/Library/Developer/FlowDeck/DerivedData`) | | `--log` | `-l` | Stream logs after launch | | `--wait-for-debugger` | | Wait for debugger to attach before app starts | | `--no-build` | | Skip build step and launch existing app | | `--headless` | | Run on the simulator without opening Simulator.app (simulator targets only) | | `--json` | `-j` | Output JSON/NDJSON events | | `--show-warnings` | | Show compiler warnings (console output in text mode, `diagnostic` events in JSON mode) | | `--verbose` | `-v` | Show app console output | | `--config ` | `-c` | Load settings from an explicit command config file | | `--launch-options ` | | App launch arguments | | `--launch-env ` | | App launch environment variables | | `--xcodebuild-options ` | | Extra xcodebuild arguments | | `--xcodebuild-env ` | | Xcodebuild environment variables | > [!NOTE] > > If both `--simulator` and `--device` are omitted, FlowDeck uses the saved target from `flowdeck config set` or interactive mode. > [!NOTE] > > `--config` here means the explicit command config file format. It is separate from `.flowdeck/config.json` and `.flowdeck/config.local.json`. > [!NOTE] > > Simulator launches open Simulator.app by default using the Simulator bundle from the selected Xcode developer directory. If that selected Xcode does not contain Simulator.app, FlowDeck opens an installed Xcode bundle that does. Pass `--headless` to boot and run the simulator without opening Simulator.app (for example, when another surface renders it). `--headless` is ignored for macOS, Mac Catalyst, and physical-device targets. > [!NOTE] > > Pure Swift Package directories are routed through Xcode's generated `.swiftpm/xcode/package.xcworkspace`, matching Xcode's build path. Package library schemes may still fail at launch time if xcodebuild does not produce an app bundle. > [!NOTE] > > For physical device runs, `flowdeck apps`, `flowdeck logs`, and `flowdeck stop` continue to work as long as the app is running on the device. ## JSON Output When `--json` is set, run emits NDJSON events (one JSON object per line). Example: > [!NOTE] > > Compiler errors are always emitted in JSON failure events. Warning diagnostics are opt-in and emitted when `--show-warnings` is set. Warning snapshots are still reconciled and stored under DerivedData (`/Warnings`) when a build step runs. ```json theme={null} {"type":"status","stage":"LAUNCHING","message":"Launching on iPhone 16"} {"type":"result","success":true,"operation":"run"} ``` # App Store Connect Account Source: https://docs.flowdeck.studio/cli/commands/ship/account Connect an App Store Connect account and link a project to its app record Everything under `flowdeck ship` needs two things: an App Store Connect account FlowDeck can authenticate as, and a repository that knows which app record it belongs to. This page covers both. ```bash theme={null} # Is an account connected, and which one? flowdeck ship auth status # Is this repository linked to an app? flowdeck ship app status ``` Both are read-only and safe to run at any time. Together they answer "can this project ship, and where to". ## One stored credential, and two ways to get one The only credential FlowDeck stores is an **App Store Connect API key**, kept in your login keychain. You can create one yourself in App Store Connect, or mint one through an [Apple Account sign-in](#apple-web-session) — either way, what ends up stored is the same kind of key. That is deliberate. An Apple ID gives away your entire Apple account; an API key is scoped to App Store Connect, revocable on its own, and documented, so it does not break when Apple changes something private. Create one in App Store Connect under **Users and Access › Integrations**, and download the `.p8` file. Apple lets you download it once. ## Connecting an account ```bash theme={null} flowdeck ship auth add \ --key-id ABC123XYZ9 \ --issuer-id 69a6de70-1111-2222-3333-444444444444 \ --private-key ~/Downloads/AuthKey_ABC123XYZ9.p8 \ --name "Personal" ``` | Option | Description | | - | - | | `--key-id` | The Key ID shown beside the key in App Store Connect | | `--issuer-id` | The Issuer ID shown above the key list | | `--private-key` | Path to the downloaded `.p8` | | `--private-key-stdin` | Read the key from standard input instead of a file | | `--name` | A label for this account, so `auth list` is readable | The key is checked against Apple before anything is stored. A key that cannot authenticate, or that lacks permission to read apps, is refused rather than saved for you to discover later. > [!NOTE] > > There is no `--team-id`. An API key belongs to exactly one account, and that > account is exactly one team, so FlowDeck derives the Developer Team ID itself. ## More than one account Credentials are keyed by issuer ID, so a machine can hold as many as you have. ```bash theme={null} # Every connected account flowdeck ship auth list # Record which account this repository ships with flowdeck ship auth use --issuer-id 69a6de70-1111-2222-3333-444444444444 ``` A project names its account explicitly, in `.flowdeck/config.json`. It is never inferred: two accounts can share a team, and the cost of guessing wrong is a build pushed to somebody else's listing. If several accounts are connected and the repository has not chosen one, commands fail with `shipAmbiguousAccount` rather than picking for you. ## Checking an account ```bash theme={null} # Read the stored credential flowdeck ship auth status # Verify it against Apple as well flowdeck ship auth status --verify # JSON, for scripts and agents flowdeck ship auth status --json ``` ```json theme={null} { "signedIn": true, "issuerId": "69a6de70-1111-2222-3333-444444444444", "keyId": "ABC123XYZ9", "name": "Personal", "teamId": "ABCDE12345", "isAdmin": true, "tokenValid": true } ``` `isAdmin` reports whether this key can create app records in App Store Connect, which is an Admin-only action on the web. It is a `Bool?`: **absent means the check could not be made**, not that you lack the permission. ## Removing an account ```bash theme={null} flowdeck ship auth remove --issuer-id 69a6de70-1111-2222-3333-444444444444 ``` This removes the keychain item and nothing else. **The key itself stays live.** A key cannot revoke itself and revocation is not in Apple's public API, so revoke it in App Store Connect under Users and Access › Integrations when you mean to. ## Apple web session A handful of operations — minting a new API key, or creating a new app record automatically — are not exposed by App Store Connect's API at all, only by the same web session the Apple Account website itself uses. `flowdeck ship auth apple` wraps that session for exactly those cases; most `ship` commands never need it. ```bash theme={null} # Sign in and enter the password at the hidden prompt flowdeck ship auth apple login --apple-id you@example.com # Whether a session is live, and for which Apple ID flowdeck ship auth apple status # Clear the session flowdeck ship auth apple logout ``` In an interactive terminal, echo is disabled separately while the password and any two-factor code are read, then restored after each value. If FlowDeck cannot read, change, or restore the terminal settings, it stops with `shipAppleSecureInputUnavailable` instead of accepting visible secret input. Noninteractive callers can provide the password and, when requested, the code as successive lines on stdin. The password is passed to Apple's own sign-in tooling through an environment variable; FlowDeck never logs it, stores it, or returns it in any output or error. Apple stores the resulting session in the Mac's login keychain, the same way signing in through a browser would. If Apple asks for a two-factor code, `login` pauses and prints `{"stage":"AWAIT_2FA"}` on its progress stream under `--json` (a plain sentence in text mode); enter the code at the hidden prompt on the same stdin. ```bash theme={null} flowdeck ship auth apple status --json ``` ```json theme={null} { "ok": true, "signedIn": true, "appleID": "you@example.com" } ``` ### Can this account mint a key? Minting a key requires the **Account Holder or Admin** role. Check first, read-only and offline: ```bash theme={null} flowdeck ship auth apple capabilities --json ``` ```json theme={null} { "ok": true, "roleCheck": "insufficientRole", "canMintKey": false } ``` `roleCheck` is one of three states, not two: `accountHolderOrAdmin`, `insufficientRole`, or `unreadable`. `unreadable` means the response could not be parsed — it is **not** evidence the account lacks the role, only that this could not tell, and it is a normal answer with exit code 0. No session at all is different: it fails with `shipAppleMintKeyNoSession` and a non-zero exit, because there is nothing to ask. ### Minting a key ```bash theme={null} flowdeck ship auth mint-key --name "FlowDeck" --role ADMIN ``` `mint-key` checks the role above **before** creating anything: an `insufficientRole` or `unreadable` account is refused up front rather than failing partway through. On success, the new key is imported the same way `auth add` stores a pasted one, so it appears in `auth list` immediately. > [!WARNING] > > If Apple accepts the create but its response is incomplete, FlowDeck preserves > every `.p8` file it can find and reports the recovery path instead of offering > to retry. Match that file with the key and issuer IDs under Users and Access › > Integrations, then import it with `flowdeck ship auth add`; if they cannot be > matched, revoke the new key before creating another. A later import failure is > also reported as **orphaned** without a retry action, because retrying could > consume another team key slot. ## Linking a project to an app An account can reach many apps. Linking records which one this repository ships to, in a small git-tracked file so the whole team inherits it. ```bash theme={null} # Apps this account can reach flowdeck ship app list # Every connected account's apps at once flowdeck ship app list --all-accounts # Link this repository flowdeck ship app link --bundle-id com.example.myapp ``` Choosing the app is what chooses the account: `--all-accounts` tags each row with its issuer, so you do not have to know which account holds which app before you can pick one. ## Where a project stands ```bash theme={null} flowdeck ship app status --json ``` An unlinked repository answers from local files alone, with no network call: ```json theme={null} { "linked": false } ``` A linked one adds the app record and a row per platform: ```json theme={null} { "linked": true, "appId": "1457476313", "bundleId": "com.example.myapp", "name": "My App", "platforms": [ { "platform": "IOS", "currentVersion": "2.9.1", "liveVersion": "2.9.0" } ] } ``` `currentVersion` is the newest version in any state; `liveVersion` is the newest one on sale. They are equal when nothing new is in flight, and `liveVersion` is absent for a platform that has never shipped. ## When the app record does not exist yet Apple does not allow creating an app record through the public API, for any key. With a live Apple Account session (`--apple-session auto`, the default), `app init` creates the record directly through that session instead. Without one, or when Apple clearly refuses the direct attempt, it falls back to the guided web form, exactly as it always has: ```bash theme={null} flowdeck ship app init --bundle-id com.example.myapp --name "My App" # Skip the session entirely and always use the guided form flowdeck ship app init --bundle-id com.example.myapp --name "My App" --apple-session never ``` The guided path registers the bundle ID through the API, prints the SKU to use, opens the App Store Connect form, then polls until the record appears and links it for you. A missing `--name` always takes this path too, live session or not: inventing one would create a real, permanently-SKU'd record under a name nobody chose. > [!WARNING] > > The guided form waits for a person to fill it in. It is not suitable for CI or > for an unattended agent run. If the direct attempt fails and the guided fallback also gives up waiting, the command reports `shipDirectAppCreateFailed`: the bundle ID is already registered, so nothing is lost, and the fix is `flowdeck ship app link --bundle-id com.example.myapp` once the record exists. An exit-zero create with an unreadable response is different: Apple may have created the record already. FlowDeck polls by bundle ID for a bounded period and links the record if it appears. If it does not, the command reports `shipAppCreateResultAmbiguous` and tells you to check and link the existing record; it never opens or recommends the create form again. Do not run `ship app init` again after this uncertain result. Check App Store Connect, then finish with `flowdeck ship app link --bundle-id com.example.myapp` once the record is visible. ## Next With an account connected and a project linked, see [TestFlight](/cli/commands/ship/testflight) for building, uploading, and getting the build to testers. # TestFlight Source: https://docs.flowdeck.studio/cli/commands/ship/testflight Build, upload, and get a build to TestFlight groups and testers Take a build from source to the people testing it: archive and sign, upload to App Store Connect, then decide who receives it. Everything here needs a connected account and a linked project. See [App Store Connect Account](/cli/commands/ship/account) first. Every subcommand supports `--json`. ## The whole flow ```bash theme={null} flowdeck ship auth status --json # account connected? flowdeck ship app status --json # repo linked? flowdeck ship build next-version --platform ios --json # what will it build against? flowdeck ship doctor --platform ios # will signing work? flowdeck ship build deliver --platform ios # archive, sign, upload flowdeck ship build status --platform ios # did Apple accept it? flowdeck ship testflight groups list # who can receive it? flowdeck ship testflight distribute --platform ios --build 1337 --group "Beta Testers" ``` ## Building and uploading | Command | What it does | | - | - | | `build next-version` | Which version a build would attach to. Read-only. | | `build next-build-number` | The next unused build number for that version. Read-only. | | `build archive` | Archive, sign, and export | | `build upload` | Upload an existing archive | | `build deliver` | Archive and upload in one step | | `build status` | Recent builds and what Apple did with them | ```bash theme={null} flowdeck ship build deliver --platform ios ``` ### Ask which version first ```bash theme={null} flowdeck ship build next-version --platform ios --json ``` ```json theme={null} {"platform":"ios","versionString":"2.9.1","source":"appStoreConnect","needsCreate":false} ``` `needsCreate: true` means every version Apple holds is already live, so there is nothing for a build to attach to. Creating a version record writes to your real account, so it only happens when you ask: ```bash theme={null} flowdeck ship build deliver --platform ios --create-version 2.9.2 ``` ### Check signing before you wait ```bash theme={null} flowdeck ship doctor --platform ios ``` `doctor` reports signing blockers in a second: a missing or expired provisioning profile, a profile that does not cover the bundle ID or belongs to another team, a certificate whose private key is not on this Mac. The same checks run automatically before a manual-signing archive, so a blocker stops the build before `xcodebuild` starts rather than ten minutes in. > [!WARNING] > > `build archive`, `build upload` and `build deliver` are **not safe to retry** > after an uncertain result. Run `flowdeck ship build status` first. A build > number can never be reused. ## Groups A group decides who receives which builds. ```bash theme={null} flowdeck ship testflight groups list flowdeck ship testflight groups create --name "Beta Testers" flowdeck ship testflight groups create --name "Team" --internal flowdeck ship testflight groups rename --group "Beta Testers" --name "Public Beta" flowdeck ship testflight groups delete --group "Old Group" --confirm ``` `--group` accepts a **name or an ID**, everywhere it appears. ### Internal and external | | Internal | External | | - | - | - | | Who can join | App Store Connect team members only | Anyone | | Beta App Review | Skipped | Required before delivery | | Time to first install | Immediate | A day or two | > [!WARNING] > > Internal or external is decided when the group is created and **can never be > changed**. Apple's `isInternalGroup` is create-only, so `--internal` is the one > chance to get it right. `groups create` is the one create command that is **not** safe to retry: Apple allows two groups with the same name, so a second run makes a second group rather than returning the first. ### Deleting Deleting is refused while the group still holds testers: ```json theme={null} { "ok": false, "code": "shipGroupNotEmpty", "message": "\"Public Testers\" still has 9 testers in it." } ``` Empty it first. The testers stay on the app; they lose the builds that group gave them. ## Testers ```bash theme={null} flowdeck ship testflight testers list flowdeck ship testflight testers add --email ada@example.com --first-name Ada --group "Beta Testers" flowdeck ship testflight testers invite --email ada@example.com flowdeck ship testflight testers remove --email ada@example.com --confirm ``` ### Moving testers between groups ```bash theme={null} flowdeck ship testflight groups add-testers --group "Beta Testers" \ --email ada@example.com grace@example.com flowdeck ship testflight groups remove-testers --group "Beta Testers" \ --email ada@example.com ``` > [!NOTE] > > `testers remove` takes somebody off the **app**, revoking every build in every > group they are in. `groups remove-testers` takes them out of **one group** and > leaves the rest. They are different actions. ### What `testers list` returns It is a join, not a plain listing: who each tester is, which groups they are in, and what they have done with the app. ```json theme={null} { "id": "93de929d-3529-40cc-8cbf-18f3b799d9ae", "email": "ada@example.com", "firstName": "Ada", "lastName": "Lovelace", "inviteType": "EMAIL", "state": "INSTALLED", "groups": ["Public Testers"], "sessions": 12, "crashes": 0, "feedback": 1, "devices": null } ``` Two things to know about that shape: * **A count Apple did not report is `null`, not `0`.** "No crashes" and "Apple did not say" are different answers. `devices` is always null, because Apple reports no device count on this endpoint. * **A public-link tester has no `email`.** Apple never collects one. It also means they cannot be invited or added to a group by address. ### Internal groups refuse non-members An internal group only accepts App Store Connect team members, and nothing can check that in advance. Adding a batch therefore sends one request per address and reports Apple's refusal per email: ```json theme={null} { "ok": false, "code": "shipInternalGroupRejectedTester", "message": "App Store Connect would not add contractor@example.com to \"Team\"." } ``` **Everybody else in the batch is still added.** Do not re-run the whole batch; only the named addresses failed. ## Getting the build to testers ```bash theme={null} flowdeck ship testflight distribute --platform ios --build 1337 --group "Beta Testers" ``` Only a build Apple has finished processing (`VALID`) can be distributed. Apple accepts a request for an unprocessed build and then silently does nothing, so FlowDeck refuses it rather than reporting a success that did not happen. Distribution across several groups can be partially applied. Once one group has been updated, a later failure or cancellation exits nonzero rather than reporting success. Under `--json`, FlowDeck prints an error-envelope superset: `ok: false`, bounded `code`, `message`, and `hint` fields, plus the build and group state needed to recover without repeating successful work. `groups` remains the complete list you requested for compatibility. ```json theme={null} { "ok": false, "code": "shipTestFlightDistributionPartial", "message": "TestFlight distribution stopped after some groups were updated.", "hint": "Check TestFlight before retrying only the failed or unattempted groups.", "buildId": "d9c746a0-…", "buildNumber": "1337", "groups": ["Internal", "Public Beta", "Press"], "outcome": "partial", "appliedGroups": ["Internal"], "failedGroups": ["Public Beta"], "pendingGroups": ["Press"], "failureReason": "App Store Connect was temporarily unavailable.", "confirmed": false } ``` `outcome` is `complete` or `partial`. A complete result exits zero, `appliedGroups` contains every requested group, `failedGroups` and `pendingGroups` are empty, and `failureReason` is null. If the operation is cancelled after updating `Internal`, the cancellation also exits nonzero with `code: "shipTestFlightDistributionCancelled"`. The interrupted group was not established as failed, so it stays pending with all groups that follow it: ```json theme={null} { "ok": false, "code": "shipTestFlightDistributionCancelled", "message": "TestFlight distribution was cancelled after some groups were updated.", "hint": "Check TestFlight before retrying only the failed or unattempted groups.", "buildId": "d9c746a0-…", "buildNumber": "1337", "groups": ["Internal", "Public Beta", "Press"], "outcome": "partial", "appliedGroups": ["Internal"], "failedGroups": [], "pendingGroups": ["Public Beta", "Press"], "failureReason": "The TestFlight distribution was cancelled.", "confirmed": false } ``` `failureReason` is not raw Apple, network, transport, or decoder output. It is the normalized message from FlowDeck's typed error mapping, with whitespace collapsed and the result capped at 240 characters. Partial and cancellation text output names the groups applied, the failed group when there is one, and every pending group. It then tells you to check TestFlight before retrying only the failed or unattempted groups; do not re-run the whole group list. ### Beta App Review An external group receives nothing until review passes. Write the tester notes first, because Apple gates the submission on them: ```bash theme={null} flowdeck ship testflight notes --platform ios --build 1337 \ --whats-new "New onboarding. Check the first-run flow." flowdeck ship testflight submit-review --platform ios --build 1337 --notify ``` `--notify` sets Apple's "Automatically notify testers" so testers are emailed when the build lands. Internal groups never wait for review. If people need the build today and review has not passed, an internal group is the answer. ### Expiring a build ```bash theme={null} flowdeck ship testflight expire --build 1337 ``` Expiring is not deleting. The build stays on the record and stops being installable. An uploaded build can never be deleted, and its build number can never be reused. ## Idempotency | Safe to retry | Not safe after an uncertain result | | - | - | | every `list`, every `status`, `build next-version`, `build next-build-number`, `testers add`, `testers invite`, `groups rename`, `groups add-testers`, `doctor` | `build archive`, `build upload`, `build deliver`, `distribute`, `expire`, `submit-review`, `groups create`, `groups delete`, `groups remove-testers`, `testers remove` | Anything in the second column may already have taken effect when it failed or timed out. Check with the matching `list` or `status` command before running it again. ## Errors Every failure carries a stable `code`, one sentence saying what happened, and a hint saying what to do: ```json theme={null} { "ok": false, "code": "shipBuildNotProcessed", "message": "Build 1337 is PROCESSING, not VALID, so it cannot be distributed yet.", "hint": "Wait for Apple to finish processing it, then run this again." } ``` | Code | Meaning | | - | - | | `shipNotSignedIn` | No account connected. See [Account](/cli/commands/ship/account). | | `shipAmbiguousAccount` | Several accounts connected, none chosen for this project | | `shipNoLinkedApp` | This repository is not linked to an app record | | `shipBuildNotProcessed` | Apple has not finished processing the build | | `shipGroupNotFound` | No group by that name or ID | | `shipGroupNotEmpty` | The group still holds testers | | `shipInternalGroupRejectedTester` | An address is not on the App Store Connect team | # Frames Source: https://docs.flowdeck.studio/cli/commands/simulator/frames Capture simulator frames as a contact sheet or individual images Capture simulator frames with `simulator frames` — either a single **contact-sheet PNG** (default) or **individual full-resolution images** (`--images`). It records a short video, then either tiles every sampled frame (scaled to 30%, with a timestamp under each cell) into one PNG, or writes one full-resolution PNG per frame into a folder. Ideal for validating an animation — for example driving the simulator from the home screen into an app. ```bash theme={null} # Show usage examples flowdeck simulator frames --examples ``` ## Contact sheet (default) ```bash theme={null} # 3 seconds, 5 fps, 4 columns → one PNG on ~/Desktop flowdeck simulator frames # Denser sampling flowdeck simulator frames --duration 2s --fps 10 # Wider grid, specific simulator flowdeck simulator frames --columns 6 -S "iPhone 16" ``` ## Individual images (`--images`) ```bash theme={null} # Full-resolution PNG per frame, written into a folder flowdeck simulator frames --images --duration 2s --fps 12 --output ~/Desktop ``` ## Options | Option | Short | Description | | - | - | - | | `--output ` | `-o` | Output folder (default `~/Desktop`); names are generated automatically | | `--simulator ` | `-S` | Simulator name or UDID (defaults to the booted simulator) | | `--duration ` | `-t` | Recording duration, e.g. `2s` (default `3s`) | | `--fps ` | | Frames per second to sample (default 5) | | `--columns ` | | Grid columns in the contact sheet (default 4) | | `--images` | | Output full-resolution images (one PNG per frame) instead of a contact sheet | | `--display ` | | Display to capture when multiple are attached: `internal` or `external` | | `--json` | `-j` | Output as JSON (includes `mode` and `frame_count`) | | `--verbose` | `-v` | Show detailed output | | `--examples` | `-e` | Show usage examples | > [!NOTE] > > `--output` is a folder. The contact sheet scales frames to 30% of native size; `--images` writes them at full resolution. # Hardware and Appearance Source: https://docs.flowdeck.studio/cli/commands/simulator/hardware Press simulator hardware buttons, toggle the hardware keyboard, and switch light or dark appearance Use simulator hardware commands for device-level controls that are not tied to a specific app UI. ## flowdeck simulator button Press a simulator hardware button. ```bash theme={null} flowdeck simulator button home flowdeck simulator button swipe-home flowdeck simulator button app-switcher flowdeck simulator button lock --hold 2.0 flowdeck simulator button side-button --hold 1.0 flowdeck simulator button siri --simulator "iPhone 16" flowdeck simulator button home --json ``` ### Button Options | Option | Short | Description | | - | - | - | | `--simulator ` | `-S` | Target simulator name or UDID | | `--hold ` | | Hold the button for a duration | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | ### Supported Buttons * `home` * `swipe-home` * `lock` * `siri` * `applepay` * `app-switcher` * `side-button` * `volumeup` * `volumedown` > [!NOTE] > > Volume buttons may not be supported by the simulator HID backend on every runtime. ## flowdeck simulator memory-warning Simulate a memory warning, matching Simulator.app's **Debug > Simulate Memory Warning** action. ```bash theme={null} flowdeck simulator memory-warning flowdeck simulator memory-warning --simulator "iPhone 16" flowdeck simulator memory-warning --json ``` ### Memory Warning Options | Option | Short | Description | | - | - | - | | `--simulator ` | `-S` | Target simulator name or UDID | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | ## flowdeck simulator ca-debug Toggle CoreAnimation debug overlays on a simulator. ```bash theme={null} flowdeck simulator ca-debug blended on flowdeck simulator ca-debug offscreen off --simulator "iPhone 16" flowdeck simulator ca-debug slow-animations on --json ``` ### CoreAnimation Debug Options | Option | Short | Description | | - | - | - | | `--simulator ` | `-S` | Target simulator name or UDID | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | ### CoreAnimation Debug Values * `blended` * `copies` * `misaligned` * `offscreen` * `slow-animations` State accepts `on` or `off`. ## flowdeck simulator appearance Get or set the simulator appearance (light or dark). Mirrors `flowdeck simulator orientation`: `get` is the default subcommand, `set` writes a value. ```bash theme={null} flowdeck simulator appearance # Print booted simulator appearance flowdeck simulator appearance get # Same as above flowdeck simulator appearance set light flowdeck simulator appearance set dark --simulator "iPhone 16" flowdeck simulator appearance set dark --json flowdeck simulator appearance get --json ``` ### flowdeck simulator appearance get Print the current appearance for the targeted simulator. Outputs one of `light`, `dark`, `unsupported`, or `unknown` (passed through from `simctl ui ... appearance`). | Option | Short | Description | | - | - | - | | `--simulator ` | `-S` | Target simulator name or UDID | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | ### flowdeck simulator appearance set Set the appearance to `light` or `dark`. | Option | Short | Description | | - | - | - | | `--simulator ` | `-S` | Target simulator name or UDID | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | ### Supported Values * `light` * `dark` > [!NOTE] > > Older `flowdeck ui simulator button`, `flowdeck ui simulator set-appearance` (also accepts `appearance` as an alias), and `flowdeck ui simulator orientation` commands still work for compatibility, but new scripts should use `flowdeck simulator ...`. ## flowdeck simulator keyboard Control simulator keyboard settings. Currently exposes the hardware keyboard subcommand, which connects or disconnects the simulated hardware keyboard. This mirrors Simulator.app's **I/O > Keyboard > Connect Hardware Keyboard** toggle and is equivalent to `simctl ui keyboard` operations. ```bash theme={null} # Connect the hardware keyboard flowdeck simulator keyboard hardware on # Disconnect the hardware keyboard (shows the software keyboard on focus) flowdeck simulator keyboard hardware off # Target a specific simulator flowdeck simulator keyboard hardware off --simulator "iPhone 16" # JSON output flowdeck simulator keyboard hardware on --json ``` ### flowdeck simulator keyboard hardware Connect or disconnect the simulator hardware keyboard. The state argument accepts `on`/`off`, `enabled`/`disabled`, `true`/`false`, `1`/`0`, or `connected`/`disconnected`. | Option | Short | Description | | - | - | - | | `` | | Keyboard state: `on`/`off` (or `enabled`/`disabled`, `true`/`false`) | | `--simulator ` | `-S` | Target simulator name or UDID | | `--json` | `-j` | Output as JSON | | `--dry-run` | | Preview the keyboard state change without changing the simulator | | `--examples` | `-e` | Show usage examples | ### JSON Output With `--json`, `simulator keyboard hardware` reports the requested state and resolved UDID: ```json theme={null} { "success": true, "type": "simulator_keyboard_hardware", "enabled": true, "udid": "12345678-1234-1234-1234-123456789ABC" } ``` > [!NOTE] > > Disconnecting the hardware keyboard (`off`) forces the software keyboard to appear when a text field gains focus — useful for testing keyboard UI and text-entry flows. Connect it back (`on`) to type via the host keyboard. # Lifecycle Source: https://docs.flowdeck.studio/cli/commands/simulator/lifecycle Boot, shutdown, and open simulators Commands for controlling simulator state. ## flowdeck simulator boot Boot a simulator so it is ready to run apps. The argument accepts either a simulator UDID or a simulator name (matched against `flowdeck simulator list`). ```bash theme={null} # Boot by name flowdeck simulator boot "iPhone 16" # Boot by UDID flowdeck simulator boot 12345678-1234-1234-1234-123456789ABC # Boot with verbose output flowdeck simulator boot "iPhone 16" --verbose # Boot with JSON output flowdeck simulator boot "iPhone 16" --json ``` ### Options | Option | Short | Description | | - | - | - | | `--verbose` | `-v` | Show command output | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | *** ## flowdeck simulator shutdown Shutdown a running simulator. The argument accepts either a simulator UDID or a simulator name. ```bash theme={null} # Shutdown by name flowdeck simulator shutdown "iPhone 16" # Shutdown by UDID flowdeck simulator shutdown 12345678-1234-1234-1234-123456789ABC # Shutdown with verbose output flowdeck simulator shutdown "iPhone 16" --verbose # Shutdown with JSON output flowdeck simulator shutdown "iPhone 16" --json ``` ### Options | Option | Short | Description | | - | - | - | | `--verbose` | `-v` | Show command output | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | *** ## flowdeck simulator open Open Simulator.app. ```bash theme={null} flowdeck simulator open flowdeck simulator open --json ``` ### Options | Option | Short | Description | | - | - | - | | `--verbose` | `-v` | Show command output | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | *** ## flowdeck simulator launch Launch an already-installed app on a booted simulator by bundle identifier. Useful for opening system apps (such as Calendar or Contacts) or any app that is already installed on the simulator, without going through `flowdeck run`. The simulator must be booted first. ```bash theme={null} # Launch the iOS Calendar app on the booted simulator flowdeck simulator launch com.apple.mobilecal # Target a specific simulator by name flowdeck simulator launch com.apple.mobilecal -S "iPhone 16" # Target a specific simulator by UDID flowdeck simulator launch com.apple.MobileAddressBook -S 12345678-1234-1234-1234-123456789ABC # JSON output (reports the launched pid) flowdeck simulator launch com.apple.mobilecal --json ``` ### Options | Option | Short | Description | | - | - | - | | `--simulator ` | `-S` | Target simulator name or UDID (defaults to the booted simulator) | | `--verbose` | `-v` | Show command output | | `--json` | `-j` | Output as JSON | | `--dry-run` | | Preview the `simctl launch` command without starting the app | | `--examples` | `-e` | Show usage examples | ### JSON Output With `--json`, `simulator launch` reports the bundle identifier, resolved UDID, and the launched process id: ```json theme={null} { "success": true, "type": "simulator_launch", "bundle_id": "com.apple.mobilecal", "udid": "12345678-1234-1234-1234-123456789ABC", "pid": 4321 } ``` > [!NOTE] > > `simulator launch` only starts apps that are already installed on the simulator. To build, install, and launch your own app in one step, use `flowdeck run` instead. # Listing Source: https://docs.flowdeck.studio/cli/commands/simulator/list List available simulators List available simulators, grouped by platform and OS version. ```bash theme={null} # List all simulators flowdeck simulator list # Filter by platform flowdeck simulator list -P iOS flowdeck simulator list --platform iOS # Show only available simulators flowdeck simulator list -A flowdeck simulator list --available-only # JSON output flowdeck simulator list --json # Show usage examples flowdeck simulator list --examples ``` ## Options | Option | Short | Description | | - | - | - | | `--examples` | `-e` | Show usage examples | | `--platform ` | `-P` | Filter by platform (iOS, tvOS, watchOS, visionOS) | | `--available-only` | `-A` | Show only available simulators | | `--json` | `-j` | Output as JSON | ## JSON Output ```json theme={null} [ { "udid": "12345678-1234-1234-1234-123456789ABC", "name": "iPhone 16 Pro", "platform": "iOS", "osVersion": "18.0", "state": "Shutdown", "isAvailable": true, "lastBootedAt": 800955104, "deviceTypeIdentifier": "com.apple.CoreSimulator.SimDeviceType.iPhone-16-Pro", "runtimeIdentifier": "com.apple.CoreSimulator.SimRuntime.iOS-18-0" } ] ``` `state` is one of `Booted`, `Shutdown`, or `Creating`. `lastBootedAt` is a Mach absolute timestamp (seconds since boot) and is omitted for simulators that have never been booted. # Location Source: https://docs.flowdeck.studio/cli/commands/simulator/location Set or clear the simulator location Set or clear a simulated GPS location with the `simulator location` group. ```bash theme={null} # Show group examples flowdeck simulator location --examples ``` ## flowdeck simulator location set Set simulator location coordinates. ```bash theme={null} # Set location on the booted simulator flowdeck simulator location set 37.7749,-122.4194 # Target a specific simulator flowdeck simulator location set 37.7749,-122.4194 --udid # JSON output flowdeck simulator location set 37.7749,-122.4194 --json # Show usage examples flowdeck simulator location set 37.7749,-122.4194 --examples ``` ### Options | Option | Short | Description | | - | - | - | | `--udid ` | `-u` | Target simulator UDID (defaults to first booted simulator) | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | > [!NOTE] > > Coordinates must be in `latitude,longitude` format. *** ## flowdeck simulator location clear Clear a simulated location override (the inverse of `set`). ```bash theme={null} # Clear the override on the booted simulator flowdeck simulator location clear # Target a specific simulator flowdeck simulator location clear --udid # JSON output flowdeck simulator location clear --json ``` ### Options | Option | Short | Description | | - | - | - | | `--udid ` | `-u` | Target simulator UDID (defaults to first booted simulator) | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | # Management Source: https://docs.flowdeck.studio/cli/commands/simulator/management Create, clone, rename, delete, and maintain simulators Commands for creating, cloning, renaming, deleting, and maintaining simulators. ## flowdeck simulator create Create a new simulator with a device type and runtime. ```bash theme={null} flowdeck simulator create -n "My iPhone 16" --device-type "iPhone 16 Pro" --runtime "iOS 18.1" ``` ### Options | Option | Short | Description | | - | - | - | | `--name ` | `-n` | Name for the new simulator (required) | | `--device-type ` | | Device type (required) | | `--runtime ` | | Runtime (required) | | `--verbose` | `-v` | Show command output | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | *** ## flowdeck simulator clone Clone an existing simulator, duplicating its settings and installed apps. ```bash theme={null} flowdeck simulator clone "iPhone 16 Pro" -n "iPhone 16 Pro Copy" flowdeck simulator clone A7D19B36-1234-5678-ABCD-123456789ABC -n "My Clone" ``` ### Arguments | Argument | Description | | - | - | | `` | Source simulator UDID or name | ### Options | Option | Short | Description | | - | - | - | | `--name ` | `-n` | Name for the cloned simulator (required) | | `--verbose` | `-v` | Show command output | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | *** ## flowdeck simulator rename Rename an existing simulator. The UDID stays the same; only the display name changes. Successful renames emit a simulator catalog-change wakeup so app destination pickers refresh. ```bash theme={null} # Rename by current name flowdeck simulator rename "iPhone 16" "My CI Device" # Rename by UDID flowdeck simulator rename A7D19B36-1234-5678-ABCD-123456789ABC "My iPhone" # JSON output flowdeck simulator rename "iPhone 16" "My CI Device" --json # Inline examples flowdeck simulator rename --examples ``` ### Arguments | Argument | Description | | - | - | | `` | Current simulator UDID or name | | `` | New display name | ### Options | Option | Short | Description | | - | - | - | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | ### JSON Output ```json theme={null} { "success": true, "type": "simulator_rename", "udid": "A7D19B36-1234-5678-ABCD-123456789ABC", "name": "My CI Device" } ``` *** ## flowdeck simulator delete Delete a simulator by UDID or name. The identifier argument is optional when `--unavailable` is used to bulk-delete every unavailable simulator at once. ```bash theme={null} flowdeck simulator delete flowdeck simulator delete "iPhone 16" flowdeck simulator delete --unavailable ``` ### Options | Option | Short | Description | | - | - | - | | `--unavailable` | | Delete all unavailable simulators (identifier optional) | | `--verbose` | `-v` | Show command output | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | *** ## flowdeck simulator prune Delete simulators that have never been booted, have not been booted in 90+ days, or are unavailable. ```bash theme={null} flowdeck simulator prune --dry-run flowdeck simulator prune ``` ### Options | Option | Short | Description | | - | - | - | | `--dry-run` | | Show what would be deleted without deleting | | `--verbose` | `-v` | Show verbose output | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | *** ## flowdeck simulator erase Erase all content and settings from a simulator. ```bash theme={null} flowdeck simulator erase flowdeck simulator erase --json ``` ### Options | Option | Short | Description | | - | - | - | | `--verbose` | `-v` | Show command output | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | > [!NOTE] > > If the target simulator is booted, FlowDeck shuts it down, erases it, and boots it again automatically. *** ## flowdeck simulator clear-cache Clear simulator caches. ```bash theme={null} flowdeck simulator clear-cache flowdeck simulator clear-cache --verbose flowdeck simulator clear-cache --json ``` ### Options | Option | Short | Description | | - | - | - | | `--verbose` | `-v` | Show command output | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | *** ## flowdeck simulator device-types List available simulator device types. ```bash theme={null} flowdeck simulator device-types flowdeck simulator device-types --json ``` ### Options | Option | Short | Description | | - | - | - | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | # Media Source: https://docs.flowdeck.studio/cli/commands/simulator/media Add media to a simulator Add images or videos to a simulator with `simulator media add`. ```bash theme={null} # Show group examples flowdeck simulator media --examples # Add media to the booted simulator flowdeck simulator media add /path/to/photo.jpg # Target a specific simulator flowdeck simulator media add /path/to/video.mov --udid # JSON output flowdeck simulator media add /path/to/photo.jpg --json # Show usage examples flowdeck simulator media add /path/to/photo.jpg --examples ``` ## Options | Option | Short | Description | | - | - | - | | `--udid ` | `-u` | Target simulator UDID (defaults to first booted simulator) | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | # Orientation Source: https://docs.flowdeck.studio/cli/commands/simulator/orientation Get or set simulator orientation Read or change the physical orientation of an iOS simulator. ## flowdeck simulator orientation `flowdeck simulator orientation` defaults to `get`. ```bash theme={null} # Read the current orientation from the current booted simulator flowdeck simulator orientation # Explicit get subcommand flowdeck simulator orientation get # Target a specific simulator flowdeck simulator orientation get --simulator "iPhone 16" # JSON output flowdeck simulator orientation get --json # Usage examples flowdeck simulator orientation --examples flowdeck simulator orientation get --examples ``` ### Get Options | Option | Short | Description | | - | - | - | | `--simulator ` | `-S` | Target simulator name or UDID | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | ### Get JSON Output ```json theme={null} { "schema": "flowdeck.simulator", "schemaVersion": "1.0.0", "success": true, "type": "orientation_get", "orientation": "landscape-left", "udid": "12345678-1234-1234-1234-123456789ABC" } ``` > [!NOTE] > > If you omit `--simulator`, FlowDeck targets the current booted simulator. If no simulator is booted, the command fails. *** ## flowdeck simulator orientation set Set the simulator orientation. By default, FlowDeck verifies the physical orientation and, when available, the visible orientation. ```bash theme={null} flowdeck simulator orientation set portrait --simulator "iPhone 16" flowdeck simulator orientation set landscape-left --simulator "iPhone 16" flowdeck simulator orientation set landscape-right --simulator "iPhone 16" flowdeck simulator orientation set portrait-upside-down --simulator "FlowDeck-Diag-iPad" # JSON output flowdeck simulator orientation set landscape-left --simulator "iPhone 16" --json # Return immediately after sending the rotation event flowdeck simulator orientation set landscape-left --simulator "iPhone 16" --no-wait # Usage examples flowdeck simulator orientation set portrait --examples ``` ### Set Options | Option | Short | Description | | - | - | - | | `--simulator ` | `-S` | Target simulator name or UDID | | `--json` | `-j` | Output as JSON | | `--no-wait` | | Return after sending the rotation event without waiting for visual confirmation | | `--examples` | `-e` | Show usage examples | ### Supported Values * `portrait` * `landscape-left` * `landscape-right` * `portrait-upside-down` ### Set JSON Output ```json theme={null} { "schema": "flowdeck.simulator", "schemaVersion": "1.0.0", "success": true, "confirmed": true, "type": "orientation_set", "orientation": "landscape-left", "udid": "12345678-1234-1234-1234-123456789ABC" } ``` `confirmed` reports whether the orientation was actually verified against the simulator's physical and visual state. It is `true` when both are verified, and always `false` with `--no-wait`. On Duo, the default wait verifies physical orientation through the native motion stream, so `success` reflects that readback while `confirmed` remains `false` and `visualOrientation` is `unknown`. With `--no-wait`, Duo returns dispatch success and the requested orientation. Other modern simulators return the actual orientation acknowledged by the guest; a locked device can reject the requested rotation. > [!NOTE] > > The default wait returns the verified physical orientation. The front-most app can constrain its visible orientation, which is reported separately when available. > [!NOTE] > > With `--no-wait`, FlowDeck does not wait for visual confirmation. Unsupported values, including `portrait-upside-down` on ordinary iPhone simulators, are still rejected before the event is sent. > [!WARNING] > > `portrait-upside-down` is supported on Duo and iPad simulators. Ordinary iPhone simulators reject it. # Pose Source: https://docs.flowdeck.studio/cli/commands/simulator/pose Get or set an iPhone Duo simulator pose. `flowdeck simulator pose` has explicit `get` and `set` operations for an iPhone Duo simulator running through Xcode 27.1 or later. ## Set the pose Pass a named state or any finite angle from 0° through 180°: ```bash theme={null} flowdeck simulator pose set closed --simulator "iPhone Duo" flowdeck simulator pose set partially-folded --simulator "iPhone Duo" flowdeck simulator pose set open --simulator "iPhone Duo" flowdeck simulator pose set angle 90 --simulator "iPhone Duo" # Preview a mutation without changing the simulator flowdeck simulator pose set angle 45 --dry-run # Emit the pose_set JSON result flowdeck simulator pose set angle 130 --json ``` | Value | Hinge angle | | - | -: | | `closed` | 0° | | `partially-folded` | 130° | | `open` | 180° | | `angle <0...180>` | Exact numeric angle | ## Get the pose Read one normalized physical sample, or add `--stream` to keep receiving samples until you press Control-C: ```bash theme={null} flowdeck simulator pose get --simulator "iPhone Duo" flowdeck simulator pose get -S "iPhone Duo" --stream --interval 0.25 --change-threshold 2 flowdeck simulator pose get --stream --json ``` `--json` emits one `simulator_duo_pose` NDJSON object per normalized sample. The monitor reports CoreDevice's independent physical hinge feed; it does not acknowledge pose mutations. FlowDeck waits for the owned CoreDevice stream to shut down before the command exits. ## Options | Option | Short | Applies to | Description | | - | - | - | - | | `--simulator ` | `-S` | All values | Target simulator name or UDID | | `--json` | `-j` | `get`, `set` | Emit JSON for one result or NDJSON with `get --stream` | | `--dry-run` | | `set` | Preview the operation without changing the simulator | | `--stream` | | `get` | Continue emitting samples until interrupted | | `--interval ` | | `get --stream` | Set the positive sampling interval; default `0.1` | | `--change-threshold ` | | `get --stream` | Emit changes meeting this non-negative threshold | | `--examples` | `-e` | `get`, `set` | Show usage examples | ## Requirements and errors The selected target must use the exact iPhone Duo device identifier. A regular simulator fails before transport with `The selected simulator is not an iPhone Duo.` The selected Xcode must be 27.1 or later. No legacy command aliases are provided. Use `flowdeck simulator pose` for every pose operation. Existing [`flowdeck simulator orientation`](/cli/commands/simulator/orientation) commands remain the rotation control. The Xcode 27.1 monitor parser accepts only its pinned labeled hinge record. It rejects malformed, duplicate, unknown, overflowing, or non-finite fields and never writes raw Apple output to stdout. Schema drift ends the monitor instead of restarting an incompatible process indefinitely. # Record Source: https://docs.flowdeck.studio/cli/commands/simulator/record Record a simulator video Record a simulator video with `simulator record`. Without `--duration` it records until you press `Ctrl+C`. ```bash theme={null} # Show usage examples flowdeck simulator record --examples # Record until Ctrl+C, save to ~/Desktop flowdeck simulator record # Record a fixed 10 seconds flowdeck simulator record --duration 10s # HEVC encoding, choose the output folder, target a simulator flowdeck simulator record --duration 5s --codec hevc --output ~/Movies -S "iPhone 16" ``` ## Options | Option | Short | Description | | - | - | - | | `--output ` | `-o` | Output folder (default `~/Desktop`); the filename is generated automatically | | `--simulator ` | `-S` | Simulator name or UDID (defaults to the booted simulator) | | `--duration ` | `-t` | Recording duration, e.g. `10s` (default: until `Ctrl+C`) | | `--codec ` | | Video codec: `h264` or `hevc` | | `--display ` | | Display to capture when multiple are attached: `internal` or `external` | | `--json` | `-j` | Output as JSON | | `--verbose` | `-v` | Show detailed output | | `--examples` | `-e` | Show usage examples | > [!NOTE] > > `--output` is a folder, not a file. For a per-frame contact sheet (animation validation), use [`frames`](/cli/commands/simulator/frames). # Runtimes Source: https://docs.flowdeck.studio/cli/commands/simulator/runtimes Manage installed simulator runtimes Runtimes are the platform images (iOS, tvOS, watchOS, visionOS) used by simulators. ```bash theme={null} # Show runtime command examples flowdeck simulator runtime --examples ``` ## flowdeck simulator runtime list List installed runtimes. ```bash theme={null} flowdeck simulator runtime list flowdeck simulator runtime list --json ``` ### Options | Option | Short | Description | | - | - | - | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | *** ## flowdeck simulator runtime available List downloadable runtimes from Apple. ```bash theme={null} flowdeck simulator runtime available flowdeck simulator runtime available --platform iOS flowdeck simulator runtime available --json flowdeck simulator runtime available --examples ``` ### Options | Option | Short | Description | | - | - | - | | `--platform ` | `-P` | Filter by platform (iOS, tvOS, watchOS, visionOS) | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | ### What is listed Apple's index is a historical catalogue of every runtime ever published; most of it is no longer served. By default this command lists only what this Mac can actually install, which means three cuts: * **Pre-release seeds.** Apple stops serving a beta as soon as the next one lands, so an older seed answers `xcodebuild` with "not available for download". * **Older OS generations.** Only the current generation and the one before it are served. Under Xcode 27 that is iOS 26 and 27; iOS 18.6 fails even though the index lists it. * **Legacy `package` runtimes and images this macOS cannot run**, from the index's own `contentType` and `hostRequirements`. Apple publishes each build twice, a universal image and a native-only one, and `xcodebuild` resolves the variant itself — so one row is shown per build, for the image that will actually download. Pass `--all` to see the unfiltered catalogue. *** ## flowdeck simulator runtime install Download and install a runtime. Also available as `flowdeck simulator runtime create` (the two are aliases for the same command). ```bash theme={null} flowdeck simulator runtime install iOS 18.1 flowdeck simulator runtime install iOS --prune flowdeck simulator runtime create iOS 18.1 # Same as 'install' ``` ### Options | Option | Short | Description | | - | - | - | | `--build` | | Exact build to install, when several share the version | | `--verbose` | `-v` | Show command output | | `--prune` | | Remove auto-created simulators after install | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | One marketing version ships as several builds — iOS 26.5 exists as beta, beta 2, Release Candidate and release. Without `--build`, install resolves the version against Apple's index and takes the first match, which may not be the build you meant: ```bash theme={null} flowdeck simulator runtime available --json # read the build strings flowdeck simulator runtime install iOS 26.5 --build 23F77 ``` *** ## flowdeck simulator runtime delete Remove an installed runtime. ```bash theme={null} flowdeck simulator runtime delete "iOS 17.2" ``` Several builds of one OS version share a runtime identifier — three iOS 27.0 betas do — so without `--build` you are naming a **group**, and the resolver picks whichever build `simctl` lists first. Pass `--build` to remove an exact one: ```bash theme={null} flowdeck simulator runtime list --json # read the build strings flowdeck simulator runtime delete com.apple.CoreSimulator.SimRuntime.iOS-27-0 --build 24A5390f ``` ### Options | Option | Short | Description | | - | - | - | | `--build` | | Exact build to remove, when several share one identifier | | `--verbose` | `-v` | Show command output | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | *** ## flowdeck simulator runtime prune Delete simulators for a runtime. ```bash theme={null} flowdeck simulator runtime prune "iOS 18.0" ``` ### Options | Option | Short | Description | | - | - | - | | `--verbose` | `-v` | Show deleted simulator UDIDs | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | *** ## flowdeck simulator update Upgrade an existing simulator to a newer runtime in place. The target runtime must already be installed (see `runtime install`). ```bash theme={null} flowdeck simulator update "iOS 18.4" flowdeck simulator update "iOS 18.4" -S "iPhone 16" flowdeck simulator update com.apple.CoreSimulator.SimRuntime.iOS-18-4 --json ``` ### Options | Option | Short | Description | | - | - | - | | `--simulator ` | `-S` | Simulator name or UDID (defaults to the booted simulator) | | `--verbose` | `-v` | Show command output | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | # Stop Source: https://docs.flowdeck.studio/cli/commands/stop Stop a running app launched by FlowDeck Use `stop` to terminate a running app by its FlowDeck ID or bundle ID. ```bash theme={null} # Stop a specific app flowdeck stop # Stop by bundle ID flowdeck stop com.example.MyApp # Stop all running apps flowdeck stop --all # Force kill flowdeck stop --force # Show usage examples flowdeck stop --examples ``` ## Arguments | Argument | Description | | - | - | | `` | App identifier (short ID, full ID, or bundle ID) | ## Options | Option | Short | Description | | - | - | - | | `--all` | `-a` | Stop all running apps | | `--force` | `-f` | Force kill (SIGKILL instead of SIGTERM) | | `--json` | `-j` | Output JSON/NDJSON events | | `--examples` | `-e` | Show usage examples | ## JSON Output When `--json` is set, stop emits NDJSON events for single-app and batch stops. # Test Commands Source: https://docs.flowdeck.studio/cli/commands/test Run and discover unit and UI tests ## flowdeck test Run unit and UI tests. ```bash theme={null} # After 'flowdeck config set', run tests with saved settings flowdeck test # Explicitly keep Simulator.app closed during simulator tests flowdeck test --headless # Run all tests (without config set) flowdeck test -w MyApp.xcworkspace -s MyScheme -S "iPhone 16" # Run tests on macOS flowdeck test -D "My Mac" # Run specific tests with --only flowdeck test --only MyTests/LoginTests flowdeck test --only MyTests/LoginTests/testLogin flowdeck test --only "MyTests/Login Tests/test Login Success" # Skip specific tests flowdeck test --skip MyTests/SlowTests flowdeck test --skip MyTests/IntegrationTests # Multiple test targets flowdeck test --test-targets "UnitTests,IntegrationTests" # Run a specific test plan (name or path) flowdeck test --plan "Smoke" flowdeck test --plan "TestPlans/Smoke.xctestplan" flowdeck test --plan "Smoke" --only MyTests/LoginTests # Output modes flowdeck test # Summary only (default) flowdeck test -v # Detailed output with exact test verdict markers flowdeck test --progress # Show pass/fail as tests complete flowdeck test --streaming # Clean output for file capture flowdeck test --json # JSON for CI/automation # Pass arguments to xcodebuild flowdeck test --xcodebuild-options='-parallel-testing-enabled YES' flowdeck test --xcodebuild-options='-enableCodeCoverage YES' flowdeck test --xcodebuild-options='-resultBundlePath /tmp/results.xcresult' flowdeck test --xcodebuild-env='CI=true' # Show usage examples flowdeck test --examples ``` ### Options | Option | Short | Description | | - | - | - | | `--examples` | | Show usage examples | | `--project ` | `-p` | Project directory | | `--workspace ` | `-w` | Path to workspace (.xcworkspace) or project (.xcodeproj) | | `--scheme ` | `-s` | Scheme name | | `--configuration ` | `-C` | Build configuration (Debug/Release) | | `--simulator ` | `-S` | Simulator name/UDID (REQUIRED for iOS/tvOS/watchOS) | | `--device ` | `-D` | Device name/UDID (use "My Mac" for macOS) | | `--derived-data-path ` | `-d` | Derived data path (default: `~/Library/Developer/FlowDeck/DerivedData`) | | `--config ` | `-c` | Path to an explicit command config file | | `--test-targets ` | | Specific test targets to run (comma-separated) | | `--test-cases ` | | Specific test cases to run (comma-separated, format: TargetName/ClassName/testMethod) | | `--only ` | | Run only specific tests (suite methods: TargetName/ClassName/testMethod; top-level Swift Testing: TargetName/function()) | | `--skip ` | | Skip specific tests (format: TargetName/ClassName or TargetName/ClassName/testMethod) | | `--plan ` | | Test plan name or .xctestplan path | | `--json` | `-j` | Output as JSON | | `--verbose` | `-v` | Show detailed xcodebuild output with exact raw test verdict markers | | `--progress` | | Show test results as they complete (pass/fail per test) | | `--streaming` | | Stream clean formatted test results (no escape codes, for file capture) | | `--headless` | | Explicitly keep Simulator.app closed during simulator tests; ignored for macOS and physical-device targets | | `--xcodebuild-options ` | | Extra xcodebuild arguments (e.g., `--xcodebuild-options='-parallel-testing-enabled YES'`) | | `--xcodebuild-env ` | | Xcodebuild environment variables (e.g., 'CI=true') | > [!NOTE] > > After running `flowdeck config set`, workspace, scheme, and simulator are saved to project state. > CLI parameters are only required if you haven't run `flowdeck config set`, or to override saved values. > Use `--device "My Mac"` for macOS builds. > [!NOTE] > > `--config` here means the explicit command config file format. It is separate from `.flowdeck/config.json` and `.flowdeck/config.local.json`. > [!NOTE] > > On failed test runs, FlowDeck prints the extracted failure reason plus `Full log: ` for the persisted raw xcodebuild output. Read that file directly before rerunning with `--verbose`. > [!NOTE] > > Simulator tests already execute without opening Simulator.app. `--headless` makes that intent explicit for app-hosted and agent workflows while preserving the same execution behavior. The flag is ignored for macOS and physical-device targets. ### Finalized Result Bundles Every real run waits for xcodebuild to finish and saves one finalized test bundle at `~/.flowdeck/logs//test.xcresult`. The build-for-testing phase uses a separate FlowDeck diagnostics bundle, so the two phases never compete for the same `-resultBundlePath`. To choose the test bundle path, pass `-resultBundlePath` through `--xcodebuild-options`. If more than one value is present across config and CLI sources, the final value wins. FlowDeck removes duplicate forms and applies the selected path only to `test-without-building`. `--verbose` prints stable terminal markers: `** TEST SUCCEEDED **`, `** TEST FAILED **`, or `** TEST EXECUTE FAILED **`. A nonzero xcodebuild status, including 65, always produces a failed command. ### Test Filtering The `--only` option supports multiple formats: * **Full path**: `MyAppTests/LoginTests/testValidLogin` - runs a specific test method * **Top-level Swift Testing function**: `MyAppTests/topLevelTest()` - omits the synthetic discovery class * **Class name**: `LoginTests` - runs all tests in that class * **Method name**: `testValidLogin` - runs all tests with that method name (across classes) You can specify multiple tests by using `--only` multiple times or separating with commas. When `--plan` is combined with `--only` or `--test-cases`, FlowDeck resolves the filter against that plan's enabled and selected tests. Exclusions in other plans do not affect the run. Without `--plan`, discovery follows the scheme's default test plan. If the selected plan is not attached to the scheme, its file is missing, or its contents cannot be read, FlowDeck stops before running tests and suggests `flowdeck test plans` to inspect the scheme's available plans. ### Config File Format The `--config` parameter accepts the explicit command config format: ```json theme={null} { "workspace": "MyApp.xcworkspace", "scheme": "MyApp", "configuration": "Debug", "platform": "iOS", "version": "18.0", "derivedDataPath": "/custom/path" } ``` For macOS builds, set `platform` to `"macOS"` (no simulator needed). ### JSON Output When using `--json`, the command outputs newline-delimited JSON events during execution, followed by a final test result: ```json theme={null} {"type":"status","stage":"COMPILING","message":"Building for testing..."} {"type":"status","stage":"TESTING","message":"Running tests on iPhone 16..."} {"type":"test_started","data":{"testId":"LoginTests/testValidLogin"}} {"type":"test_passed","data":{"testId":"LoginTests/testValidLogin","duration":0.023}} {"type":"test_failed","data":{"testId":"LoginTests/testInvalidLogin","duration":0.045,"failure_message":"XCTAssertEqual failed","file_name":"LoginTests.swift","line_number":42}} {"schema":"flowdeck.test","schemaVersion":"1.1.0","success":false,"totalTests":2,"passedTests":1,"failedTests":1,"skippedTests":0,"resultBundlePath":"/Users/me/.flowdeck/logs/abc123/test.xcresult"} ``` **Event Types:** | Type | Description | | - | - | | `status` | Progress updates with `stage` and `message` | | `test_started` | Test execution started with `data.testId` | | `test_passed` | Test passed with `data.testId` and `data.duration` | | `test_failed` | Test failed with `data.testId`, duration, message, file, and line details | | `test_skipped` | Test skipped with `data.testId` and optional reason | | Final snapshot | Top-level `flowdeck.test` result with authoritative counts, `success`, and optional `resultBundlePath` | **Final Result (Success):** ```json theme={null} { "schema": "flowdeck.test", "schemaVersion": "1.1.0", "success": true, "totalTests": 42, "passedTests": 42, "failedTests": 0, "skippedTests": 0, "duration": 12.5, "passedTestNames": ["LoginTests/testValidLogin", "..."], "skippedTestNames": [], "failures": [], "resultBundlePath": "/Users/me/.flowdeck/logs/abc123/test.xcresult" } ``` **Final Result (Failure):** ```json theme={null} { "schema": "flowdeck.test", "schemaVersion": "1.1.0", "success": false, "totalTests": 42, "passedTests": 40, "failedTests": 2, "skippedTests": 0, "duration": 15.3, "passedTestNames": ["..."], "skippedTestNames": [], "failures": [ { "testName": "LoginTests/testInvalidLogin", "reason": "XCTAssertEqual failed: (\"expected\") is not equal to (\"actual\")", "fileName": "LoginTests.swift", "lineNumber": 42, "duration": 0.045 } ], "resultBundlePath": "/Users/me/.flowdeck/logs/abc123/test.xcresult" } ``` ## flowdeck test discover Discover all available tests in a project by parsing test source files. This uses static source analysis (like Xcode's Test Navigator) and does not require building the project. ```bash theme={null} # After 'flowdeck config set', discover tests with saved settings flowdeck test discover # Discover tests (without config set) flowdeck test discover -w MyApp.xcworkspace -s MyScheme # Output as JSON (for tooling) flowdeck test discover --json # Filter tests by name flowdeck test discover --filter Login flowdeck test discover -F Login # Apply a specific test plan's selections and skips flowdeck test discover --plan Smoke # Include tests that are skipped in the scheme or test plan flowdeck test discover --include-skipped-tests ``` ### Options | Option | Short | Description | | - | - | - | | `--project ` | `-p` | Project directory | | `--workspace ` | `-w` | Path to workspace (.xcworkspace) or project (.xcodeproj) (also accepts `--ws`) | | `--scheme ` | `-s` | Scheme name (also accepts `--sch`) | | `--config ` | `-c` | Path to an explicit command config file (also accepts `--cfg`) | | `--filter ` | `-F` | Filter tests by name (case-insensitive) | | `--plan ` | | Test plan name or .xctestplan path | | `--json` | `-j` | Output as JSON | | `--include-skipped-tests` | | Include tests that are skipped in the scheme or test plan (marked as skipped) | | `--examples` | `-e` | Show usage examples | > [!NOTE] > > Test discovery uses static source parsing and doesn't require building. It finds `XCTestCase` subclasses, `test*` methods, `@Suite` structs, and `@Test` functions directly from source files. By default, tests that are disabled in the scheme's default plan (or the plan selected with `--plan`) are excluded from results. Use `--include-skipped-tests` to include excluded and unselected tests with `isSkipped: true`. > [!NOTE] > > If `--plan` appears on both `flowdeck test` and `flowdeck test discover`, the > value after `discover` takes precedence. Missing, unavailable, or malformed > plans fail discovery and point to `flowdeck test plans`. ### JSON Output ```json theme={null} { "schema": "flowdeck.test", "schemaVersion": "1.1.0", "tests": [ { "target": "MyAppTests", "class": "LoginTests", "method": "testValidLogin", "identifier": "MyAppTests/LoginTests/testValidLogin", "file": "LoginTests.swift", "filePath": "/path/to/LoginTests.swift", "lineNumber": 15, "isSkipped": false } ] } ``` *** ## flowdeck test plans List test plans referenced by a scheme. This reads the scheme file and does not build the project. ```bash theme={null} # After 'flowdeck config set', list plans with saved settings flowdeck test plans # List plans (without config set) flowdeck test plans -w MyApp.xcworkspace -s MyScheme # Output as JSON (for tooling) flowdeck test plans --json ``` ### Options | Option | Short | Description | | - | - | - | | `--project ` | `-p` | Project directory | | `--workspace ` | `-w` | Path to workspace (.xcworkspace) or project (.xcodeproj) (also accepts `--ws`) | | `--scheme ` | `-s` | Scheme name (also accepts `--sch`) | | `--config ` | `-c` | Path to an explicit command config file (also accepts `--cfg`) | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | ### JSON Output ```json theme={null} { "schema": "flowdeck.test", "schemaVersion": "1.1.0", "plans": [ { "name": "Smoke", "reference": "container:App/TestPlans/Smoke.xctestplan", "path": "/path/to/App/TestPlans/Smoke.xctestplan", "isDefault": true, "isMissing": false } ] } ``` # UI Automation Source: https://docs.flowdeck.studio/cli/commands/ui/automation Automate simulator interactions with FlowDeck's UI automation commands 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: * `-S, --simulator` to target a specific simulator by **name or UDID**. Recommended when multiple simulators are booted. Examples: `-S "iPhone 16"` or `-S "A1B2C3D4-..."`. * For AI agent workflows, always pass `-S` explicitly on every `flowdeck ui simulator ...` command. * If `-S` 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 | Command | Purpose | Key Options | | - | - | - | | `ui simulator screen` | Screenshot + accessibility tree | `--tree`, `--optimize`, `--output` | | `ui simulator session start` | Start background tree + screenshot capture | `-S`, `--interval-ms`, `--retention-seconds` | | `ui simulator session list` | List active capture sessions | `--json` | | `ui simulator session stop` | Stop one or all active capture sessions | `-S`, `--all` | ## Query | Command | Purpose | Key Options | | - | - | - | | `ui simulator find` | Locate elements by label/ID/role | `--by-id`, `--by-role`, `--contains` | ## Interaction | Command | Purpose | Key Options | | - | - | - | | `ui simulator tap` | Tap element or coordinates | `--point`, `--duration`, `--by-id`, `--no-screen` | | `ui simulator double-tap` | Double tap element or coordinates | `--point`, `--by-id`, `--no-screen` | | `ui simulator type` | Type into focused field | `--clear`, `--mask`, `--no-screen` | | `ui simulator swipe` | Swipe by direction or coordinates | `--from`, `--to`, `--duration`, `--distance`, `--no-screen` | | `ui simulator scroll` | Scroll content (gentler than swipe) | `--direction`, `--speed`, `--distance`, `--until`, `--timeout`, `--no-screen` | | `ui simulator pinch` | Pinch to zoom in/out | `in`/`out`, `--scale`, `--point`, `--duration` | | `ui simulator rotate` | Rotate with a two-finger gesture | ``, `--point`, `--radius`, `--duration` | | `ui simulator back` | Navigate back (edge swipe) | | | `ui simulator batch` | Run a whole UI flow in one invocation | `--steps`, `--file`, `--interactive-elements` | ## Wait and Assert | Command | Purpose | Key Options | | - | - | - | | `ui simulator wait` | Wait for element state | `--timeout`, `--poll`, `--gone`, `--enabled`, `--stable` | | `ui simulator assert visible` | Assert element is visible | `--by-id` | | `ui simulator assert hidden` | Assert element is hidden | `--by-id` | | `ui simulator assert enabled` | Assert element is enabled | `--by-id` | | `ui simulator assert disabled` | Assert element is disabled | `--by-id` | | `ui simulator assert text` | Assert element text | `--expected`, `--contains`, `--by-id` | ## Input and Keyboard | Command | Purpose | Key Options | | - | - | - | | `ui simulator erase` | Erase text from focused field | `--characters` | | `ui simulator hide-keyboard` | Hide the on-screen keyboard | | | `ui simulator key` | Send keyboard keycodes | `--sequence`, `--hold` | ## App Control | Command | Purpose | Key Options | | - | - | - | | `ui simulator open-url` | Open a URL or deep link | | | `ui simulator clear-state` | Clear app data/state | | ## Simulator Hardware Aliases Simulator hardware and device-state controls are canonical under `flowdeck simulator`. | Canonical Command | Compatibility Alias | Purpose | | - | - | - | | `simulator button` | `ui simulator button` | Press hardware buttons | | `simulator appearance` | `ui simulator set-appearance` | Set light or dark mode | | `simulator orientation` | `ui simulator orientation` | Get or set orientation | ## Advanced | Command | Purpose | Key Options | | - | - | - | | `ui simulator touch down` | Touch down at coordinates | `x,y`, `-S` | | `ui simulator touch up` | Touch up at coordinates | `x,y`, `-S` | ## Batch Flows `ui simulator batch` runs a whole UI flow in a single invocation. It spans screens (label/id targets are re-found on the current screen), auto-scrolls to off-screen targets, and verifies values inline with `assert` — so navigation, input, and verification become one call with no per-action round-trips and no intermediate screenshots. It returns the final accessibility tree (or only the interactive elements with `--interactive-elements`). ```bash theme={null} flowdeck ui simulator batch --steps '[ {"action":"tap","target":"settings_button","by_id":true}, {"action":"tap","target":"Reduce transparency"}, {"action":"tap","target":"Done"}, {"action":"tap","target":"Search"}, {"action":"type","text":"London"}, {"action":"tap","target":"London, England"}, {"action":"assert","text":"11°"}, {"action":"tap","target":"Precipitation"}, {"action":"assert","text":"10.7 mm"} ]' -S "iPhone 16" --json ``` Steps can also be loaded from a file with `--file path/to/steps.json`. ### Batch Options | Option | Short | Description | | - | - | - | | `--steps ` | | JSON array of action steps | | `--file ` | `-f` | Path to a JSON file of action steps | | `--simulator ` | `-S` | Target simulator name or UDID | | `--interactive-elements` | | Return only interactive elements in the final snapshot instead of the full tree | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | ### Step Actions | Action | Fields | Notes | | - | - | - | | `tap` / `double_tap` | `target` (+ `by_id`), or `point` (`"x,y"`) | Off-screen targets are auto-scrolled into view | | `type` | `text` (+ `clear`) | Types into the focused field | | `swipe` / `scroll` | `direction` (+ `distance`) | `scroll` defaults to roughly one viewport | | `wait` | `target` (+ `condition`, `timeout_ms`, `by_id`) | Waits for an element state | | `key` | `keycode` | Sends a HID keycode | | `assert` | `text` (+ `condition`) | Verifies `text` is visible; `condition: "absent"` asserts it is NOT present (auto-scrolls to find) | The batch stops at the first failing step. The JSON response includes a `steps[]` array with per-step `success`/`error` and a `final` snapshot of the screen after the last step. > [!NOTE] > > `batch` is the most efficient way to drive a multi-step flow from an agent: one call replaces many `tap`/`type`/`screen` round-trips, and inline `assert` steps verify state without screenshots. ## 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 * **Always pass `-S `** on `session start` and `session stop` to target a specific simulator. Accepts a simulator name (e.g., `"iPhone 16"`) or raw UDID. This is required when multiple simulators are booted and recommended in all automation workflows. * `session start` captures the accessibility tree and checks a persistent simulator framebuffer every 500ms by default. It writes to `~/.flowdeck/automation/sessions//` (the short ID is the first 8 characters of the session UUID). * Starting a session stops and replaces only an existing session for the same simulator. Sessions for other simulators keep running concurrently. * `--interval-ms` and `--retention-seconds` tune capture frequency and retention (default 60s). Retention always keeps at least one capture. * The framebuffer backend skips pixel copying, JPEG encoding, and image writes while its version is unchanged. Entries are written only when the tree or screenshot body changes, and screenshots are stored at 50% JPEG quality. Screenshot change detection ignores the volatile top system/status strip, so Dynamic Island/status-bar churn does not keep rewriting idle frames; saved screenshots are not cropped or masked. * FlowDeck automatically falls back to the legacy screenshot backend if the private framebuffer interface cannot attach or fails during the session. It prints one warning and keeps that backend for the rest of the session; no manual flag is required. * `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, the UDID, and the current screen size in points (`screen`). Key fields you can parse: * `session_id` — full UUID of the session * `session_short_id` — first 8 characters of the UUID (matches the directory name) * `session_dir` — absolute path to the session's data directory * `latest_screenshot` — absolute path to the rolling `latest.jpg` file * `latest_tree` — absolute path to the rolling `latest-tree.json` file * `capture_backend` — `framebuffer` normally, or `legacy_screenshot` after automatic fallback * `capture_warning` — present only during fallback, with `reason`, `message`, and `timestamp_ms` * `screens_dir`, `trees_dir`, `root`, `udid`, `interval_ms`, `retention_seconds`, `pid`, `owner_pid`, `screen` * `session list --json` reports every active session, including `udid`, recorder `pid`, `owner_pid`, `age_seconds`, and the live `capture_backend`/`capture_warning` state. * Session commands skip malformed active pointer files and reconcile stale pointers for dead recorders, abandoned pending starts, and sessions from a previous system boot, so `list`, `stop`, and `stop --all` remain usable for recovery. * `session stop` without `-S` stops the sole active session. If multiple sessions are active, pass `-S ` to stop one or `--all` to stop every active session. JSON output includes the stopped session UDID(s). * Sessions also end automatically if the simulator disappears or if the owner process that started the session exits. Set `FLOWDECK_OWNER_PID` to bind a session to a specific owner process. ### Find, Tap, and Double-Tap > [!WARNING] > > `--by-id`, `--by-role`, and `--contains` are **mutually exclusive lookup modes**. Pass at most one. The default (none) is an **exact label match**. Only `--contains` can be combined with the default to do substring matching against labels. * Default (no flag): exact label match. * `--by-id`: matches accessibility identifiers instead of labels. * `--by-role`: matches element roles (e.g. `button`, `textField`). * `--contains`: substring match against labels (only valid alone or with default label mode; do not combine with `--by-id` or `--by-role`). * `--point` expects a **single comma-separated value** `x,y` in points (matches normalized screenshots and tree output). * Valid: `--point 100,200` or `--point "100,200"`. * Invalid: `--point 100 200` (space-separated; two arguments will be rejected). * 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.85` (≈ one viewport, so each scroll advances a full screen with a small overlap — no duplicated or skipped content). * Example: `--distance 0.5` scrolls half the screen height. * Invalid: `--distance 300` (FlowDeck will reject values outside 0.05–0.95). * `scroll` returns `moved` and `reached_end` in its JSON. When `reached_end` is `true` the content didn't move — you are at the top/bottom; stop scrolling. * `--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, then returns the settled screen. Use `id:myElement` to match by accessibility identifier. It early-exits when the content stops moving, so it won't scroll uselessly to the timeout at the end of a list. * `--timeout` for `scroll --until` is in **milliseconds** (default `20000`). * `tap`, `type`, `scroll`, `swipe`, `double-tap`, and `wait` return the settled post-action screen (full tree + element refs + `screen_hash`) under a `screen` key by default — so you don't need a separate snapshot after each action. Pass `--no-screen` for a terse result when you don't need the tree. > [!WARNING] > > The iOS `scroll --timeout` is measured in **milliseconds**. The macOS counterpart (`flowdeck ui mac scroll --timeout`) is measured in **seconds**. Same flag name, different unit — never copy a value across platforms without converting. ### 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. * Pass either a positional keycode (e.g. `key 40`) **or** `--sequence`, not both. * `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. `` is in degrees; positive values rotate **clockwise**, negative values rotate **counterclockwise**. Optional `--point` (center) and `--radius`. ### Buttons, Appearance, and Touch * Use `flowdeck simulator button --hold 1.5` to hold a hardware button for the given seconds. * Use `flowdeck simulator appearance light` or `dark` to switch appearance mode. * Use `flowdeck simulator orientation get` or `orientation set ` for physical orientation. * `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 * **Start a session before any UI work.** Run `flowdeck ui simulator session start -S --json`, parse the JSON output to get `latest_screenshot` and `latest_tree` file paths, then use Read tool on those paths to see the screen and inspect elements. * **Verify after every action.** After each tap/type/swipe, wait \~1 second, then re-read `latest_screenshot` to confirm the UI changed. Never chain actions without checking. * Use accessibility identifiers and `--by-id` whenever possible; label matching is slower and more ambiguous. * Before tapping an element, read `latest_tree` to confirm it exists and is visible. * For automation loops, re-read `latest-tree.json`/`latest.jpg` from disk instead of issuing `screen` for every step. The session updates these files automatically. * For one-off tree-only checks, use `ui simulator screen --tree --json -S ` (no screenshot). Use `--optimize` when you do need a one-off screenshot. * 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`. # macOS UI Automation Source: https://docs.flowdeck.studio/cli/commands/ui/mac-automation Automate macOS app interactions with FlowDeck's UI automation commands FlowDeck macOS UI automation drives native macOS apps using the Accessibility framework and CGEvent-based input. Commands live under `flowdeck ui mac`. ## Common Flags Most macOS UI automation commands support: * `--app` to target a specific app by **name, bundle ID, or PID**. Required on most commands. Examples: `--app "Safari"`, `--app "com.apple.Safari"`, `--app "12345"`. * `--json` for machine-readable output. * `--examples` / `-e` to print usage examples for the command. * `-h` / `--help` for the help screen. Leaf action commands (`click`, `double-click`, `right-click`, `type`, `erase`, `key`, `hotkey`, `scroll`, `move`, `drag`, `swipe`, `find`, `list`, `wait`, `assert`, `launch`, `activate`, `quit`, `screen`, window/menu subcommands, permission commands) accept only `--json`, `--examples`/`-e`, and `-h` beyond their command-specific flags. They do **not** accept `-v`/`--verbose`. Every command that can reach the cursor also takes `--foreground`. Actions run in the background by default — no cursor movement, no focus change — and `--foreground` opts out. `drag`, `swipe`, `move`, `activate`, and `window focus` have no background path and require it. See [macOS Automation](/cli/macos-automation) for the full rationale. Session subcommands (`session start`, `session stop`) additionally accept `-v` / `--verbose`. App resolution order: 1. Numeric string → PID 2. Contains a dot → bundle ID 3. Otherwise → fuzzy match against running app names ## Permissions | Command | Purpose | Key Options | | - | - | - | | `ui mac check-permissions` | Check Accessibility and Screen Recording permissions | `--json` | | `ui mac request-permissions` | Trigger system permission dialogs | `--json` | ## Capture | Command | Purpose | Key Options | | - | - | - | | `ui mac screen` | Screenshot + accessibility tree from app window | `--app`, `--tree`, `--mode`, `--output`, `--json` | | `ui mac session start` | Start background tree + screenshot capture | `--app`, `--interval-ms`, `--retention-seconds`, `--json` | | `ui mac session stop` | Stop the active capture session | `--json` | ## Query | Command | Purpose | Key Options | | - | - | - | | `ui mac find` | Locate elements by label/ID/role | `--app`, `--by-id`, `--by-role`, `--contains` | | `ui mac list apps` | List running GUI apps | `--include-agents`, `--include-system` | | `ui mac list windows` | List app windows | `--app` | | `ui mac list screens` | List connected displays | `--json` | | `ui mac list permissions` | Check permission status | `--json` | ## Interaction | Command | Purpose | Key Options | | - | - | - | | `ui mac click` | Click element or coordinates | `--app`, `--point`, `--by-id`, `--duration` | | `ui mac double-click` | Double-click element or coordinates | `--app`, `--point`, `--by-id` | | `ui mac right-click` | Right-click element or coordinates | `--app`, `--point`, `--by-id` | | `ui mac type` | Type text into focused element | `--app`, `--clear`, `--delay-ms`, `--mask` | | `ui mac erase` | Erase text from focused field | `--app`, `--characters`, `--foreground` | | `ui mac scroll` | Scroll in a direction | `--app`, `--direction`, `--amount`, `--smooth`, `--until`, `--timeout` | | `ui mac move` | Move cursor to a point | `--point`, `--app` | | `ui mac drag` | Drag from one point to another (**foreground-only**) | `--app`, `--from`, `--to`, `--duration`, `--foreground` | | `ui mac swipe` | Swipe in a direction (**foreground-only**) | `--app`, `--direction`, `--distance`, `--duration`, `--foreground` | ## Keyboard | Command | Purpose | Key Options | | - | - | - | | `ui mac key` | Press a key by name or keycode | `--app`, `--name`, `--keycode` | | `ui mac hotkey` | Press a keyboard shortcut | `--app`, combo argument (e.g., `cmd+s`) | ## Wait and Assert | Command | Purpose | Key Options | | - | - | - | | `ui mac wait` | Wait for element condition | `--app`, `--condition`, `--timeout`, `--by-id` | | `ui mac assert visible` | Assert element is visible | `--app`, `--by-id` | | `ui mac assert hidden` | Assert element is hidden | `--app`, `--by-id` | | `ui mac assert enabled` | Assert element is enabled | `--app`, `--by-id` | | `ui mac assert disabled` | Assert element is disabled | `--app`, `--by-id` | | `ui mac assert text` | Assert element text matches | `--app`, `--expected`, `--contains`, `--by-id` | ## App Lifecycle | Command | Purpose | Key Options | | - | - | - | | `ui mac launch` | Launch an app by bundle ID | `--bundle-id` | | `ui mac activate` | Bring an app to front (**foreground-only**) | `--app`, `--foreground` | | `ui mac quit` | Quit an app | `--app`, `--force` | ## Window Management | Command | Purpose | Key Options | | - | - | - | | `ui mac window list` | List app windows | `--app` | | `ui mac window move` | Move a window | `--app`, `--to`, `--index` | | `ui mac window resize` | Resize a window | `--app`, `--size`, `--index` | | `ui mac window focus` | Focus a window (**foreground-only**) | `--app`, `--index`, `--foreground` | ## Menu Interaction | Command | Purpose | Key Options | | - | - | - | | `ui mac menu list` | List app menu bar items | `--app` | | `ui mac menu click` | Click a menu item by path | `--app`, path argument | *** ## Key Options Explained ### Screen and Sessions * `--output` sets the screenshot file path (PNG). If omitted, FlowDeck writes to a temp file and prints the path. * `--tree` returns only the accessibility tree (no screenshot). * `--mode` (boolean; no value) captures the full screen instead of the app window. Use when the app window is partially offscreen or you need surrounding context (Dock, menu bar, other windows). * Screenshots require macOS 14+ and Screen Recording permission. * Screenshot dimensions are in pixels. * `session start` captures tree + screenshots every 500ms by default and writes to `~/.flowdeck/automation/mac-sessions//` (the short ID is the first 8 characters of the session UUID). * `session stop` takes **no** `--app`. At most one macOS UI session is active at a time, so `stop` is unambiguous. * Starting a session stops any active macOS session first. * `--interval-ms` and `--retention-seconds` tune capture frequency and retention (default 60s). Retention always keeps at least one capture. * Sessions write `latest.json`, `latest.jpg`, and `latest-tree.json` so automation can re-read the newest capture without listing the directory. * JSON output from `session start` includes the session directory, app name, PID, screens directory, trees directory, and the `latest_screenshot` / `latest_tree` paths. ```bash theme={null} flowdeck ui mac screen --app "Safari" --json flowdeck ui mac screen --app "Safari" --output ./screen.png flowdeck ui mac screen --app "Safari" --tree --json flowdeck ui mac session start --app "Safari" --json flowdeck ui mac session stop --json ``` ### Find * `--by-id` matches accessibility identifiers instead of labels. * `--by-role` matches element roles (e.g., `button`, `textField`). * `--contains` does a substring match against labels. * Returns element role, center coordinates, enabled state, and text value. * Suggestions are provided when no exact match is found. ```bash theme={null} flowdeck ui mac find "Settings" --app "MyApp" flowdeck ui mac find "settings_button" --app "MyApp" --by-id flowdeck ui mac find "button" --app "MyApp" --by-role flowdeck ui mac find "Log" --app "MyApp" --contains ``` ### Click, Double-Click, and Right-Click * `--by-id` treats the target as an accessibility identifier. * `--point` expects `x,y` coordinates (screen-absolute, matching `find` output). * Pass `` **or** `--point`, not both. The command errors if you supply neither. * `--duration` on `click` is a long-press hold time in seconds. * `tap` and `double-tap` are hidden aliases for `click` and `double-click`. ```bash theme={null} flowdeck ui mac click "Log In" --app "MyApp" flowdeck ui mac click "login_button" --app "MyApp" --by-id flowdeck ui mac click --point 120,340 --app "MyApp" flowdeck ui mac right-click "item" --app "MyApp" ``` ### Type and Erase * `--clear` clears the focused field before typing (Select All + Delete). * `--delay-ms` overrides the per-character typing delay. * `--mask` hides the typed text in terminal output and JSON (useful for passwords). * `erase --characters 5` deletes a specific number of characters; omit to clear all. ```bash theme={null} flowdeck ui mac type "hello@example.com" --app "MyApp" flowdeck ui mac type "secret123" --app "MyApp" --mask flowdeck ui mac type "New Value" --app "MyApp" --clear flowdeck ui mac erase --app "MyApp" flowdeck ui mac erase --characters 5 --app "MyApp" ``` ### Key and Hotkey * `key --name` accepts key names: `return`, `escape`, `tab`, `delete`, `space`, `f1`–`f12`, arrow keys, etc. * `key --keycode` accepts raw virtual keycodes. * Pass `--name` **or** `--keycode`, not both. The command errors if you supply neither. * `hotkey` accepts modifier+key combos: `cmd+s`, `cmd+shift+z`, `ctrl+alt+delete`. * **Command-key combos are unreliable against a backgrounded app.** Whether a `cmd+...` combo lands depends on how the target app installs the shortcut, and a combo that doesn't land is still reported as success. Use `ui mac menu click "File > Save"` when the result matters — it goes through accessibility and always works in the background — or pass `--foreground` after asking the user. * Supported modifiers: `cmd`/`command`, `shift`, `ctrl`/`control`, `alt`/`option`. ```bash theme={null} flowdeck ui mac key --name return --app "MyApp" flowdeck ui mac key --keycode 36 --app "MyApp" flowdeck ui mac hotkey "ctrl+a" --app "MyApp" flowdeck ui mac menu click "File > Save" --app "TextEdit" # not hotkey "cmd+s" ``` ### Scroll * `--direction` is required: `up`, `down`, `left`, or `right`. * `--amount` sets the scroll magnitude in discrete ticks (default: `3`). * `--smooth` enables many small ticks with delays for smooth scrolling. * `--until` scrolls repeatedly until the target element appears. Use `id:myElement` for accessibility ID matching. * `--timeout` sets the deadline for `--until` in **seconds** (default: `30`). * Scroll is performed at the center of the app's focused window. > [!NOTE] > > iOS `ui simulator scroll --timeout` is in **milliseconds**; macOS `ui mac scroll --timeout` is in **seconds**. Same flag, different unit — never copy values across platforms. ```bash theme={null} flowdeck ui mac scroll --direction down --app "Safari" flowdeck ui mac scroll --direction up --amount 10 --app "MyApp" flowdeck ui mac scroll --direction down --amount 5 --smooth --app "MyApp" flowdeck ui mac scroll --direction down --until "id:bottomButton" --app "MyApp" flowdeck ui mac scroll --direction down --until "Save" --timeout 15 --app "MyApp" ``` ### Move, Drag, and Swipe * `move --point` expects `x,y` screen-absolute coordinates. * `move --app` is **optional**. The cursor moves to the absolute screen point regardless of which app is focused; the flag only validates that the named app exists. * `move`, `drag`, and `swipe` are **foreground-only**: they take the real cursor, so they require `--foreground` and exit non-zero without it. * `drag --from` and `--to` expect `x,y` coordinates. `--duration` is in seconds (default: `0.5`). * `swipe --direction` accepts `up`, `down`, `left`, `right`. `--distance` is in points (default: `200`). ```bash theme={null} flowdeck ui mac move --point 500,300 --app "MyApp" flowdeck ui mac drag --from 100,200 --to 400,500 --app "MyApp" --foreground flowdeck ui mac drag --from 100,200 --to 400,500 --duration 1.0 --app "MyApp" --foreground flowdeck ui mac swipe --direction up --app "MyApp" --foreground flowdeck ui mac swipe --direction left --distance 400 --app "MyApp" --foreground ``` ### Wait * `--condition` accepts one of: `exists` (default), `gone`, `enabled`, `stable`. Invalid values are rejected with an error. * `exists` — element is present in the accessibility tree * `gone` — element is not present * `enabled` — element is present and `enabled = true` * `stable` — element's frame stops moving between polls (use to wait for an animated transition to settle) * `--timeout` is in **seconds** (default: `30`). * `--by-id` treats the target as an accessibility identifier. ```bash theme={null} flowdeck ui mac wait "Loading..." --app "MyApp" flowdeck ui mac wait "Submit" --app "MyApp" --condition enabled --timeout 15 flowdeck ui mac wait "Toast" --app "MyApp" --condition gone flowdeck ui mac wait "save_button" --app "MyApp" --by-id --condition enabled ``` ### Assert Assert element conditions with immediate pass/fail (no polling). Exits with failure if the assertion does not hold. **Subcommands:** | Subcommand | Description | | - | - | | `visible ` | Assert the element is visible | | `hidden ` | Assert the element is hidden | | `enabled ` | Assert the element is enabled | | `disabled ` | Assert the element is disabled | | `text ` | Assert the element text matches | **Common Options:** | Option | Description | | - | - | | `--by-id` | Treat target as accessibility identifier | | `--app` | Target app | **Text Options:** | Option | Description | | - | - | | `--expected ` | Expected text value (required) | | `--contains` | Check whether the text contains the expected value | ```bash theme={null} flowdeck ui mac assert visible "Profile" --app "MyApp" flowdeck ui mac assert hidden "Spinner" --app "MyApp" flowdeck ui mac assert enabled "Submit" --app "MyApp" flowdeck ui mac assert disabled "Continue" --app "MyApp" flowdeck ui mac assert text "Welcome" --app "MyApp" --expected "Hello" flowdeck ui mac assert text "title_label" --app "MyApp" --by-id --expected "Dashboard" --contains ``` ### App Lifecycle * `launch` uses `--bundle-id`, **not** `--app`. It targets the installed bundle directly, not a running process. Discover bundle IDs with `ui mac list apps --json`. * `activate --app` brings a running app to the foreground. It requires `--foreground`, because raising an app takes the user's screen. You rarely need it: every action command already reaches a background app. * `quit --app` sends a graceful terminate. `--force` force-quits. ```bash theme={null} flowdeck ui mac launch --bundle-id com.apple.Safari flowdeck ui mac activate --app "Safari" --foreground flowdeck ui mac quit --app "TextEdit" flowdeck ui mac quit --app "MyApp" --force ``` ### Window Management * `--index` selects which window (default: `0`, the first/main window). * `window move --to` expects `x,y` for the new origin. * `window resize --size` expects `w,h` for the new dimensions. ```bash theme={null} flowdeck ui mac window list --app "Safari" --json flowdeck ui mac window move --app "Safari" --to 100,100 flowdeck ui mac window resize --app "Safari" --size 1200,800 flowdeck ui mac window focus --app "Safari" --index 1 --foreground ``` ### Menu Interaction * `menu list` shows the app's menu bar hierarchy with titles, shortcuts, and enabled state. * `menu click` navigates a menu path using `>` separators. ```bash theme={null} flowdeck ui mac menu list --app "TextEdit" --json flowdeck ui mac menu click "File > Export as PDF" --app "TextEdit" flowdeck ui mac menu click "Edit > Find > Find..." --app "Safari" ``` ### List * `list apps` shows running GUI applications with PID, name, and bundle ID. * `--include-agents` includes background agent apps. * `--include-system` includes system processes. * `list windows` requires `--app`. * `list screens` shows connected displays with frame and scale info. * `list permissions` shows Accessibility and Screen Recording status. ```bash theme={null} flowdeck ui mac list apps --json flowdeck ui mac list apps --include-agents --include-system flowdeck ui mac list windows --app "Safari" --json flowdeck ui mac list screens --json flowdeck ui mac list permissions --json ``` ## Coordinate System * All coordinates are **screen-absolute points** (matching what `find` returns). * Multi-display setups use the global coordinate space (origin at primary display top-left). * Do not apply Retina scaling; use coordinates as reported by `find` and `list screens`. * Use `flowdeck ui mac list screens` to see display layouts and pixel densities. ### Coordinate Format All point and size flags on macOS use **comma-separated** `x,y` (or `w,h` for sizes). Space-separated values are rejected with a live error: ``` Invalid coordinates: 400 300 is not supported on macOS ``` Applies to `--point`, `--from`, `--to`, and `--size` across `click`, `double-click`, `right-click`, `move`, `drag`, `window move`, and `window resize`. ```bash theme={null} # Correct flowdeck ui mac click --point 400,300 --app "MyApp" flowdeck ui mac drag --from 100,100 --to 500,400 --app "MyApp" --foreground flowdeck ui mac window resize --app "Safari" --size 1200,800 # Wrong — rejected flowdeck ui mac click --point "400 300" --app "MyApp" ``` ## Timing Tuning Set these environment variables to adjust input timing: * `FLOWDECK_HID_STABILIZATION_MS` adds settle time between input events (default: `25`) * `FLOWDECK_TYPE_DELAY_MS` adds per-character typing delay (default: `1`) ## Performance and Reliability Tips * **Start a session before any macOS UI work.** Run `flowdeck ui mac session start --app "MyApp" --json`, parse the JSON output to get `latest_screenshot` and `latest_tree`, then read those files to inspect the current UI. * macOS UI sessions remain single-active and stop automatically when the owner process that started them exits. Set `FLOWDECK_OWNER_PID` to bind a session to a specific owner process. * **Verify after every action.** After each click/type/scroll, wait briefly, then re-read `latest_screenshot` and `latest_tree` to confirm the UI changed. * Use accessibility identifiers and `--by-id` whenever possible; label matching is slower and more ambiguous. * For automation loops, re-read `latest-tree.json`/`latest.jpg` from disk instead of issuing `screen` for every step. The session updates these files automatically. * Use `ui mac screen --tree --json --app "MyApp"` for one-off tree-only checks when you do not need a running session. For a full help listing, run `flowdeck ui mac --help`. # Uninstall Source: https://docs.flowdeck.studio/cli/commands/uninstall Uninstall an app from a simulator or device Use `uninstall` to remove an app by FlowDeck app ID or bundle ID from either a simulator or a connected device. ```bash theme={null} # Uninstall by app ID flowdeck uninstall # Uninstall by bundle ID flowdeck uninstall com.example.MyApp # Target a specific simulator flowdeck uninstall com.example.MyApp --simulator "iPhone 16" # Target a specific device flowdeck uninstall com.example.MyApp --device "John's iPhone" # JSON output flowdeck uninstall --json # Show usage examples flowdeck uninstall com.example.MyApp --examples ``` ## Arguments | Argument | Description | | - | - | | `` | App identifier (short/full ID) or bundle ID | ## Options | Option | Short | Description | | - | - | - | | `--simulator` | `-s` | Target simulator name or UDID (defaults to inferred/booted simulator) | | `--device` | `-d` | Target connected device name or UDID | | `--json` | `-j` | Output as JSON | | `--verbose` | `-v` | Show verbose output | | `--examples` | `-e` | Show usage examples | > [!NOTE] > > Uninstall is not available on macOS apps. Use `flowdeck stop ` for macOS launches. # Update Source: https://docs.flowdeck.studio/cli/commands/update Check for and install FlowDeck CLI updates Update FlowDeck from the command line. ```bash theme={null} # Install the latest version flowdeck update # Check for updates only flowdeck update --check # JSON output flowdeck update --check --json ``` ## Options | Option | Short | Description | | - | - | - | | `--check` | | Check for updates without installing | | `--json` | `-j` | Output as JSON | | `--examples` | `-e` | Show usage examples | ## JSON Output `flowdeck update --check --json` reports availability without installing: ```json theme={null} { "schema": "flowdeck.update", "schemaVersion": "1.0.0", "success": true, "currentVersion": "1.2.3", "latestVersion": "1.3.0", "updateAvailable": true, "message": "A new version of FlowDeck is available" } ``` When already up to date, `updateAvailable` is `false` and `latestVersion` equals `currentVersion`. On failure (e.g. no network), `success` is `false` and `message` describes the problem. # Configuration File Source: https://docs.flowdeck.studio/cli/configuration-file Understand FlowDeck's explicit --config files and project settings files FlowDeck has two JSON config formats, and they are easy to confuse: 1. **Explicit command config** used with `--config` 2. **Project settings config** stored in `.flowdeck/config.json` or `.flowdeck/config.local.json` Use `--config` for reproducible command invocations in CI, scripts, and one-off runs. Use the project settings files for shared project defaults and per-scheme overrides inside a repository. > [!NOTE] > > Today, explicit `--config` remains the clearest way to drive a full build, run, or test invocation from the CLI. The project settings files are the canonical shared on-disk format, while legacy sidecar files remain supported for compatibility in current runtime paths. ## Explicit Command Config (`--config`) ```bash theme={null} flowdeck build --config path/to/config.json flowdeck run --config path/to/config.json flowdeck test --config path/to/config.json ``` ## Explicit Command Config Structure ```json theme={null} { "workspace": "MyApp.xcworkspace", "scheme": "MyApp", "configuration": "Debug", "platform": "iOS", "version": "18.0", "deviceUdid": "00008030-001234567890ABCD", "simulatorUdid": "A1B2C3D4-E5F6-7890-ABCD-EF1234567890", "derivedDataPath": "~/Library/Developer/FlowDeck/DerivedData", "xcodebuild": { "args": ["-enableCodeCoverage", "YES"], "env": { "CI": "true" } }, "appLaunch": { "args": ["-SkipOnboarding"], "env": { "DEBUG_MODE": "1" } } } ``` ## Explicit Command Config Field Reference | Field | Type | Required | Description | | - | - | - | - | | `workspace` | string | **Yes** | Path to `.xcworkspace` or `.xcodeproj` (relative to project root) | | `scheme` | string | **Yes** | Scheme name to build | | `configuration` | string | No | Build configuration. Default: `Debug`. Options: `Debug`, `Release`, or custom | | `platform` | string | No | Target platform. Options: `iOS`, `macOS`, `watchOS`, `tvOS`, `visionOS` | | `version` | string | No | OS version (e.g., `18.0`, `17.5`). Uses latest available if not specified | | `deviceUdid` | string | No | Physical device UDID for device builds | | `simulatorUdid` | string | No | Simulator UDID for simulator builds | | `derivedDataPath` | string | No | Custom derived data directory path (default: `~/Library/Developer/FlowDeck/DerivedData`) | | `xcodebuild` | object | No | Passthrough settings for xcodebuild (see [Xcodebuild Arguments](/cli/xcodebuild-args)) | | `appLaunch` | object | No | Arguments and environment variables passed to the app at launch (run command only) | ## Explicit Command Config Target Resolution Priority When determining the build target, FlowDeck uses this priority order: 1. **`deviceUdid`** - Physical device (if specified and connected) 2. **`simulatorUdid`** - Exact simulator by UDID 3. **`platform` + `version`** - Auto-resolve best matching simulator 4. **`platform: "macOS"`** - Native Mac build (no simulator needed) ## Explicit Command Config Examples > [accordion] Minimal iOS Configuration > > ```json theme={null} > { > "workspace": "MyApp.xcworkspace", > "scheme": "MyApp" > } > ``` > > Uses default Debug configuration and latest available iOS simulator. > [accordion] macOS Native Build > > ```json theme={null} > { > "workspace": "MyApp.xcworkspace", > "scheme": "MyApp-macOS", > "platform": "macOS", > "configuration": "Release" > } > ``` > > Builds for macOS without simulator. > [accordion] Physical Device Build > > ```json theme={null} > { > "workspace": "MyApp.xcworkspace", > "scheme": "MyApp", > "deviceUdid": "00008030-001234567890ABCD" > } > ``` > > Get device UDID from `flowdeck device list --json`. > [accordion] Specific Simulator Version > > ```json theme={null} > { > "workspace": "MyApp.xcworkspace", > "scheme": "MyApp", > "platform": "iOS", > "version": "17.5" > } > ``` > > Targets iOS 17.5 simulator specifically. If not available, FlowDeck will create one. > [accordion] CI Release Build > > ```json theme={null} > { > "workspace": "MyApp.xcworkspace", > "scheme": "MyApp", > "configuration": "Release", > "platform": "iOS", > "derivedDataPath": "/tmp/derived-data", > "xcodebuild": { > "args": [ > "-enableCodeCoverage", "YES", > "CODE_SIGN_IDENTITY=-", > "CODE_SIGNING_REQUIRED=NO" > ], > "env": { > "CI": "true" > } > } > } > ``` > [accordion] watchOS Build > > ```json theme={null} > { > "workspace": "MyApp.xcworkspace", > "scheme": "MyApp-Watch", > "platform": "watchOS", > "version": "11.0" > } > ``` > [accordion] visionOS Build > > ```json theme={null} > { > "workspace": "MyApp.xcworkspace", > "scheme": "MyApp-Vision", > "platform": "visionOS", > "version": "2.0" > } > ``` ## Project Settings Files Project settings files are the shared on-disk format for project-level defaults: * `.flowdeck/config.json` — shared team config, usually committed * `.flowdeck/config.local.json` — per-user local override, usually gitignored When `config.local.json` exists and is valid JSON, it fully replaces `config.json` — it is not merged with the shared file. This is enforced by both the CLI (`build`/`run`/`test`) and the macOS app's Settings UI. If `config.local.json` exists but fails to parse, the CLI ignores it and falls back to `config.json`, printing a warning that names the file and the decode error rather than silently treating the project as unconfigured. The same applies to a malformed `config.json` with no local override present. (The macOS app's Settings UI falls back the same way but does not yet surface an equivalent warning.) ### Config Discovery `build`, `run`, and `test` no longer require you to invoke them from the exact directory that owns `.flowdeck/`. FlowDeck walks upward from the working directory (or `--project`, if passed) looking for the nearest ancestor directory that contains `.flowdeck/config.json`, `.flowdeck/config.local.json`, or one of the [legacy compatibility files](#legacy-compatibility-files), and loads project settings from there. The walk stops before your home directory and before `/`, so it never mistakes your `~/.flowdeck/` global state (CLI state, license cache, etc.) for a project config. > [!NOTE] > > This discovered directory — the "config root" — is used only for loading `.flowdeck/config.json` and its sidecars. Derived data, saved state, and other paths keyed by project location still use the exact directory you invoked FlowDeck from or passed via `--project`. Run with `--verbose` to see which directory FlowDeck resolved as the config root, along with the final merged launch args and env — see [App Launch Settings](/cli/app-launch-settings) for details. ### Project Settings Structure ```json theme={null} { "version": 1, "workspace": "MyApp.xcworkspace", "configuration": "Debug", "appLaunch": { "args": ["-SkipOnboarding"], "env": { "API_ENVIRONMENT": "staging" } }, "xcodebuild": { "args": ["-enableCodeCoverage", "YES"], "env": { "CI": "true" } }, "schemes": { "MyApp": { "configuration": "Release" }, "MyAppUITests": { "appLaunch": { "args": ["-UITests"], "env": { "RESET_STATE": "1" } }, "xcodebuild": { "args": ["-quiet"], "env": {} } } } } ``` ### Project Settings Field Reference | Field | Type | Description | | - | - | - | | `version` | integer | Schema version. Defaults to `1` | | `workspace` | string | Workspace or project path relative to the project root | | `configuration` | string | Top-level fallback build configuration | | `appLaunch` | object | Top-level fallback app launch settings | | `xcodebuild` | object | Top-level fallback xcodebuild passthrough settings | | `schemes` | object | Per-scheme overrides keyed by scheme name | Each entry under `schemes` may contain: * `configuration` * `appLaunch` * `xcodebuild` ## Legacy Compatibility Files Older FlowDeck setups may still contain: * `.flowdeck/schemes.json` * `.flowdeck/app-launch-settings.json` * `.flowdeck/build-settings.json` Prefer the project settings files for new setup and new documentation. Compatibility rule: * Missing fields in the new project settings config may be filled from legacy files. * Present-but-empty fields are treated as intentional and should not fall back to legacy files. ## Custom Derived Data Specify a custom derived data path to: * Avoid conflicts with Xcode * Enable parallel builds with separate derived data * Use faster storage (e.g., RAM disk) ```json theme={null} { "workspace": "MyApp.xcworkspace", "scheme": "MyApp", "derivedDataPath": "/tmp/flowdeck-derived-data" } ``` Or on the command line: ```bash theme={null} flowdeck build --workspace MyApp.xcworkspace --scheme MyApp \ --simulator "iPhone 16" \ --derived-data-path ~/FlowDeck/DerivedData ``` ## xcodebuild Passthrough in `--config` The `xcodebuild` section passes arguments and environment variables directly to xcodebuild: ```json theme={null} { "workspace": "MyApp.xcworkspace", "scheme": "MyApp", "xcodebuild": { "args": [ "-enableCodeCoverage", "YES", "-resultBundlePath", "./build/results.xcresult", "ONLY_ACTIVE_ARCH=NO" ], "env": { "CI": "true", "DEVELOPER_DIR": "/Applications/Xcode-15.4.app/Contents/Developer" } } } ``` > [!NOTE] > > See [Xcodebuild Arguments](/cli/xcodebuild-args) for complete passthrough documentation and common arguments. ## App Launch Settings in `--config` The `appLaunch` section passes arguments and environment variables to your app when it launches (for `run` command only): ```json theme={null} { "workspace": "MyApp.xcworkspace", "scheme": "MyApp", "appLaunch": { "args": [ "-AppleLanguages", "(en)", "-SkipOnboarding" ], "env": { "DEBUG_MODE": "1", "API_ENVIRONMENT": "staging" } } } ``` These are passed to `simctl launch` or the device launch process, not to xcodebuild. > [!NOTE] > > See [App Launch Settings](/cli/app-launch-settings) for complete documentation, common arguments, and local settings file support. ## File Locations ### Project Config Store shared project settings in your repository: ``` your-project/ .flowdeck/ config.json config.local.json MyApp.xcworkspace ``` Keep `config.local.json` gitignored so local overrides do not replace the shared team config for everyone else. ### Multiple Configurations Create separate explicit `--config` files for different scenarios: ```bash theme={null} # Development flowdeck run --config .flowdeck/dev-config.json # CI builds flowdeck build --config .flowdeck/ci-config.json # Release builds flowdeck build --config .flowdeck/release-config.json ``` ## CLI Override Command-line parameters override config file values: ```bash theme={null} # Config has configuration: "Debug", but this builds Release flowdeck build --config config.json --configuration Release ``` ## Generating Config Files ### From Interactive Mode 1. Run `flowdeck -i` in your project directory 2. Configure your build settings 3. Press `P`, then select **Export Project Config** 4. Save the exported explicit command config where you want to reuse it for `--config` ## Troubleshooting ### Config File Not Found Ensure the path is correct: ```bash theme={null} # Absolute path flowdeck build --config /path/to/config.json # Relative to current directory flowdeck build --config ./configs/build.json ``` ### Invalid JSON Validate your JSON syntax: ```bash theme={null} # Check if valid JSON cat config.json | jq . ``` ### Workspace Not Found Workspace paths are relative to the **project root** (where you run FlowDeck), not the config file location: ```json theme={null} { "workspace": "MyApp.xcworkspace" } ``` If your workspace is in a subdirectory: ```json theme={null} { "workspace": "src/MyApp.xcworkspace" } ``` ### Simulator Not Available If the specified simulator doesn't exist: 1. FlowDeck will try to resolve from `platform` + `version` 2. If a matching runtime exists, it creates a new simulator 3. Otherwise, it uses the first available simulator for that platform To ensure consistency, use simulator UDID: ```bash theme={null} # Get available simulators flowdeck simulator list --json # Use UDID in config { "simulatorUdid": "A1B2C3D4-E5F6-7890-ABCD-EF1234567890" } ``` # Create a Project Source: https://docs.flowdeck.studio/cli/create-project Generate a new Xcode project from templates FlowDeck CLI can scaffold a new Xcode project from built-in templates. ## Quick Start ```bash theme={null} # Create an iOS project in the current directory flowdeck project create MyApp # Create the project in a specific folder flowdeck project create MyApp --path ~/Projects # Create a multi-platform project (iOS, macOS, tvOS, visionOS share one target) flowdeck project create MyApp --platforms ios,macos,visionos # Create a standalone watchOS app flowdeck project create MyWatchApp --platforms watchos # Create an iOS app with an embedded companion watchOS app flowdeck project create MyApp --watch-companion # Set a custom bundle identifier flowdeck project create MyApp --bundle-id com.acme.MyApp # Customize deployment targets flowdeck project create MyApp --ios-target 17.0 --macos-target 14.0 ``` ## Next Steps Once the project is created, run `flowdeck config set` to save settings and start building without repeating flags. For full options, see [Project Create Command](/cli/commands/project/create). # Devices Source: https://docs.flowdeck.studio/cli/devices Deploy and test on Mac, Mac Catalyst, and physical devices FlowDeck CLI supports deploying and running your apps on your Mac (native or Catalyst) and physical Apple devices. ## Managing Devices ### List All Devices ```bash theme={null} flowdeck device list ``` **Example output:** ``` macOS -------------------------------------------------- 💻 [✓] My Mac Build and run as native macOS app 💻 [✓] My Mac Catalyst Build and run iOS app via Mac Catalyst iOS Devices: -------------------------------------------------- 🔌 [✓] Daniel's iPhone OS: iOS 17.2 | Type: iPhone UDID: 00008110-000123456789ABCD Connection: USB Found 1 physical devices ``` **Legend:** * 💻 = Mac target (virtual) * 🔌 = USB connection * 📡 = Network connection * \[✓] = Available ### Filter by Platform ```bash theme={null} flowdeck device list --platform iOS ``` ### Show Only Available Devices ```bash theme={null} flowdeck device list --available-only ``` ### JSON Output ```bash theme={null} flowdeck device list --json ``` ## Mac Targets ### My Mac (Native macOS) Build and run as a native macOS app: ```bash theme={null} flowdeck run -D "My Mac" flowdeck build -D "My Mac" ``` ### My Mac Catalyst Build and run an iOS app on Mac via Mac Catalyst: ```bash theme={null} flowdeck run -D "My Mac Catalyst" flowdeck build -D "My Mac Catalyst" ``` > [!NOTE] > > Mac Catalyst requires your iOS app to have `SUPPORTS_MACCATALYST = YES` in its build settings. > [!NOTE] > > In interactive mode, "My Mac Catalyst" only appears in the target list when your app's scheme supports Mac Catalyst. FlowDeck detects this automatically by checking the build settings. ## Physical Devices Physical devices (iPhones, iPads, Apple Watches) require a USB connection and proper provisioning. ### Install an App ```bash theme={null} flowdeck device install /path/to/MyApp.app ``` ### Uninstall an App ```bash theme={null} flowdeck device uninstall com.example.MyApp ``` ### Launch an App ```bash theme={null} flowdeck device launch com.example.MyApp ``` ### Requirements Before deploying to a physical device, ensure: * Device is connected via USB or USB-C * Device is trusted and unlocked * Apple Developer account has correct provisioning profiles * Device is registered in your Apple Developer account * App's bundle identifier matches your provisioning profile * Deployment target is compatible with device's iOS version ### Connection Types FlowDeck automatically detects: * **USB** - Direct wired connection (most reliable) * **Network** - WiFi network debugging (iOS 14+) > [!NOTE] > > Network debugging requires the device to be on the same WiFi network and previously paired via USB. ### Debugging Method FlowDeck automatically selects the best debugging method: * **iOS 17+** - Uses `devicectl` for faster, more reliable debugging * **iOS 16 and below** - Uses `ios-deploy` for compatibility ## Troubleshooting ### Device Not Appearing 1. Ensure the device is unlocked and trusted 2. Try unplugging and reconnecting the USB cable 3. Refresh the device list: ```bash theme={null} flowdeck device list ``` ### Code Signing Issues Check your provisioning profiles and certificates in Xcode's Preferences > Accounts. ### Connection Problems * Try a different USB cable * Check that the device trusts your Mac * For network debugging, ensure both are on the same WiFi network # Dry-Run Previews Source: https://docs.flowdeck.studio/cli/dry-run Preview mutating FlowDeck commands without changing local state Use `--dry-run` to validate a supported mutating command and inspect the operation FlowDeck would perform without executing it. ```bash theme={null} flowdeck build --dry-run flowdeck project packages add https://github.com/apple/swift-collections --dry-run flowdeck simulator erase SIMULATOR-UDID --dry-run ``` Read-only commands do not accept `--dry-run`. For example, `flowdeck project packages list` already has no side effects, so run it directly. > [!NOTE] > > Dry-run availability is command-specific. Check `flowdeck --help` before relying on it in automation. ## Human-readable output Without `--json`, FlowDeck prints the command or commands it would execute: ```text theme={null} 🔍 Dry Run - Command that would be executed: xcrun simctl boot SIMULATOR-UDID ``` ## JSON contract Combine `--dry-run` with `--json` for a normalized machine-readable preview: ```bash theme={null} flowdeck simulator boot SIMULATOR-UDID --dry-run --json ``` ```json theme={null} { "success": true, "type": "dry_run", "command": "xcrun simctl boot SIMULATOR-UDID", "argv": ["xcrun", "simctl", "boot", "SIMULATOR-UDID"], "schema": "flowdeck.simulator", "schemaVersion": "1.0.0" } ``` The stable fields are: | Field | Type | Description | | - | - | - | | `success` | boolean | Always `true` when the preview was produced successfully | | `type` | string | Always `dry_run` | | `command` | string | Human-readable command preview | | `argv` | string array | Argument-safe representation of the first command | | `schema` | string | Command-family schema identifier, when that command has one | | `schemaVersion` | string | Version of the emitted JSON contract | | `note` | string | Optional context for a preview step | Commands that require multiple operations also include a `commands` array. Each entry contains its own `command`, `argv`, and optional `note`: ```json theme={null} { "success": true, "type": "dry_run", "command": "first command\nsecond command", "argv": ["first", "command"], "commands": [ { "command": "first command", "argv": ["first", "command"] }, { "command": "second command", "argv": ["second", "command"], "note": "Follow-up operation" } ], "schemaVersion": "1.0.0" } ``` Use `argv` rather than splitting `command` when feeding a preview into other tooling. ## Validation behavior A dry run still validates required arguments and command-specific input. It can also resolve saved project settings needed to construct the preview. It does not boot, erase, install, launch, record, write project files, or perform the requested mutation. See [Automation & Scripting](/cli/automation) for JSON-stream processing and configuration examples. # Installation Source: https://docs.flowdeck.studio/cli/install Install FlowDeck CLI on your Mac FlowDeck CLI is available for macOS and can be installed with a single command. ## Prerequisites Before installing FlowDeck CLI, ensure you have: **1. Recent macOS running on an Apple Silicon or Intel Mac** > [!WARNING] > > Windows and Linux are not supported. * macOS 13 (Ventura) or higher **2. Xcode** > [!NOTE] > > FlowDeck uses Xcode's internal tools to build and debug your apps. * Download from the [Mac App Store](https://apps.apple.com/us/app/xcode/id497799835?mt=12) (16.0 or later) * Launch Xcode at least once to install components * Accept the license agreement **3. Xcode Command Line Tools** Install the latest command line tools ```bash theme={null} xcode-select --install ``` ## Installation Run this command in your terminal: ```bash theme={null} curl -sSL https://flowdeck.studio/install.sh | sh ``` The installer will install to `~/.local/bin` by default. If this directory is not in your PATH, it will provide a command to add it. ## Verify Installation After installation, verify FlowDeck CLI is working: ```bash theme={null} flowdeck --version ``` You should see output like: ```text theme={null} 1.22.0 ``` ## License Activation Standalone terminal use normally requires a valid CLI license. A license is valid for two (2) machines. During the FlowDeck macOS beta, protected CLI commands also work without a separate CLI license when the production beta service is active and `/Applications/FlowDeck.app` reports a version below `1.0.0`. This applies to standalone terminal commands as well as commands launched by the app. Apps installed under another name or location do not enable this beta access. ### Activate Your License ```bash theme={null} flowdeck license activate YOUR-LICENSE-KEY ``` Need a new license key? Purchase at [flowdeck.studio/cli/purchase](https://flowdeck.studio/cli/purchase/). ### Check License Status ```bash theme={null} flowdeck license status ``` ### CI/CD Usage > [!NOTE] > > Using your license as an environment variable **does not count against your license limit**, but the functionality is restricted to CI/CD environments only (GitHub Actions, GitLab CI, CircleCI, Jenkins, etc.). For CI/CD environments, set the license key as an environment variable instead of activating: ```bash theme={null} export FLOWDECK_LICENSE_KEY=YOUR-LICENSE-KEY flowdeck build --workspace MyApp.xcworkspace --simulator "iPhone 16" ``` ## Next Steps Once installed, try these commands: ```bash theme={null} # Navigate to your project cd ~/Projects/MyApp # Launch interactive mode flowdeck -i # Or run commands directly flowdeck build --workspace MyApp.xcworkspace --scheme myApp --simulator "iPhone 16" ``` > [!NOTE] > > Check the [Command Reference](/cli/commands) for complete documentation of all available commands. ## Updating ### Via Built-in Update Command ```bash theme={null} # Check for updates flowdeck update --check # Update to latest version flowdeck update ``` ### Via Installer You can also re-run the installer to update: ```bash theme={null} curl -sSL https://flowdeck.studio/install.sh | sh ``` ## Uninstallation > [!WARNING] > > Before uninstalling, run `flowdeck license deactivate` to free up your license activation slot. Remove the FlowDeck binary and configuration: ```bash theme={null} # Remove the binary and resources rm -rf ~/.local/share/flowdeck # Remove the symlink rm ~/.local/bin/flowdeck # Remove configuration files rm -rf ~/.flowdeck ``` # Introduction Source: https://docs.flowdeck.studio/cli/interactive A terminal-based IDE experience for iOS/macOS development FlowDeck CLI includes a powerful interactive mode that provides a terminal-based IDE experience. Launch it with `flowdeck -i` to get a persistent development environment with keyboard shortcuts, log streaming, and a status bar. You can open an existing project or create a new one directly from interactive mode. ## Launching Interactive Mode ```bash theme={null} cd ~/Projects/MyApp flowdeck -i ``` On first run, the interactive mode will guide you through a setup assistant to configure your workspace, scheme, and target. The setup assistant walks you through selecting or creating a project, then choosing a workspace, scheme, and target so you can start building immediately. ## Project Workflows * **Create a Project** – Pick a template, name the app, and let FlowDeck scaffold the `.xcodeproj` before continuing with configuration. See [Working with Projects](/cli/interactive/working-with-projects#creating-a-project) for the full prompts. * **Open a Project** – Choose an existing `.xcworkspace` or `.xcodeproj`, select among multiple workspaces if needed, and then pick schemes and targets. See [Working with Projects](/cli/interactive/working-with-projects#opening-a-project) for details. ## Example Session ![Clean Shot2025 12 17at18 39 48@2x](https://mintcdn.com/flowdeck/1ORqBD4UYIgP5hgK/images/CleanShot2025-12-17at18.39.48@2x.png?fit=max\&auto=format\&n=1ORqBD4UYIgP5hgK\&q=85\&s=59c9b367769392675d768b78d8e15e03) ## Status Bar The bottom of the terminal displays a persistent status bar showing: * **Project name** and git branch * **Current scheme** * **Target** (simulator or device) * **Build configuration** (Debug/Release) * **App status** (Idle, Building, Running, Error) ## Build, Run & Test Start with the core commands, then dig into build settings, tools, shortcuts, and support. > [card] [Working with Projects](/cli/interactive/working-with-projects) > > Create a new project or open an existing one during setup. > [card] [Build, Run & Test](/cli/interactive/build-run-test) > > Core commands for build, run, test, logs, stop, and uninstall. > [card] [Build Settings](/cli/interactive/build-settings) > > Scheme, target, configuration, and workspace selection. > [card] [Project Tools](/cli/interactive/tools-settings/project-commands) > > Manage packages, sync profiles, export configs, and open in Xcode. > [card] [Command Reference](/cli/interactive/shortcuts) > > Build, run, test, build settings, and navigation keys. > [card] [Troubleshooting](/cli/interactive/help) > > Built-in help, CLI options, and common issues. # Build, Run & Test Source: https://docs.flowdeck.studio/cli/interactive/build-run-test Core commands for building, running, testing, logs, clean, stop, and uninstall Interactive mode is a persistent session that keeps your project context in memory and turns everyday tasks into single-key actions. The core loop is simple: build, run, inspect logs, run tests, and iterate without retyping flags. For scheme, target, and configuration choices, see [Build Settings](/cli/interactive/build-settings). ## Core Actions ```text theme={null} Build, Run & Test +-------------------------------------------+ | R Run T Test L Logs | | X Stop C Clean Z Uninstall | +-------------------------------------------+ ? Help ⇧R Run without building B Build without running ``` ### Build Press `B` to build using the currently selected scheme, target, and configuration. Build output streams into the main content area while the status bar reflects the live state (Building, Error, Ready). ### Run Press `R` to build and launch the app on the selected target. Use `Shift+R` to run without rebuilding when you already have a valid build on that target. ### Test Press `T` to open test selection. You can run the entire suite, recent tests from the current session, or specific test classes/methods. Results stream live as they run. ### Clean Press `C` (or `K`) to open the Clean menu for project clean, Xcode cache clean, and Derived Data removal. The menu provides: * **Clean Project** – removes build artifacts for the current scheme before running a full rebuild. * **Clean Xcode Cache** – clears Xcode's internal caches that can cache corrupted indexes. * **Clear FlowDeck's Derived Data** – removes FlowDeck’s DerivedData directory; this may force a full rebuild for all schemes. * **Clear Xcode Derived Data** – removes Xcode’s DerivedData directory. * **Clean All** – clears scheme artifacts, FlowDeck/Xcode Derived Data, and Xcode cache in one pass. ### Logs Press `L` to open the log/test viewer: * Streams test output while tests are running; otherwise shows app logs while the app is running. * Type to filter the buffer and use Backspace to edit the filter. * Scroll with ↑/↓, Page Up/Page Down, Home, and End; auto-scroll resumes when you reach the bottom. * Press `Esc` to exit back to the main view. **Watch the video:** [YouTube video player](https://www.youtube.com/embed/VDozo-oQ4_Y) ### Stop, Uninstall, and Cancel Press `X` to stop a running app. Press `Z` to uninstall the last launched app from the selected target. For non-interactive usage and arguments, see [Uninstall command](/cli/commands/uninstall). Use `ESC` during a build or test to cancel the current operation. See [Project Tools](/cli/interactive/tools-settings/project-commands) and [Manage Devices and Simulators](/cli/interactive/tools-settings/devices-simulators) for helper menus, persistence, and session tools. # Build Settings Source: https://docs.flowdeck.studio/cli/interactive/build-settings Scheme, target, configuration, and workspace selection in interactive mode Build Settings control what you build and where it runs. These selections are used by every Build, Run & Test action and are saved between sessions. ``` Build Settings +-------------------------------------------+ | S Scheme D Device / Simulator | | G Build Config W Workspace / Project | +-------------------------------------------+ ``` ## Scheme Press `S` to pick a scheme. This selection is saved for future sessions. ## Device / Simulator Press `D` to choose a simulator, connected device, or local target. Common target types include: * **My Mac** - Build and run as a native macOS app * **My Mac Catalyst** - Build and run iOS app on Mac via Catalyst (only appears if your scheme supports it) * **Physical Devices** - Connected iPhones, iPads, etc. * **Simulators** - iOS, iPadOS, tvOS, watchOS simulators ## Build Config Press `G` to select a build configuration such as Debug or Release. ## Workspace / Project Press `W` to switch to another workspace or project in your folder or subfolders. # Troubleshooting Source: https://docs.flowdeck.studio/cli/interactive/help Built-in help, CLI options, and common issues ## In Interactive Mode Press `H` at any time to open Support, including quick access to online documentation. Press `?` to display the Build, Run & Test help. ## Command Line Help ```bash theme={null} # Show all CLI options flowdeck --help ``` ## Common Issues > [accordion] Setup assistant keeps appearing > > The setup assistant runs when FlowDeck can't find a valid workspace or scheme. Make sure your project has a `.xcworkspace` or `.xcodeproj` file and run the setup again with `S` to select a scheme. > [accordion] Keyboard shortcuts not working > > Make sure the terminal window is focused and no command is currently running. Some shortcuts are disabled during builds or tests. > [accordion] Logs not appearing > > Press `L` to open the log viewer. Logs only appear when an app is running on a simulator. Physical device logs require Console.app. > [accordion] Build fails with signing errors > > Run `flowdeck build` outside interactive mode to see full error output, or check your Xcode signing settings. ## Documentation * [CLI Command Overview](/cli/commands/overview) - Full list of CLI commands * [Building](/cli/building) - Build configuration options * [Testing](/cli/testing) - Test execution options * [FlowDeck for AI Agents](/cli/ai-agents) - Recommended AI workflows # Command Reference Source: https://docs.flowdeck.studio/cli/interactive/shortcuts Build, run, test, build settings, and navigation keys in interactive mode Interactive mode is designed around single-key commands. Use these shortcuts any time no command is running. ## Build, Run & Test | Key | Action | | - | - | | `B` | Build the project | | `R` | Build and run in the selected simulator or device | | `Shift+R` | Run without building (launch existing app) | | `T` | Run tests menu | | `K` / `C` | Clean menu (see [Build, Run & Test](/cli/interactive/build-run-test#clean)) | | `X` | Stop running app | | `Z` | Uninstall last launched app | | `L` | Toggle log/test viewer (context-aware) | ## Build Settings | Key | Action | | - | - | | `S` | Select scheme | | `D` | Select target (simulator/device) | | `G` | Select configuration (Debug/Release) | | `W` | Switch to other workspaces in your folder or subfolders | ## Project Tools | Key | Action | | - | - | | `P` | Project Tools menu (see [Project Tools](/cli/interactive/tools-settings/project-commands)) | ## Tools & Settings | Key | Action | | - | - | | `E` | Devices, Simulators & Runtimes menu | | `A` | AI Settings | | `F` | FlowDeck settings | | `V` | Show version | ## Navigation | Key | Action | | - | - | | `H` | Support | | `?` | Build, Run & Test help | | `Q` | Quit interactive mode | | `Page Up` | Scroll output up | | `Page Down` | Scroll output down | | `↑` / `↓` | Command history | # Manage Devices and Simulators Source: https://docs.flowdeck.studio/cli/interactive/tools-settings/devices-simulators Manage physical devices, simulators, and runtime downloads Open this menu with `E` to manage runtime environments and targets. Runtimes are the platform images (iOS, tvOS, watchOS, visionOS) that simulators are built on. You can only create or boot simulators for runtimes that are installed locally. ## Watch the Demo [YouTube video player](https://www.youtube.com/embed/HFcA01euOcQ) ## Create Simulator Select **Create Simulator** to run the guided flow: | Step | Action | | - | - | | **Name** | Confirm a default name or enter a custom one. | | **Device Type** | Choose an iPhone or iPad device type. | | **Runtime** | Pick an installed iOS/iPadOS runtime version. | ## Manage Devices & Simulators Select **Manage Devices & Simulators** to browse targets and perform actions. ### Devices | Option | Action | | - | - | | **Select as target** | Choose My Mac, My Mac Catalyst (if supported), or a connected device as the active run destination. | ### Simulators | Action | Purpose | | - | - | | **Select as target** | Use the simulator as the active run destination. | | **Boot** | Start the simulator. | | **Shutdown** | Power off the simulator. | | **Reset (erase all data)** | Wipe simulator data and restore it to a clean state. | | **Delete** | Remove the simulator from your system. | ## Prune Stale Simulators (last 90d) | Option | Action | | - | - | | **Prune Stale Simulators** | Remove simulators that have never been booted, have not been booted in 90+ days, or are orphaned after a runtime removal. | ## Manage Runtimes Select **Manage Runtimes** to view, install, or remove simulator runtimes: | Option | Action | | - | - | | **View Installed** | Review installed runtimes and versions. | | **Install** | Download a new runtime from Apple. | | **Remove** | Remove a runtime to reclaim disk space. | # FlowDeck Settings Source: https://docs.flowdeck.studio/cli/interactive/tools-settings/flowdeck-settings License status and update tools Open FlowDeck Settings with `F` for account and update actions: | Option | Action | | - | - | | **License Status** | Shows whether your license is active and provides renewal/activation links if needed. | | **Check for Updates** | Runs the update flow for the CLI and companion tools. | # Support Source: https://docs.flowdeck.studio/cli/interactive/tools-settings/help-support Docs, community, and support channels from the TUI Open Support with `H` to reach the help channels directly: | Option | Action | | - | - | | **Online Documentation** | Opens the FlowDeck docs site for CLI and TUI guides. | | **Discord Community** | Opens the FlowDeck Discord server for discussion and troubleshooting. | | **Email Support** | Opens an email draft to FlowDeck support with basic context. | # Project Tools Source: https://docs.flowdeck.studio/cli/interactive/tools-settings/project-commands Project utilities, package management, and configuration export Open Project Tools from the Project Tools menu (`P`) to access project-level utilities: | Option | Action | | - | - | | **Swift Packages** | Open the Swift Packages submenu for dependency management (see [Manage Swift Packages](/cli/interactive/tools-settings/swift-packages)). | | **Sync Provisioning Profiles** | Refresh signing assets for the selected scheme. | | **Export Project Config** | Write the current workspace/scheme/target/config as an explicit command config JSON file for CLI reuse. | | **Open in Xcode** | Open the current workspace or project in Xcode. | ## Related Project Tools If you need to create a project or switch schemes/configurations, use: | Task | Where to go | | - | - | | **Create a Project** | [Working with Projects](/cli/interactive/working-with-projects#creating-a-project) | | **Select Scheme / Build Config** | [Build Settings](/cli/interactive/build-settings) | # Manage Swift Packages Source: https://docs.flowdeck.studio/cli/interactive/tools-settings/swift-packages Resolve, update, and clean Swift Package dependencies Open **Swift Packages** from Project Tools (`P`) to manage dependencies: | Option | Action | | - | - | | **List Installed Packages** | Display all resolved packages and versions for the current project. | | **Add Swift Package** | Add a package by URL and version rule, then select products to link. | | **Resolve Packages** | Re-resolve dependencies based on `Package.resolved`. | | **Update Packages** | Pull the latest compatible versions and refresh `Package.resolved`. | | **Clear Package Cache** | Remove cached package artifacts from DerivedData to fix stale builds. | # Working with Projects Source: https://docs.flowdeck.studio/cli/interactive/working-with-projects Create a new project or open an existing one in interactive mode Interactive mode starts by letting you either scaffold a brand new app or open an existing workspace/project. ## Watch the Demo [YouTube video player](https://www.youtube.com/embed/FK1dwJPkCiI) ## Creating a Project When FlowDeck can't detect an existing project or you select **Create Project** from the setup assistant, it walks you through: 1. **Create a SwiftUI-based project** (FlowDeck uses its built-in SwiftUI template). 2. **Name the app** and confirm the bundle identifier. 3. **Select platforms** (iOS, macOS, visionOS) for the new project. 4. FlowDeck scaffolds the project, opens it, and immediately moves into scheme/target selection so you can start building. You can run the same flow later via `flowdeck project create`. Multi-platform targets are only usable when the corresponding Xcode SDKs are installed. ## Opening a Project Choose **Open Existing** (or launch interactive mode inside a folder containing an Xcode project) and let FlowDeck’s assistant guide you through each step: 1. **Select Project** - choose the `.xcworkspace` or `.xcodeproj`. 2. **Detect Schemes** - FlowDeck scans the project, then you select a scheme. 3. **Detect Targets** - pick a simulator, device, or Mac destination. 4. **Detect Configurations** - select Debug, Release, or any custom config. 5. **Setup Complete** - press any key to enter interactive mode. Every selection persists across sessions so reopening interactive mode restores the same context. When multiple workspaces exist, FlowDeck prompts you to choose which one to open before schemes appear. ## Saved Context Interactive mode automatically saves your selections so you can resume without reconfiguring: * Workspace path * Selected scheme * Selected simulator/device * Build configuration * Log streaming preference * Recent tests ## Export Project Config Use **Export Project Config** from Project Tools to save the current workspace/scheme/target/config as an explicit command config JSON file for reuse with `--config`. # Log Streaming Source: https://docs.flowdeck.studio/cli/logging Stream real-time logs from your running apps FlowDeck CLI can stream real-time app logs from your running apps, making it easy to monitor `print`, stderr, and OSLog output without switching to Console.app. ## Streaming Logs ### Run with Log Streaming The easiest way to stream logs is to use the `--log` flag when running: ```bash theme={null} flowdeck run --workspace MyApp.xcworkspace --simulator "iPhone 16" --log ``` This builds, runs, and immediately starts streaming logs from your app. The same flow works for simulators, macOS apps, and physical devices launched by FlowDeck. ### Stream Logs from Running App If your app is already running, use the `apps` and `logs` commands: ```bash theme={null} # List running apps flowdeck apps # Stream logs from an app flowdeck logs ``` **Example:** ```bash theme={null} $ flowdeck apps Running Apps: abc123 com.example.MyApp iPhone 16 Pro def456 com.example.Test iPad Pro Use 'flowdeck logs ' to stream logs Use 'flowdeck stop ' to stop an app $ flowdeck logs abc123 ``` ## Using OSLog in Your Code FlowDeck captures logs from Apple's unified logging system (OSLog): ```swift theme={null} import os // Create a logger let logger = Logger(subsystem: "com.example.myapp", category: "networking") // Log at different levels logger.debug("Debug: Starting request") logger.info("Info: Request completed") logger.warning("Warning: Slow response detected") logger.error("Error: Request failed") ``` ### Log Levels | Level | Description | | - | - | | `debug` | Detailed debugging information | | `info` | General informational messages | | `warning` | Warning conditions | | `error` | Error conditions | | `fault` | Critical errors | ## Log Output Logs are displayed with color-coded output based on log level when structured level metadata is available: ``` [DEBUG] 10:23:45.123 - Starting network request [INFO] 10:23:45.234 - User logged in successfully [WARN] 10:23:45.345 - API response slow (>2s) [ERROR] 10:23:45.456 - Failed to parse JSON response ``` ## Stopping Log Streaming Press `Ctrl+C` to stop streaming logs. ## Stopping Running Apps Stop an app that was launched by FlowDeck: ```bash theme={null} flowdeck stop ``` ## Platform Notes FlowDeck supports log streaming for: * iOS simulators * macOS apps * physical iOS devices launched by FlowDeck > [!NOTE] > > On physical devices, FlowDeck follows the device console file created during launch. Message bodies are captured from launch onward, including OSLog debug/info/notice/error/fault calls, but OSLog severity metadata is flattened by the device console source. ## Tips > [!TIP] > > Use specific subsystem and category names in your OSLog calls to make filtering easier: > > ```swift theme={null} > let logger = Logger(subsystem: "com.example.myapp", category: "auth") > ``` > [!NOTE] > > Debug-level logs may not appear in Release builds. Use Info level or higher for logs you always want to see. ## Troubleshooting ### No Logs Appearing 1. Ensure the app was launched by FlowDeck 2. Verify the app is still running on the selected simulator, device, or Mac 3. Check that the debug session started successfully ### Too Many Logs FlowDeck automatically filters to your app's process. If you're still seeing too many logs: * Use more specific subsystem/category names * Reduce debug-level logging in your code ### Logs Not Updating If logs stop appearing: 1. Check that the app is still running: `flowdeck apps` 2. Restart log streaming: `flowdeck logs ` # macOS Automation Source: https://docs.flowdeck.studio/cli/macos-automation Overview of FlowDeck's macOS app UI automation FlowDeck ships built-in UI automation for macOS apps so you can drive native interfaces, validate UI state, and capture accessibility trees from the CLI. Use `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: 1. **Accessibility** — allows FlowDeck to read the accessibility tree and inject input. 2. **Screen Recording** — allows FlowDeck to capture window screenshots (macOS 14+). Check and request permissions: ```bash theme={null} flowdeck ui mac check-permissions flowdeck ui mac request-permissions ``` After granting permissions in System Settings > Privacy & Security, restart your terminal for changes to take effect. ## Quick Start ```bash theme={null} # 1) Check permissions flowdeck ui mac check-permissions # 2) List running apps flowdeck ui mac list apps # 3) Start background session capture (trees + screenshots). # Always pass --json so you can parse `latest_screenshot` and # `latest_tree` paths from the response. flowdeck ui mac session start --app "Safari" --json # 4) Drive one interaction (background by default: no cursor capture, no focus steal) flowdeck ui mac click "Downloads" --app "Safari" # 5) Capture visual proof flowdeck ui mac screen --app "Safari" --output /tmp/flowdeck-mac-ui-proof.png # 6) End session flowdeck ui mac session stop ``` > [!NOTE] > > 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. ## Background Mode (the default) Action commands drive the app **without moving your cursor or stealing focus**, and you don't pass a flag to get that. Events are delivered straight to the target app through the accessibility layer (and window-targeted system events for coordinate clicks), so the app doesn't need to be frontmost — you keep working while automation runs. ```bash theme={null} # These run against a backgrounded app; your foreground window keeps focus flowdeck ui mac click "saveButton" --app "MyApp" --by-id flowdeck ui mac type "hello@example.com" --app "MyApp" flowdeck ui mac scroll --direction down --app "MyApp" flowdeck ui mac hotkey "cmd+s" --app "MyApp" ``` To type into a field, focus it first with a tap, then type: ```bash theme={null} flowdeck ui mac click "emailField" --app "MyApp" --by-id flowdeck ui mac type "user@example.com" --app "MyApp" ``` > [!NOTE] > > Both element targets and `--point` coordinates work in the background. An accessibility id or label is still the more robust choice, because coordinates break when the layout shifts. ## Foreground Mode (`--foreground`) `--foreground` opts out: events go to the global event tap, which moves your real cursor and brings the app forward. Five commands have no background path and **refuse to run** without it: | Command | Why it can't run in the background | | - | - | | `drag` | Continuous pointer gesture; the recognizer needs a key window | | `swipe` | Same as `drag` | | `move` | Moving the pointer *is* taking the pointer | | `activate` | Raising an app *is* taking the screen | | `window focus` | Same as `activate` | ```bash theme={null} flowdeck ui mac drag --from 100,200 --to 400,500 --app "MyApp" --foreground ``` > [!WARNING] > > If you are driving FlowDeck from an agent, treat the refusal as a prompt to **ask the user**, not to re-run with `--foreground`. A background action that failed to find its element is a targeting problem — re-read the accessibility tree or use `scroll --until` — and there is deliberately no environment variable or config key that disables the gate for a whole session. > [!NOTE] > > `--background` still parses but is a no-op, kept so existing scripts don't break. Earlier versions had this backwards: foreground was the default and `--background` was opt-in, so one forgotten flag interrupted whatever you were doing. ## 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. ```bash theme={null} flowdeck ui mac session start --app "MyApp" flowdeck ui mac click "nameField" --app "MyApp" --by-id flowdeck ui mac type "John Doe" --app "MyApp" flowdeck ui mac click "emailField" --app "MyApp" --by-id flowdeck ui mac type "john@example.com" --app "MyApp" flowdeck ui mac click "submitButton" --app "MyApp" --by-id flowdeck ui mac wait "Success" --app "MyApp" --timeout 10 flowdeck ui mac screen --app "MyApp" --output /tmp/form-result.png flowdeck ui mac session stop ``` ### 2) Drive a menu-based workflow ```bash theme={null} flowdeck ui mac session start --app "TextEdit" flowdeck ui mac menu list --app "TextEdit" flowdeck ui mac menu click "File > Export as PDF" --app "TextEdit" flowdeck ui mac wait "Save" --app "TextEdit" --timeout 5 flowdeck ui mac session stop ``` ### 3) Window management ```bash theme={null} flowdeck ui mac session start --app "Safari" flowdeck ui mac window list --app "Safari" flowdeck ui mac window move --app "Safari" --to 100,100 flowdeck ui mac window resize --app "Safari" --size 1200,800 flowdeck ui mac window focus --app "Safari" --index 1 --foreground flowdeck ui mac session stop ``` ### 4) Verify a build output visually Build and run your macOS app, then capture its UI: ```bash theme={null} flowdeck run -D "My Mac" flowdeck ui mac session start --app "MyApp" flowdeck ui mac screen --app "MyApp" --output /tmp/current-ui.png flowdeck ui mac session stop ``` Compare `/tmp/current-ui.png` with the expected design and iterate. ## App Targeting The `--app` flag resolves targets in this order: 1. **Numeric** — treated as a PID (e.g., `--app "12345"`) 2. **Contains a dot** — treated as a bundle ID (e.g., `--app "com.apple.Safari"`) 3. **Otherwise** — fuzzy-matched against running app names (e.g., `--app "Safari"`) To see all running GUI apps: ```bash theme={null} flowdeck ui mac list apps flowdeck ui mac list apps --include-agents --include-system ``` ## 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 | Background capture sessions | | Assert | `assert visible/hidden/enabled/disabled/text` | `assert visible/hidden/enabled/disabled/text` | | Scroll | Fraction-based `--distance` | Tick-based `--amount` | | Scroll `--timeout` unit | Milliseconds | **Seconds** | | Scroll until | `scroll --until` | `scroll --until` | | Swipe | Direction argument | `--direction` flag | | Multi-touch | `pinch`, `rotate` | N/A | | Hardware buttons | `flowdeck simulator button home/lock/...` | N/A | | Deep links | `open-url` | N/A | | Appearance | `flowdeck simulator appearance light/dark` | N/A | | Coordinates | Points (normalized) | Screen-absolute points | | Coordinate format | Comma-separated `x,y` | Comma-separated `x,y` (space-separated is rejected) | | `-v` / `--verbose` | Most commands | **Only** `session start` / `session stop` | | `--examples` / `-e` | Supported on every command | Supported on every command | | Permissions | None needed | Accessibility + Screen Recording | ## Performance and Reliability Tips * Prefer accessibility identifiers and use `--by-id` for clicks, finds, and assertions (fastest and most reliable). * For automation loops, start a session and read `latest-tree.json`/`latest.jpg` from disk instead of calling `screen` every step. * For agent loops, run `flowdeck ui mac session start --app "MyApp" --json` to capture tree + screenshots in the background and read from `~/.flowdeck/automation/mac-sessions//` (use `latest.json`, `latest.jpg`, and `latest-tree.json` to find the newest capture). Starting a session stops any active macOS UI session first. * `session start` returns the session directory plus `latest_screenshot` and `latest_tree` paths in JSON. * macOS UI sessions stop automatically when the owner process that started them exits. Set `FLOWDECK_OWNER_PID` to bind a session to a specific owner process. * 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 find` to discover element labels and IDs before interacting. * For smooth scrolling, use `--smooth` on the `scroll` command. * Tune input timing with environment variables: * `FLOWDECK_HID_STABILIZATION_MS` (default 25) for click/gesture stability * `FLOWDECK_TYPE_DELAY_MS` (default 1) for typing speed > [!TIP] > > For the complete command list and flags, see the [macOS UI Automation command reference](/cli/commands/ui/mac-automation). # Managing Simulators Source: https://docs.flowdeck.studio/cli/simulators Manage iOS simulators from the command line FlowDeck CLI provides comprehensive simulator management capabilities, allowing you to list, create, rename, boot, and manage iOS simulators without leaving your terminal. ```bash theme={null} # Show the simulator command overview and common workflows flowdeck simulator --examples ``` ## Managing Simulators ### List All Simulators ```bash theme={null} flowdeck simulator list ``` ### Filter by Platform ```bash theme={null} flowdeck simulator list --platform iOS flowdeck simulator list --platform tvOS flowdeck simulator list --platform watchOS flowdeck simulator list --platform visionOS ``` ### Show Only Available Simulators ```bash theme={null} flowdeck simulator list --available-only ``` ### JSON Output ```bash theme={null} flowdeck simulator list --json ``` **Example output:** ```json theme={null} [ { "name": "iPhone 16 Pro", "udid": "12345678-1234-1234-1234-123456789ABC", "platform": "iOS", "osVersion": "18.0", "state": "Booted", "isAvailable": true, "lastBootedAt": 800955104, "deviceTypeIdentifier": "com.apple.CoreSimulator.SimDeviceType.iPhone-16-Pro", "runtimeIdentifier": "com.apple.CoreSimulator.SimRuntime.iOS-18-0" }, { "name": "iPhone 16", "udid": "23456789-2345-2345-2345-23456789ABCD", "platform": "iOS", "osVersion": "18.0", "state": "Shutdown", "isAvailable": true, "deviceTypeIdentifier": "com.apple.CoreSimulator.SimDeviceType.iPhone-16", "runtimeIdentifier": "com.apple.CoreSimulator.SimRuntime.iOS-18-0" } ] ``` ## Booting & Shutting Down ### Boot a Simulator ```bash theme={null} flowdeck simulator boot ``` ### Shutdown a Simulator ```bash theme={null} flowdeck simulator shutdown ``` ### Open Simulator.app ```bash theme={null} flowdeck simulator open ``` ## Creating Simulators ### Create a New Simulator ```bash theme={null} flowdeck simulator create \ --name "My Test iPhone" \ --device-type "iPhone 15 Pro" \ --runtime "iOS 17.2" ``` ### Find Available Options ```bash theme={null} # List available device types flowdeck simulator device-types # List installed runtimes flowdeck simulator runtime list # List downloadable runtimes flowdeck simulator runtime available ``` > [!TIP] > > See [Runtimes](/cli/simulators/runtimes) for install/remove workflows and the [full runtime command reference](/cli/commands/simulator/runtimes). ## Cloning Simulators Duplicate an existing simulator with all its settings and data: ```bash theme={null} flowdeck simulator clone "iPhone 16 Pro" -n "iPhone 16 Pro Copy" ``` ### Clone by UDID ```bash theme={null} flowdeck simulator clone A7D19B36-1234-5678-ABCD-123456789ABC -n "My Clone" ``` ### Use the Clone ```bash theme={null} # Boot the clone flowdeck simulator boot "iPhone 16 Pro Copy" # Run your app on it flowdeck run -S "iPhone 16 Pro Copy" ``` > [!TIP] > > Cloning is faster than creating a new simulator when you want an identical copy of a configured environment, including installed apps, saved state, and settings. ## Renaming Simulators Change a simulator's display name without creating a new device. The UDID stays the same, so saved destinations, scripts, and `flowdeck config` entries that use the UDID keep working. ```bash theme={null} # Rename by current name flowdeck simulator rename "iPhone 16" "My CI Device" # Rename by UDID flowdeck simulator rename A7D19B36-1234-5678-ABCD-123456789ABC "My iPhone" # JSON output flowdeck simulator rename "iPhone 16" "My CI Device" --json ``` ```bash theme={null} flowdeck simulator rename --examples ``` **JSON output:** ```json theme={null} { "success": true, "type": "simulator_rename", "udid": "A7D19B36-1234-5678-ABCD-123456789ABC", "name": "My CI Device" } ``` A successful rename emits a simulator catalog-change wakeup so the macOS app's destination pickers refresh. > [!TIP] > > Prefer renaming by UDID when more than one simulator shares the same name. `flowdeck simulator list --json` is the source for the UDID. ## Deleting Simulators ### Delete by UDID ```bash theme={null} flowdeck simulator delete ``` ### Delete Unavailable Simulators Remove all simulators that are no longer available: ```bash theme={null} flowdeck simulator delete --unavailable ``` ### Prune Stale Simulators Delete simulators that have never been booted, have not been booted in 90+ days, or are unavailable: ```bash theme={null} flowdeck simulator prune ``` ## Screenshots Capture a screenshot (and accessibility tree when needed) via UI automation: ```bash theme={null} # Start background session capture (trees + screenshots) flowdeck ui simulator session start # One-off screenshot + accessibility tree flowdeck ui simulator screen # Tree-only output (no screenshot bytes) flowdeck ui simulator screen --tree --json ``` > [!TIP] > > See [UI Automation](/cli/commands/ui/automation) for more screenshot options, including `--optimize` for AI-friendly output. ## Related: UI Automation (Core Feature) FlowDeck's UI automation is a core CLI feature (not a simulator subcommand) that targets iOS simulators. See the [UI Automation overview](/cli/ui-automation) for examples and the [full command reference](/cli/commands/ui/automation) for all commands and flags. ## iPhone Duo Use `flowdeck simulator pose` to fold or unfold an iPhone Duo simulator, set an exact hinge angle, or read its physical pose. > [!NOTE] > > Duo commands require FlowDeck CLI 1.32.0 or later, Xcode 27.1 or later, and an iPhone Duo simulator. Renaming a regular iPhone simulator to "iPhone Duo" does not add Duo support. ### Select a Duo simulator List your simulators, then boot the Duo you want to control: ```bash theme={null} flowdeck simulator list --available-only flowdeck simulator boot "iPhone Duo" ``` Replace `"iPhone Duo"` in the examples with your Duo simulator's name or UDID. Use the UDID if multiple simulators share the same name. ### Set a pose or hinge angle ```bash theme={null} # Choose a named pose flowdeck simulator pose set closed --simulator "iPhone Duo" flowdeck simulator pose set partially-folded --simulator "iPhone Duo" flowdeck simulator pose set open --simulator "iPhone Duo" # Set an exact angle from 0° through 180° flowdeck simulator pose set angle 90 --simulator "iPhone Duo" # Preview a change without applying it flowdeck simulator pose set angle 45 --simulator "iPhone Duo" --dry-run # Return the mutation result as JSON flowdeck simulator pose set angle 130 --simulator "iPhone Duo" --json ``` | Pose | Hinge angle | | - | -: | | `closed` | 0° | | `partially-folded` | 130° | | `open` | 180° | ### Read or monitor the pose ```bash theme={null} # Read one physical pose sample flowdeck simulator pose get --simulator "iPhone Duo" # Read one sample as JSON flowdeck simulator pose get --simulator "iPhone Duo" --json # Stream samples until Control-C flowdeck simulator pose get --simulator "iPhone Duo" --stream --json # Sample every quarter second and report changes of at least 2° flowdeck simulator pose get --simulator "iPhone Duo" \ --stream --interval 0.25 --change-threshold 2 --json ``` Streaming JSON uses one `simulator_duo_pose` object per line (NDJSON). `--interval` and `--change-threshold` require `--stream`; the defaults are `0.1` seconds and `0` degrees. > [!NOTE] > > Pose monitoring reads an independent physical hinge feed. A sample is not confirmation that a preceding `pose set` command has been applied. Use `flowdeck simulator orientation` for screen rotation. Folding and rotation are separate controls. The former `simulator hinge` command is not an alias; use `simulator pose` in scripts. See the [pose command reference](/cli/commands/simulator/pose) for all options and error behavior. ## Device Orientation ### Get Current Orientation ```bash theme={null} # Plain text (default — no subcommand needed) flowdeck simulator orientation -S "iPhone 16" # JSON output flowdeck simulator orientation -S "iPhone 16" --json # Explicit subcommand flowdeck simulator orientation get -S "iPhone 16" --json ``` Reads the physical orientation directly from the simulator — no Accessibility or Screen Recording permissions required. Reflects changes from both programmatic rotation and manual rotation via the Simulator app's Hardware menu. Possible values: `portrait`, `portrait-upside-down`, `landscape-left`, `landscape-right` **Example JSON output:** ```json theme={null} { "schema": "flowdeck.simulator", "schemaVersion": "1.0.0", "success": true, "type": "orientation_get", "orientation": "landscape-left", "udid": "12345678-1234-1234-1234-123456789ABC" } ``` ### Set Orientation ```bash theme={null} flowdeck simulator orientation set portrait -S "iPhone 16" flowdeck simulator orientation set landscape-left -S "iPhone 16" flowdeck simulator orientation set landscape-right -S "iPhone 16" flowdeck simulator orientation set portrait-upside-down -S "FlowDeck-Diag-iPad" # JSON output flowdeck simulator orientation set landscape-left -S "iPhone 16" --json # Send the rotation event and return immediately flowdeck simulator orientation set landscape-left -S "iPhone 16" --no-wait ``` Sends a rotation event to the simulator and, by default, polls until the physical and visual orientation match the requested value (up to 30 seconds). Returns the confirmed orientation, not just the requested one, and sets `confirmed: true` in JSON output once verified. Pass `--no-wait` when you want the command to return as soon as the rotation event is delivered. This is useful for UI surfaces that rotate their local simulator frame immediately and do not need to block on CoreSimulator's delayed visual confirmation. `success` stays `true` on this path since the event was dispatched without error, but `confirmed` is always `false` — nothing was verified. > [!NOTE] > > Rotation only takes effect if the front-most app supports the target orientation. If the app does not support the requested orientation, the command reports the orientation that was actually applied. > [!WARNING] > > `portrait-upside-down` is not supported on iPhone simulators. Use an iPad simulator for upside-down orientation checks. ## Hardware and Debug Controls ```bash theme={null} # Hardware buttons flowdeck simulator button home -S "iPhone 16" flowdeck simulator button swipe-home -S "iPhone 16" flowdeck simulator button app-switcher -S "iPhone 16" flowdeck simulator button side-button --hold 1.0 -S "iPhone 16" flowdeck simulator button siri -S "iPhone 16" # Runtime diagnostics flowdeck simulator memory-warning -S "iPhone 16" flowdeck simulator ca-debug blended on -S "iPhone 16" flowdeck simulator ca-debug offscreen off -S "iPhone 16" ``` Supported CoreAnimation debug options: `blended`, `copies`, `misaligned`, `offscreen`, `slow-animations`. ## Accessibility & Localization ### Dynamic Type (Content Size) ```bash theme={null} # Read the current content size category flowdeck simulator content-size -S "iPhone 16" flowdeck simulator content-size get -S "iPhone 16" --json # Set a category flowdeck simulator content-size set large -S "iPhone 16" flowdeck simulator content-size set accessibility-extra-large -S "iPhone 16" # Step one category larger or smaller flowdeck simulator content-size set increment -S "iPhone 16" flowdeck simulator content-size set decrement -S "iPhone 16" # Reset to the iOS default (large) flowdeck simulator content-size reset -S "iPhone 16" ``` Valid categories: `extra-small`, `small`, `medium`, `large`, `extra-large`, `extra-extra-large`, `extra-extra-extra-large`, `accessibility-medium`, `accessibility-large`, `accessibility-extra-large`, `accessibility-extra-extra-large`, `accessibility-extra-extra-extra-large`. Takes effect immediately for apps that honor `UIContentSizeCategory`. ### Increase Contrast ```bash theme={null} flowdeck simulator increase-contrast -S "iPhone 16" flowdeck simulator increase-contrast set enabled -S "iPhone 16" flowdeck simulator increase-contrast set disabled -S "iPhone 16" flowdeck simulator increase-contrast reset -S "iPhone 16" # Back to disabled ``` ### Language & Locale ```bash theme={null} # Read the current language and locale flowdeck simulator language -S "iPhone 16" flowdeck simulator language get -S "iPhone 16" --json # Switch the system language (locale follows the language code) flowdeck simulator language set fr -S "iPhone 16" # Switch language and locale explicitly flowdeck simulator language set de --locale de_DE -S "iPhone 16" # Reset to the device default language/locale flowdeck simulator language reset -S "iPhone 16" ``` > [!NOTE] > > Changing or resetting the language reboots a booted simulator automatically so the change takes effect across the system. A shut-down simulator applies the change on its next boot. Appearance also supports `flowdeck simulator appearance reset` (back to light). ### Reduce Motion ```bash theme={null} flowdeck simulator reduce-motion -S "iPhone 16" flowdeck simulator reduce-motion set enabled -S "iPhone 16" flowdeck simulator reduce-motion set disabled -S "iPhone 16" flowdeck simulator reduce-motion reset -S "iPhone 16" # Back to disabled ``` ### Reduce Transparency ```bash theme={null} flowdeck simulator reduce-transparency -S "iPhone 16" flowdeck simulator reduce-transparency set enabled -S "iPhone 16" flowdeck simulator reduce-transparency set disabled -S "iPhone 16" flowdeck simulator reduce-transparency reset -S "iPhone 16" # Back to disabled ``` ### Show Borders ```bash theme={null} flowdeck simulator show-borders -S "iPhone 16" flowdeck simulator show-borders set enabled -S "iPhone 16" flowdeck simulator show-borders set disabled -S "iPhone 16" flowdeck simulator show-borders reset -S "iPhone 16" # Back to disabled ``` Highlights button shapes on system controls, matching Settings ▸ Accessibility ▸ Display & Text Size ▸ Button Shapes. ### VoiceOver ```bash theme={null} flowdeck simulator voiceover -S "iPhone 16" flowdeck simulator voiceover set enabled -S "iPhone 16" flowdeck simulator voiceover set disabled -S "iPhone 16" flowdeck simulator voiceover reset -S "iPhone 16" # Back to disabled ``` ### Color Filter ```bash theme={null} flowdeck simulator color-filter -S "iPhone 16" flowdeck simulator color-filter set grayscale -S "iPhone 16" flowdeck simulator color-filter set deuteranopia --intensity 0.75 -S "iPhone 16" flowdeck simulator color-filter set off -S "iPhone 16" flowdeck simulator color-filter reset -S "iPhone 16" # Back to off ``` Valid filters: `off`, `grayscale`, `protanopia`, `deuteranopia`, `tritanopia`. `--intensity` accepts 0.25-1.0 and is not valid for `grayscale`. ### Liquid Glass ```bash theme={null} flowdeck simulator liquid-glass -S "iPhone 16" flowdeck simulator liquid-glass set --opacity 0.8 -S "iPhone 16" flowdeck simulator liquid-glass set --opacity 0.4 --look-and-feel tinted -S "iPhone 16" flowdeck simulator liquid-glass reset -S "iPhone 16" # Back to 0.5 opacity, clear look ``` `--opacity` accepts 0.0-1.0. `--look-and-feel` accepts `clear` or `tinted`. ## Audio ```bash theme={null} # Read the current audio output, input, and volume flowdeck simulator audio -S "iPhone 16" flowdeck simulator audio get -S "iPhone 16" --json # Set the volume (0-100) flowdeck simulator audio set --volume 80 -S "iPhone 16" # Pin output/input to a specific host device flowdeck simulator audio set --output BuiltInSpeakerDevice -S "iPhone 16" flowdeck simulator audio set --output systemDefault --input systemDefault -S "iPhone 16" # Reset to defaults (systemDefault output/input, 60% volume) flowdeck simulator audio reset -S "iPhone 16" # List the host audio devices a simulator can pin to flowdeck simulator audio devices flowdeck simulator audio devices --json ``` `--output` and `--input` accept `systemDefault` or a device UID from `flowdeck simulator audio devices`. `--volume` accepts an integer 0-100. At least one of `--output`, `--input`, or `--volume` is required for `set`. > [!NOTE] > > Reduce Motion, Reduce Transparency, Show Borders, VoiceOver, Color Filter, Liquid Glass, and Audio apply immediately to a booted simulator without a reboot. The same nine settings are also reachable from the FlowDeck macOS app's simulator panel, under the Settings menu. ## Status Bar Overrides Force fixed status bar values — handy for clean App Store screenshots and deterministic UI tests. ```bash theme={null} # Classic 9:41, full bars, full battery flowdeck simulator status-bar override --time "9:41" --wifi-bars 3 --cellular-bars 4 --battery-level 100 --battery-state charged -S "iPhone 16" # Custom carrier and network flowdeck simulator status-bar override --data-network 5g --operator-name "FlowDeck" -S "iPhone 16" # Inspect and clear flowdeck simulator status-bar list -S "iPhone 16" flowdeck simulator status-bar clear -S "iPhone 16" ``` Flags: `--time`, `--data-network`, `--wifi-mode`, `--wifi-bars`, `--cellular-mode`, `--cellular-bars`, `--operator-name`, `--battery-state`, `--battery-level`. At least one is required. ## Push Notifications Deliver a simulated remote push from a JSON payload — no APNs required. ```bash theme={null} flowdeck simulator push payload.json --bundle-id com.example.App -S "iPhone 16" # Bundle id can come from the payload instead flowdeck simulator push payload.json -S "iPhone 16" ``` ```json theme={null} { "Simulator Target Bundle": "com.example.App", "aps": { "alert": "Hello from FlowDeck", "badge": 1 } } ``` The payload must contain an `aps` key and be 4096 bytes or less. ## Privacy Permissions Pre-grant, revoke, or reset app permissions so UI tests don't hit system prompts. ```bash theme={null} flowdeck simulator privacy grant photos -b com.example.App -S "iPhone 16" flowdeck simulator privacy revoke location -b com.example.App -S "iPhone 16" flowdeck simulator privacy reset all -S "iPhone 16" ``` Services: `all`, `calendar`, `contacts`, `contacts-limited`, `location`, `location-always`, `photos`, `photos-add`, `media-library`, `microphone`, `motion`, `reminders`, `siri`. `grant`/`revoke` require `--bundle-id`; `reset` does not. ## Pasteboard ```bash theme={null} flowdeck simulator pasteboard set "Hello world" -S "iPhone 16" flowdeck simulator pasteboard get -S "iPhone 16" flowdeck simulator pasteboard clear -S "iPhone 16" ``` ## Keychain ```bash theme={null} flowdeck simulator keychain reset -S "iPhone 16" flowdeck simulator keychain add-cert ./cert.pem -S "iPhone 16" flowdeck simulator keychain add-cert ./root.pem --root -S "iPhone 16" ``` ## Watch + Phone Pairing Pair a watch and phone simulator for WatchConnectivity (`WCSession`) testing. ```bash theme={null} # Create and activate a pair (watch first, then phone — name or UDID) flowdeck simulator pair create "Apple Watch Series 10 (46mm)" "iPhone 16" --activate # Inspect pairs and their active state (list is the default subcommand) flowdeck simulator pair list flowdeck simulator pair list --json # Re-activate or remove a pair (use the pair UDID from `pair list`) flowdeck simulator pair activate flowdeck simulator pair delete ``` > [!NOTE] > > The watch and phone must have compatible runtimes (e.g. watchOS 11 + iOS 18). `--activate` makes the new pair the active pair; a freshly created pair is already active, so re-activating is a no-op. `WCSession` delivery between simulators can be unreliable regardless of pairing — pairing only ensures a connectable pair exists. ### Launch an embedded Watch companion When an iOS app embeds a Watch app at `Host.app/Watch/*.app`, you can launch that companion on a paired watch simulator without re-running the iPhone app: ```bash theme={null} flowdeck simulator companion launch \ --phone "iPhone 16" \ --app /path/to/Host.app/Watch/MyWatch.app \ --json ``` FlowDeck resolves or auto-creates a compatible watch+phone pair, boots the watch if needed, installs the watch app when it is not already present, and launches it. A plain `flowdeck run` of the iPhone target only detects the embedded Watch product; it does not launch the watch until this command (or the macOS simulator panel header toggle) is used. ## App Inspection ```bash theme={null} # Path to an installed app's container flowdeck simulator app container com.example.App -S "iPhone 16" flowdeck simulator app container com.example.App --container data -S "iPhone 16" # App info (operates on one app) flowdeck simulator app info com.example.App -S "iPhone 16" # Enumerate all installed apps (separate, flat command) flowdeck simulator list-apps -S "iPhone 16" ``` ## Cache Management ### Clear Simulator Cache ```bash theme={null} flowdeck simulator clear-cache ``` ### Erase Simulator Contents Reset a simulator to factory state: ```bash theme={null} flowdeck simulator erase ``` > [!WARNING] > > Erasing a simulator deletes all apps, data, and settings. This cannot be undone. ## CI/CD Usage ### Boot Simulator Before Tests ```bash theme={null} # Get UDID from list UDID=$(flowdeck simulator list --platform iOS --json | jq -r '.[0].udid') # Boot if not already running flowdeck simulator boot "$UDID" # Run tests flowdeck test --workspace MyApp.xcworkspace --simulator "iPhone 16" ``` ### Create Fresh Simulator for CI ```bash theme={null} # Create a clean simulator flowdeck simulator create \ --name "CI-iPhone" \ --device-type "iPhone 16" \ --runtime "iOS 18.0" \ --json # Run tests flowdeck test --workspace MyApp.xcworkspace --simulator "CI-iPhone" # Delete when done flowdeck simulator delete "CI-iPhone" ``` ## JSON Output Examples ### simulator list --json ```json theme={null} [ { "udid": "12345678-1234-1234-1234-123456789ABC", "name": "iPhone 16 Pro", "platform": "iOS", "osVersion": "18.0", "state": "Booted", "isAvailable": true, "lastBootedAt": 800955104, "deviceTypeIdentifier": "com.apple.CoreSimulator.SimDeviceType.iPhone-16-Pro", "runtimeIdentifier": "com.apple.CoreSimulator.SimRuntime.iOS-18-0" } ] ``` ### simulator runtime list --json ```json theme={null} [ { "identifier": "com.apple.CoreSimulator.SimRuntime.iOS-18-0", "name": "iOS 18.0", "version": "18.0", "build": "22A3354", "platform": "iOS", "isAvailable": true } ] ``` ## Troubleshooting ### Simulator Won't Boot Try erasing and rebooting: ```bash theme={null} flowdeck simulator erase flowdeck simulator boot ``` ### Simulator Not Found Verify the simulator exists and get its UDID: ```bash theme={null} flowdeck simulator list --json | jq '.[] | {name, udid}' ``` ### Old Runtimes Check for available runtimes and update Xcode if needed: ```bash theme={null} flowdeck simulator runtime list ``` # Runtimes Source: https://docs.flowdeck.studio/cli/simulators/runtimes Install and manage simulator runtimes Runtimes are the OS images (iOS, tvOS, watchOS, visionOS) that simulators use. You need a runtime installed before you can create or boot simulators for that platform. ## Core Actions | Action | Command | | - | - | | List installed runtimes | `flowdeck simulator runtime list` | | See downloadable runtimes | `flowdeck simulator runtime available` | | Install a runtime | `flowdeck simulator runtime install iOS 18.1` | | Remove a runtime | `flowdeck simulator runtime delete "iOS 17.2"` | | Remove one exact build | `flowdeck simulator runtime delete --build 24A5390f` | | Prune simulators for a runtime | `flowdeck simulator runtime prune "iOS 18.0"` | > [!WARNING] > > Several builds of one OS version share a runtime identifier. Without `--build`, > delete removes whichever of them `simctl` lists first — which may not be the one > you meant. > [!TIP] > > See the [Runtimes command reference](/cli/commands/simulator/runtimes) for all flags and filters. # Testing Source: https://docs.flowdeck.studio/cli/testing Run unit and UI tests from the command line FlowDeck CLI provides comprehensive test execution capabilities, making it easy to run tests from the terminal or integrate into CI/CD pipelines. ## Quick Start After running `flowdeck config set`, workspace, scheme, and simulator are saved to project state. Run tests with: ```bash theme={null} flowdeck test ``` To make headless simulator execution explicit for an app-hosted or agent workflow: ```bash theme={null} flowdeck test --headless ``` Simulator tests already run without opening Simulator.app. The flag records the caller's intent and is ignored for macOS and physical-device targets. > [!NOTE] > > `flowdeck config set` saves runtime selection state. If you pass `--config`, that uses the explicit command config format, which is separate from `.flowdeck/config.json` and `.flowdeck/config.local.json`. ## Running All Tests ```bash theme={null} # With saved settings (after config set) flowdeck test # Or specify settings directly flowdeck test -w MyApp.xcworkspace -s MyScheme -S "iPhone 16" ``` ## Running Tests on macOS Use `--device "My Mac"` for macOS-only test targets: ```bash theme={null} flowdeck test -D "My Mac" ``` ## Filtering Tests ### By Test Target Run specific test targets: ```bash theme={null} flowdeck test --test-targets MyAppTests # Multiple targets flowdeck test --test-targets "MyAppTests,MyAppUITests" ``` ### By Test Class or Method The `--only` option supports flexible matching: ```bash theme={null} # Run all tests in a target/class flowdeck test --only MyAppTests/LoginTests # Run a specific test method flowdeck test --only MyAppTests/LoginTests/testValidLogin # Run a top-level Swift Testing function (no synthetic class segment) flowdeck test --only 'MyAppTests/topLevelTest()' # Full test path with spaces (use quotes) flowdeck test --only "MyAppTests/Login Tests/test Login Success" ``` ### Skipping Tests Skip specific tests: ```bash theme={null} flowdeck test --skip MyAppTests/SlowIntegrationTests flowdeck test --skip MyAppTests/IntegrationTests ``` ## Test Plans Run a specific test plan by name or by path: ```bash theme={null} flowdeck test --plan "Smoke" flowdeck test --plan "TestPlans/Smoke.xctestplan" flowdeck test --plan "Smoke" --only MyAppTests/LoginTests ``` Filters are resolved against the active plan. A test selected by `Smoke` can be run with `--only` or `--test-cases` even when another plan skips it. Without `--plan`, FlowDeck uses the scheme's default test plan. If a selected plan is not attached to the scheme, its referenced file is missing, or the plan is malformed, FlowDeck stops before test execution and points to `flowdeck test plans` for the available plan names. ### List Test Plans List test plans referenced by a scheme (no build required): ```bash theme={null} # After config set flowdeck test plans # Explicit parameters flowdeck test plans -w MyApp.xcworkspace -s MyScheme # JSON output for tooling flowdeck test plans --json ``` ## Test Discovery Discover all available tests before running. Test discovery uses static source parsing (like Xcode's Test Navigator) and does not require building the project. ```bash theme={null} # After config set, discover tests with saved settings flowdeck test discover # Or specify settings directly flowdeck test discover -w MyApp.xcworkspace -s MyScheme # JSON format for tooling flowdeck test discover --json # Filter by name flowdeck test discover --filter Login flowdeck test discover -F Login # Discover the tests enabled by a specific plan flowdeck test discover --plan Smoke # Include tests that are skipped in the scheme or test plan flowdeck test discover --include-skipped-tests ``` By default, tests disabled by the scheme's default plan (or the plan selected with `--plan`) are excluded from discovery results. Use `--include-skipped-tests` to show excluded and unselected tests marked as skipped in the output. When `--plan` is present on both the parent `test` command and the `discover` subcommand, the value after `discover` wins. Plan-selection failures are not silently ignored. **Example output:** ``` 🧪 Tests in MyScheme LoginTests - testValidLogin LoginTests.swift:23 - testInvalidPassword LoginTests.swift:45 CartTests - testAddItem CartTests.swift:12 - testRemoveItem CartTests.swift:34 Total: 4 test(s) in 2 class(es) ``` **With `--include-skipped-tests`:** ``` 🧪 Tests in MyScheme LoginTests - testValidLogin LoginTests.swift:23 - testInvalidPassword LoginTests.swift:45 - testSlowIntegration LoginTests.swift:67 (skipped) CartTests - testAddItem CartTests.swift:12 - testRemoveItem CartTests.swift:34 Total: 5 test(s) in 2 class(es) (1 skipped) ``` **JSON output with skipped tests:** ```json theme={null} { "tests": [ { "target": "MyAppTests", "class": "LoginTests", "method": "testSlowIntegration", "identifier": "MyAppTests/LoginTests/testSlowIntegration", "file": "LoginTests.swift", "filePath": "/path/to/LoginTests.swift", "lineNumber": 67, "isSkipped": true } ] } ``` ## JSON Output For CI/CD integration, use JSON output: ```bash theme={null} flowdeck test --json ``` **Example JSON output:** ```json theme={null} {"type":"test_started","data":{"testId":"LoginTests/testValidLogin"}} {"type":"test_passed","data":{"testId":"LoginTests/testValidLogin","duration":0.123}} {"type":"test_failed","data":{"testId":"LoginTests/testInvalidPassword","failure_message":"Expected failure but got success"}} {"schema":"flowdeck.test","schemaVersion":"1.1.0","success":false,"totalTests":2,"passedTests":1,"failedTests":1,"skippedTests":0,"resultBundlePath":"/Users/me/.flowdeck/logs/abc123/test.xcresult"} ``` The final `flowdeck.test` object is authoritative: its totals and verdict come from the finalized xcresult, reconciled with the real xcodebuild status. Live events remain useful for progress and richer failure locations. Any nonzero xcodebuild status—including 65—keeps `success` false. ## Finalized Result Bundles Every real test run saves a finalized bundle to `~/.flowdeck/logs//test.xcresult`. The optional absolute `resultBundlePath` in the final JSON points to that bundle. Supply `-resultBundlePath` through `--xcodebuild-options` to choose another location; the final supplied value wins and applies only to the test phase. Verbose output preserves canonical `** TEST SUCCEEDED **`, `** TEST FAILED **`, and `** TEST EXECUTE FAILED **` verdict lines. Human output also branches on the overall `success` value, so a process or infrastructure failure cannot be labeled as passing merely because zero failed tests were parsed. ## CI/CD Integration ### GitHub Actions Example ```yaml theme={null} name: Tests on: [push, pull_request] jobs: test: runs-on: macos-14 steps: - uses: actions/checkout@v4 - name: Install FlowDeck run: curl -sSL https://flowdeck.studio/install.sh | sh - name: Run Tests env: FLOWDECK_LICENSE_KEY: ${{ secrets.FLOWDECK_LICENSE_KEY }} run: | flowdeck test \ --workspace MyApp.xcworkspace \ --simulator "iPhone 16" \ --json > test-results.json - name: Upload Results uses: actions/upload-artifact@v4 with: name: test-results path: test-results.json ``` ### Parsing Results ```bash theme={null} # Count passed tests flowdeck test --json | \ jq -s '[.[] | select(.type == "test_passed")] | length' # List failed tests flowdeck test --json | \ jq -s '[.[] | select(.type == "test_failed")] | .[].data.testId' # Read the finalized aggregate and bundle path flowdeck test --json | \ jq 'select(.schema == "flowdeck.test") | {success, totalTests, passedTests, failedTests, resultBundlePath}' ``` ## Test Output ### Human-Readable Output ``` 🧪 Running tests... Workspace: MyApp.xcworkspace Scheme: MyApp Configuration: Debug Simulator: iPhone 16 Pro Test Results ============ Total Tests: 45 Passed: 43 ✅ Failed: 2 ❌ Skipped: 0 ⏭️ Duration: 12.34s Failures: ❌ testLoginWithInvalidCredentials: Expected failure but got success ❌ testNetworkTimeout: Async expectation not fulfilled ❌ Some tests failed. ``` ## Tips > [!TIP] > > Use `--json` output in CI/CD for reliable parsing and integration with test reporting tools. > [!NOTE] > > Test discovery uses static source parsing and doesn't require building. It finds `XCTestCase` subclasses, `test*` methods, `@Suite` structs, and `@Test` functions directly from source files. ## Troubleshooting ### Tests Not Discovered Test discovery parses source files directly. If tests aren't found: 1. Ensure test files are in the scheme's test targets 2. Verify test classes inherit from `XCTestCase` or use `@Test`/`@Suite` 3. Check that XCTest methods start with `test` ```bash theme={null} # Verify scheme and targets flowdeck context --json | jq '.schemes' flowdeck test discover --filter "YourTestClass" ``` ### Simulator Issues If tests fail to start, try booting the simulator first: ```bash theme={null} flowdeck simulator list --platform iOS flowdeck simulator boot flowdeck test -S "iPhone 16" ``` # UI Automation Source: https://docs.flowdeck.studio/cli/ui-automation Overview of FlowDeck's UI automation for iOS simulators and macOS apps FlowDeck ships built-in UI automation for **iOS simulators** and **macOS apps** so you can drive screens, validate UI state, and capture accessibility trees from the CLI. * **iOS Simulator**: Use `flowdeck ui simulator` — covered on this page. * **macOS Apps**: Use `flowdeck ui mac` — see [macOS Automation](/cli/macos-automation) for overview and [command reference](/cli/commands/ui/mac-automation) for details. The rest of this page covers iOS simulator automation. Use `flowdeck ui simulator` to run these commands. ## What It Does Use UI automation to: * Capture screenshots and accessibility trees. * Tap elements, type text, and navigate flows. * Wait for UI state changes and assert UI conditions. ## When to Use It * Smoke tests for critical flows. * Scripted demos or QA checks. * AI-driven interaction loops that need consistent UI state. ## Quick Start ```bash theme={null} # 1) Launch app flowdeck run # 2) Start background session capture (trees + screenshots) # Use --json so you can parse latest_screenshot / latest_tree paths. flowdeck ui simulator session start --json # 3) Drive one interaction flowdeck ui simulator tap "Get Started" flowdeck ui simulator wait "Welcome" --timeout 15 # 4) Capture visual proof flowdeck ui simulator screen --output /tmp/flowdeck-ui-proof.png # 5) End session flowdeck ui simulator session stop ``` > [!NOTE] > > If multiple simulators are booted, add `--simulator ""` to each `flowdeck ui simulator ...` command. > [!NOTE] > > `flowdeck ui mac` leaf action commands (click, type, scroll, etc.) accept only `--json` and `-h` — no `-v/--verbose`. `--examples` works on every `ui mac` command, and `ui mac session start` / `session stop` also accept `-v/--verbose`. ## Tangible Workflows ### 1) Build a SwiftUI view from a mockup and verify visually Use this when an agent edits SwiftUI to match an attached image and you want proof after each iteration. ```bash theme={null} flowdeck run flowdeck ui simulator session start --json flowdeck ui simulator screen --output /tmp/current-ui.png flowdeck ui simulator session stop ``` Then compare `/tmp/current-ui.png` with the mockup and repeat until it matches. ### 2) Validate a full login flow like a QA script ```bash theme={null} flowdeck ui simulator session start --json flowdeck ui simulator tap "emailField" --by-id flowdeck ui simulator type "user@example.com" flowdeck ui simulator tap "passwordField" --by-id flowdeck ui simulator type "secret123" --mask flowdeck ui simulator tap "loginButton" --by-id flowdeck ui simulator wait "Home" --timeout 20 flowdeck ui simulator assert visible "Home" flowdeck ui simulator screen --output /tmp/login-result.png flowdeck ui simulator session stop ``` ### 3) Verify deep links end on the right screen ```bash theme={null} flowdeck ui simulator session start --json flowdeck ui simulator open-url "myapp://settings/profile" flowdeck ui simulator wait "Profile" --timeout 20 flowdeck ui simulator assert visible "Profile" flowdeck ui simulator screen --output /tmp/deeplink-profile.png flowdeck ui simulator session stop ``` > [!NOTE] > > If multiple simulators are booted, add `--simulator ""` to each command. ## Orientation Handling FlowDeck detects the physical device orientation automatically before every gesture — no configuration required. * **Portrait vs landscape** is detected from the AX root frame shape (width > height = landscape). * **Portrait-upside-down** is detected from the CoreSimulator backboardd state file. * The correct coordinate transform is applied automatically: portrait (passthrough), portrait-upside-down (180° flip), landscape (90° CCW rotation). ### Orientation in the Accessibility Tree Every `screen --tree --json` call and session snapshot includes an `orientation` field in the `accessibility` object: ```bash theme={null} flowdeck ui simulator screen --tree --json -S "iPhone 16 Pro" ``` ```json theme={null} { "success": true, "type": "ui_snapshot", "accessibility": { "orientation": "landscape-left", "element_count": 44, "frame_space": "points", "tree": [ { "label": "MyApp", "role": "Application", "frame": { "x": 0, "y": 0, "width": 852, "height": 393 }, "visible": true, "enabled": true, "children": [] } ] }, "screenshot": { "captured": false }, "simulator": { "udid": "12345678-1234-1234-1234-123456789ABC", "name": "iPhone 16 Pro", "runtime": "iOS 18.0" } } ``` Possible `orientation` values: `"portrait"`, `"portrait-upside-down"`, `"landscape-left"`, `"landscape-right"`. > [!TIP] > > To read or set the orientation explicitly, use `flowdeck simulator orientation`. See [Managing Simulators](/cli/simulators#device-orientation). ## Performance and Reliability Tips * Prefer accessibility identifiers and use `--by-id` for taps, finds, and assertions (fastest and most reliable). * For automation loops, start a session and read `latest-tree.json`/`latest.jpg` from disk instead of calling `screen` every step. * Use `flowdeck ui simulator screen --tree --json` when you only need a one-off structure snapshot; use `--optimize` if you need a one-off screenshot. * Avoid full screenshots between every action; use `find`/`wait` for state checks instead. * For agent loops, run `flowdeck ui simulator session start -S --json` to capture tree + screenshots in the background and read from `~/.flowdeck/automation/sessions//` (use `latest.json`, `latest.jpg`, and `latest-tree.json` to find the newest capture). Starting a session replaces only an existing session for the same simulator; other simulator sessions keep running. Use `session list --json` to inspect active sessions, `session stop -S ` to stop one, or `session stop --all` to stop every active simulator session. * `session start` outputs the current screen size in points (console) and includes a `screen` object in JSON. * Sessions stop automatically when the owner process that started them exits. Set `FLOWDECK_OWNER_PID` to bind a session to a specific owner process. * Session commands skip malformed active pointer files and reconcile stale pointers for dead recorders, abandoned pending starts, and sessions from a previous system boot, so `list`, `stop`, and `stop --all` remain usable for recovery. * Sessions only write new entries when the tree or screenshot changes; screenshot change detection ignores the volatile top system/status strip so Dynamic Island/status-bar churn does not rewrite idle frames. Saved screenshots are not cropped or masked. Screenshots are stored as JPEG at 50% quality to reduce size. Retention defaults to 60s and always keeps at least one capture. The JSON output includes full paths for the session directory, screens, trees, and latest pointers. * Coordinate geometry is points only. Session screenshots are normalized to point size so image coordinates map 1:1 to points. * 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. * `screen` output sizes are reported in points; JSON includes `point_width`/`point_height` and `pixel_width`/`pixel_height` when available. * For off-screen elements, use `scroll --until "id:yourElement"` before tapping. * `scroll --distance` uses a fraction of the screen (0.05–0.95), not pixels or points. Example: `--distance 0.25`. * Tune speed vs stability with `FLOWDECK_HID_STABILIZATION_MS` and typing speed with `FLOWDECK_TYPE_DELAY_MS`. > [!TIP] > > For the complete command list and flags, see the [iOS UI Automation command reference](/cli/commands/ui/automation) or the [macOS UI Automation command reference](/cli/commands/ui/mac-automation). # Xcodebuild Arguments Source: https://docs.flowdeck.studio/cli/xcodebuild-args Pass custom arguments and environment variables to xcodebuild FlowDeck provides full access to xcodebuild's capabilities through custom arguments and environment variables. You can configure builds using three methods. ## Methods Overview | Method | Best For | Priority | | - | - | - | | [CLI Options](#cli-options) | Quick one-off builds, testing flags | Highest | | [Legacy Local Build Settings](#legacy-local-build-settings) | Compatibility with older project setups | Medium | | [Config File](#config-file) | CI/CD, reproducible builds | Lowest | When multiple sources provide arguments, they're merged with CLI taking highest priority. ## Preferred Project Settings Format For shared project settings, prefer storing xcodebuild passthrough values in: * `.flowdeck/config.json` * `.flowdeck/config.local.json` Example: ```json theme={null} { "xcodebuild": { "args": ["-enableCodeCoverage", "YES"], "env": { "CI": "true" } }, "schemes": { "MyApp": { "xcodebuild": { "args": ["-quiet"], "env": {} } } } } ``` Use the top-level `xcodebuild` block for project-wide defaults, and `schemes..xcodebuild` for per-scheme overrides. ## CLI Options ### Xcodebuild Arguments Use `--xcodebuild-options` to pass arguments to xcodebuild: ```bash theme={null} # Single argument flowdeck build -w App.xcworkspace -s MyApp -S "iPhone 16" \ --xcodebuild-options='-enableCodeCoverage YES' # Multiple arguments flowdeck build -w App.xcworkspace -s MyApp -S "iPhone 16" \ --xcodebuild-options='-enableCodeCoverage YES ONLY_ACTIVE_ARCH=NO GCC_TREAT_WARNINGS_AS_ERRORS=YES' # Build settings (KEY=VALUE format) flowdeck run -w App.xcworkspace -s MyApp -S "iPhone 16" \ --xcodebuild-options='CODE_SIGN_IDENTITY=- CODE_SIGNING_REQUIRED=NO' ``` > [!TIP] > > Use `=` syntax (e.g., `--xcodebuild-options='...'`) when values start with `-` to avoid argument parsing issues. ### Xcodebuild Environment Use `--xcodebuild-env` to set environment variables for the build: ```bash theme={null} flowdeck build -w App.xcworkspace -s MyApp -S "iPhone 16" \ --xcodebuild-env='CI=true DEVELOPER_DIR=/Applications/Xcode-15.4.app/Contents/Developer' ``` ### Combining Options All options can be combined: ```bash theme={null} flowdeck build -w App.xcworkspace -s MyApp -S "iPhone 16" \ --xcodebuild-options='-quiet -enableCodeCoverage YES' \ --xcodebuild-env='CI=true' ``` ### Works with All Commands ```bash theme={null} # Build flowdeck build -w App.xcworkspace -s MyApp -S "iPhone 16" \ --xcodebuild-options='-enableCodeCoverage YES' # Run flowdeck run -w App.xcworkspace -s MyApp -S "iPhone 16" \ --xcodebuild-options='ONLY_ACTIVE_ARCH=YES' # Test flowdeck test -w App.xcworkspace -s MyApp -S "iPhone 16" \ --xcodebuild-options='-parallel-testing-enabled YES' ``` ### Test Result Bundle Routing `flowdeck test` owns one result bundle per xcodebuild phase so each bundle is finalized exactly once: * `build-for-testing` writes `~/.flowdeck/logs//build-test.xcresult`. * `test-without-building` writes `~/.flowdeck/logs//test.xcresult` by default. * A caller-supplied `-resultBundlePath` overrides only the test-phase path. Both `-resultBundlePath ` and `-resultBundlePath=` are accepted. When arguments from multiple sources contain the flag, the last valid value wins. FlowDeck removes the duplicates before invoking xcodebuild and normalizes the selected result to an absolute path. The final `flowdeck.test` JSON snapshot reports that same path as `resultBundlePath`. ## Legacy Local Build Settings Create `.flowdeck/build-settings.json` in your project root for settings that apply to all FlowDeck commands automatically: ```json theme={null} { "args": [ "ONLY_ACTIVE_ARCH=YES", "GCC_TREAT_WARNINGS_AS_ERRORS=YES", "-enableCodeCoverage", "YES" ], "env": { "CUSTOM_BUILD_VAR": "value" } } ``` This file is a legacy compatibility format and is still auto-loaded by current CLI runtime paths. > [!NOTE] > > Prefer `.flowdeck/config.json` or `.flowdeck/config.local.json` for new setup. Keep `.flowdeck/build-settings.json` only when you need compatibility with older workflows. ### Structure | Field | Type | Description | | - | - | - | | `args` | array | Arguments appended to xcodebuild command line | | `env` | object | Environment variables set for xcodebuild process | ## Config File Include xcodebuild settings in your `--config` JSON file: ```json theme={null} { "workspace": "MyApp.xcworkspace", "scheme": "MyApp", "platform": "iOS", "xcodebuild": { "args": [ "-enableCodeCoverage", "YES", "-resultBundlePath", "./build/results.xcresult" ], "env": { "CI": "true" } } } ``` Use with: ```bash theme={null} flowdeck test --config path/to/config.json ``` > [!NOTE] > > `--config` uses the explicit command config format, which is separate from `.flowdeck/config.json` and `.flowdeck/config.local.json`. See [Configuration File](/cli/configuration-file) for the difference. ## Priority and Merging When arguments come from multiple sources, they're combined in this order: 1. **Config file** (lowest priority) - base configuration 2. **Local build-settings.json** - compatibility override for current CLI auto-load behavior 3. **CLI options** (highest priority) - appended last, takes effect **Example:** ```bash theme={null} # Config file has: ONLY_ACTIVE_ARCH=YES # Local settings has: GCC_TREAT_WARNINGS_AS_ERRORS=YES # CLI: --xcodebuild-options='ONLY_ACTIVE_ARCH=NO' # Final xcodebuild args include: # ONLY_ACTIVE_ARCH=YES (from config, overridden) # GCC_TREAT_WARNINGS_AS_ERRORS=YES (from local) # ONLY_ACTIVE_ARCH=NO (from CLI, takes effect because it's last) ``` ## Common Arguments Reference ### Build Settings | Argument | Description | | - | - | | `ONLY_ACTIVE_ARCH=YES` | Build only for active architecture (faster debug builds) | | `ONLY_ACTIVE_ARCH=NO` | Build for all architectures (required for distribution) | | `CODE_SIGN_IDENTITY=-` | Disable code signing | | `CODE_SIGNING_REQUIRED=NO` | Skip code signing requirement | | `GCC_TREAT_WARNINGS_AS_ERRORS=YES` | Fail build on C/Obj-C warnings | | `SWIFT_TREAT_WARNINGS_AS_ERRORS=YES` | Fail build on Swift warnings | ### Xcodebuild Flags | Flag | Description | | - | - | | `-quiet` | Suppress most xcodebuild output | | `-enableCodeCoverage YES` | Enable code coverage collection | | `-resultBundlePath ` | Override the finalized test-phase xcresult path during `flowdeck test`; the last valid value wins | | `-allowProvisioningUpdates` | Allow automatic provisioning updates | | `-allowProvisioningDeviceRegistration` | Allow automatic device registration | | `-parallel-testing-enabled YES` | Enable parallel test execution | | `-parallel-testing-worker-count ` | Number of parallel test workers | ### Compiler Flags | Argument | Description | | - | - | | `OTHER_SWIFT_FLAGS=` | Additional Swift compiler flags | | `OTHER_CFLAGS=` | Additional C compiler flags | | `OTHER_LDFLAGS=` | Additional linker flags | ## Environment Variables Set environment variables for the xcodebuild process: ### Via CLI ```bash theme={null} flowdeck build -w App.xcworkspace -s MyApp -S "iPhone 16" \ --xcodebuild-env='CI=true DEVELOPER_DIR=/Applications/Xcode-15.4.app/Contents/Developer' ``` ### In Local Settings ```json theme={null} { "args": [], "env": { "CI": "true", "DEVELOPER_DIR": "/Applications/Xcode-15.4.app/Contents/Developer" } } ``` ### In Config File ```json theme={null} { "workspace": "MyApp.xcworkspace", "scheme": "MyApp", "xcodebuild": { "env": { "DEVELOPER_DIR": "/Applications/Xcode-15.4.app/Contents/Developer" } } } ``` ### Common Environment Variables | Variable | Description | | - | - | | `CI` | Indicates CI environment (affects some Xcode behaviors) | | `DEVELOPER_DIR` | Override Xcode installation path | | `XCODE_XCCONFIG_FILE` | Path to custom xcconfig file | > [!NOTE] > > The canonical shared project-settings format is `xcodebuild` inside `.flowdeck/config.json` or `.flowdeck/config.local.json`. The separate `build-settings.json` file remains a legacy compatibility input. ## Use Cases > [accordion] Code Coverage > > ```bash theme={null} > flowdeck test -w App.xcworkspace -s MyApp -S "iPhone 16" \ > --xcodebuild-options='-enableCodeCoverage YES -resultBundlePath ./coverage/results.xcresult' > ``` > > Extract coverage after tests: > > ```bash theme={null} > xcrun xccov view --report ./coverage/results.xcresult > ``` > [accordion] Parallel Testing > > ```bash theme={null} > flowdeck test -w App.xcworkspace -s MyApp -S "iPhone 16" \ > --xcodebuild-options='-parallel-testing-enabled YES -parallel-testing-worker-count 4' > ``` > [accordion] CI Build (No Code Signing) > > ```bash theme={null} > flowdeck build -w App.xcworkspace -s MyApp -S "iPhone 16" \ > --xcodebuild-options='CODE_SIGN_IDENTITY=- CODE_SIGNING_REQUIRED=NO' > ``` > [accordion] Use Different Xcode Version > > ```bash theme={null} > flowdeck build -w App.xcworkspace -s MyApp -S "iPhone 16" \ > --xcodebuild-env='DEVELOPER_DIR=/Applications/Xcode-15.4.app/Contents/Developer' > ``` > > Or create `.flowdeck/build-settings.json`: > > ```json theme={null} > { > "args": [], > "env": { > "DEVELOPER_DIR": "/Applications/Xcode-15.4.app/Contents/Developer" > } > } > ``` > [accordion] Strict Warnings > > ```bash theme={null} > flowdeck build -w App.xcworkspace -s MyApp -S "iPhone 16" \ > --xcodebuild-options='GCC_TREAT_WARNINGS_AS_ERRORS=YES SWIFT_TREAT_WARNINGS_AS_ERRORS=YES' > ``` > [accordion] Address Sanitizer > > ```bash theme={null} > flowdeck build -w App.xcworkspace -s MyApp -S "iPhone 16" \ > --xcodebuild-options='"OTHER_SWIFT_FLAGS=-sanitize=address" "OTHER_CFLAGS=-fsanitize=address" "OTHER_LDFLAGS=-fsanitize=address"' > ``` > [accordion] Quiet Build with Coverage (CI) > > ```bash theme={null} > flowdeck test -w App.xcworkspace -s MyApp -S "iPhone 16" \ > --xcodebuild-options='-quiet -enableCodeCoverage YES' \ > --xcodebuild-env='CI=true' > ``` ## Viewing the Final Command Use `--dry-run` to see the complete xcodebuild command with all arguments without executing: ```bash theme={null} flowdeck build -w App.xcworkspace -s MyApp -S "iPhone 16" --dry-run \ --xcodebuild-options='-enableCodeCoverage YES' ``` Use `--verbose` to see the command during actual execution: ```bash theme={null} flowdeck build -w App.xcworkspace -s MyApp -S "iPhone 16" --verbose \ --xcodebuild-options='-enableCodeCoverage YES' ``` ## Troubleshooting ### Values Starting with Dash Use `=` syntax when values start with `-`: ```bash theme={null} # Won't work - ArgumentParser sees -quiet as a new option flowdeck build ... --xcodebuild-options -quiet # Works - use = syntax flowdeck build ... --xcodebuild-options='-quiet -enableCodeCoverage YES' ``` ### Build Settings Format Use `KEY=VALUE` format (no spaces around `=`): ```bash theme={null} # Correct flowdeck build ... --xcodebuild-options='ONLY_ACTIVE_ARCH=YES' # Wrong flowdeck build ... --xcodebuild-options='ONLY_ACTIVE_ARCH = YES' ``` ### JSON Array Format In config files, each argument is a separate array element: ```json theme={null} { "xcodebuild": { "args": ["-enableCodeCoverage", "YES"] } } ``` Not: ```json theme={null} { "xcodebuild": { "args": ["-enableCodeCoverage YES"] } } ``` # FlowDeck for Mac vs FlowDeck CLI Source: https://docs.flowdeck.studio/comparison Choose the right FlowDeck product for your workflow FlowDeck comes in two forms designed for different workflows. Most developers use both. ## Feature Comparison | Feature | FlowDeck for Mac | FlowDeck CLI | | - | - | - | | **Best For** | Day-to-day development | Automation & CI/CD | | **Interface** | Native macOS app | Terminal commands | | **AI Agent** | Built-in | Via skill pack install | | **Build & Run** | ✓ | ✓ | | **Testing** | Visual test results | JSON output for pipelines | | **Simulators** | Visual management | Full command control | | **Physical Devices** | ✓ | ✓ | | **Log Streaming** | Integrated panel | Terminal streaming | | **Source Control** | Built-in | — | | **UI Automation** | Agent-driven | Full command control | | **CI/CD Integration** | — | Designed for pipelines | | **JSON Output** | — | ✓ | ## When to use FlowDeck for Mac > [card] Day-to-day development > > A full IDE experience with a native UI — build, test, and debug without touching the terminal. > [card] AI-assisted development > > The built-in agent handles multi-step tasks in plain language: fix bugs, run tests, automate the UI, commit changes. > [card] Simulator & device management > > Manage simulators and physical devices from a visual panel. > [card] Source control > > Stage, commit, and push without leaving FlowDeck. ## When to use FlowDeck CLI > [card] CI/CD pipelines > > Machine-readable JSON output integrates cleanly with GitHub Actions, GitLab CI, Jenkins, and other pipelines. > [card] Terminal-first workflows > > Keyboard-driven development from the command line, with an interactive TUI mode. > [card] External AI agents > > Install the FlowDeck skill pack to give Claude Code, Codex, or other agents direct access to the Apple toolchain. > [card] Scripting and automation > > Scriptable build and test commands with consistent exit codes and structured output. ## Using both together Many developers use both products: * **FlowDeck for Mac** for day-to-day development — writing code, running the app, testing, debugging * **FlowDeck CLI** for CI/CD pipelines and scripted automation > [!NOTE] > > FlowDeck for Mac and FlowDeck CLI maintain separate configurations and do not share project state. # What is FlowDeck CLI? Source: https://docs.flowdeck.studio/introduction One CLI for Apple app builds, automation, and project management FlowDeck CLI is a single command-line interface for iOS/macOS development, replacing `xcodebuild`, `simctl`, `devicectl`, and other Apple tools with a clean, simple workflow for humans and AI agents like Claude Code and Codex. With `flowdeck`, you can: * Build, run, test, and debug apps from the terminal * Automate development and testing with powerful UI automation workflows * Manage simulators, devices, and live logs in one place * Handle project management tasks (discover workspaces/schemes, save config, create projects) * Plug directly into CI/CD with machine-readable JSON output ## Why FlowDeck CLI? > [card] Terminal-First > > Build, run, and test directly from your terminal without switching to Xcode > [card] CI/CD Ready > > JSON output mode for easy integration with automation pipelines > [card] AI Agent Compatible > > Designed to work seamlessly with Claude Code, Codex, and other AI assistants > [card] Fast Iteration > > Optimized builds with intelligent caching and parallel compilation ## Key Features * **Build & Run** - Compile and launch iOS/macOS apps on simulators or devices * **Test Execution** - Run unit and UI tests with detailed results * **Simulator Management** - Boot, shutdown, and manage iOS simulators * **Device Support** - Deploy and run on physical Apple devices * **Log Streaming** - Real-time OSLog streaming from running apps * **JSON Output** - Machine-readable output for automation and AI agents * **Project Discovery** - Auto-detect workspaces, schemes, and build configurations * **Project Creation** - Generate new Xcode projects from templates with `flowdeck project create` ## Requirements > [!WARNING] > > FlowDeck CLI requires macOS with Xcode installed. It does not support Windows or Linux. * **macOS** 13.0 or later * **Xcode** 15.0 or later (with command line tools) * **Apple Silicon Mac**: M1 or later recommended for best performance ## Quick Start ```bash theme={null} # Install FlowDeck CLI curl -sSL https://flowdeck.studio/install.sh | sh # CD to your macOS or iOS project cd ~/myApp # Start FlowDeck's interactive mode flowdeck -i ``` For interactive development with a GUI-like experience, see [Interactive Mode](/cli/interactive). ### Static CLI Usage (Recommended for Agents) For AI agents and CI/CD, use the `config set` workflow to save project settings: ```bash theme={null} # 1. Discover project structure flowdeck context --json # 2. Initialize with discovered settings flowdeck config set -w MyApp.xcworkspace -s MyApp -S "iPhone 16" # 3. Run commands without parameters flowdeck build # Uses saved settings flowdeck run # Uses saved settings flowdeck test # Uses saved settings flowdeck clean # Uses saved settings ``` > [!TIP] > > After running `flowdeck config set`, all subsequent commands use the saved settings automatically. This is the recommended approach for AI agents and CI/CD pipelines. For complete command documentation, see [Commands Overview](/cli/commands/overview). ```bash theme={null} # Get help flowdeck --help # Show examples for any command flowdeck build --examples ``` ## Getting Help > [card] [Installation Guide](/cli/install) > > Get FlowDeck CLI installed on your Mac > [card] [Command Reference](/cli/commands/overview) > > Complete documentation for all CLI commands > [card] [Support](/support) > > License activation and support options # The AI Agent Source: https://docs.flowdeck.studio/macos/ai-agent Your built-in AI developer — build, test, debug, and automate in plain language FlowDeck includes an AI agent that can drive the full Apple development toolchain from a conversation. Instead of clicking through menus or remembering commands, you describe what you want and the agent does it. ## What the agent can do > [card] [Build & Run](/macos/building) > > Build your app, fix compiler errors, launch on a simulator or device, and stream runtime logs — all from a single prompt. > [card] [Testing](/macos/testing) > > Run your full test suite or specific tests. The agent reads failures, traces them to the source, and fixes bugs in production code or tests. > [card] [UI Automation](/macos/ui-automation) > > The agent sees the simulator screen, taps buttons, types text, scrolls, and captures screenshots to verify results. > [card] [Simulators & Devices](/macos/simulators) > > Boot simulators, install and launch apps on physical devices, manage runtimes and simulator state. ## How to talk to the agent Open the chat panel and type naturally. The agent understands intent — you don't need to know FlowDeck's commands. **Some prompts that work well:** ```text theme={null} Build the app and tell me if there are any warnings. ``` ```text theme={null} Run the LoginTests suite and fix any failures you find. ``` ```text theme={null} Launch the app on iPhone 16, go to the profile screen, and take a screenshot. ``` ```text theme={null} I just added a new feature to the payment flow. Write tests for it. ``` ```text theme={null} The app crashes when I tap the checkout button. Reproduce it and find the cause. ``` ## How it works The agent runs through an installed **Claude Code**, **Codex**, **OpenCode**, **Cursor**, or **Grok Build** CLI. FlowDeck verifies the command and its version on launch, and refreshes availability when the app becomes active after you install or update a CLI. You can see every supported provider under **Settings → AI → Agents**. If an installed CLI is behind the version this FlowDeck build was validated against, or newer in the catalog, an **Update** button appears on that row — and the same control shows during onboarding and above the chat composer when the install is below the pinned floor. Choosing Update runs the provider's own updater in the background; FlowDeck does not open Terminal. The button reads **Updating…** while the process runs, then **Updated** or **Update failed**. A successful update refreshes availability immediately so the button can disappear without waiting for a refresh. Choose **Refresh list**, above the provider list, after installing, moving, or updating a CLI yourself to refresh immediately without relaunching FlowDeck. A temporarily missing CLI becomes unavailable but keeps your enablement preference, so reinstalling it restores your previous choice. Authentication is checked by the provider when you start using it, not during availability detection. When you send a prompt, the agent: 1. Plans the steps needed 2. Runs FlowDeck commands (build, test, UI automation, logs, etc.) 3. Reads the results and adapts — fixing errors, retrying, or asking you for clarification 4. Reports back with a plain-language summary of what it did and what it found The agent shows its work: you can see each action it takes in real time, and the Inspector opens automatically to show issues or test results as they arrive. ## Permissions For actions that can't be undone — pushing to a remote, modifying project settings, running macOS automation that affects your desktop — the agent asks for your approval before proceeding. Configure permission levels in **Settings → AI** (⌘,): * **Ask for everything** — approve every tool call * **Auto-approve safe actions** — builds, tests, and simulator operations run without prompting * **Auto-approve all** — fully autonomous mode; only use when you trust the full context ## Plans For multi-step tasks the agent may propose a plan before starting. A plan card appears in the chat showing the steps it intends to take — review it, edit if needed, then approve to start execution. The plan stays available while implementation runs, so you can keep it open for reference. When executing, **Clean chat** is selected by default. You can instead keep the existing chat and its context, or create a new session with a fresh chat. Creating a new session uses the usual name and project-configuration setup, then starts the approved plan automatically. The planning workspace remains unchanged. ## Tips > [!TIP] > > Give the agent a goal, not a procedure. "Make the login tests pass" works better than "run the tests, then look at the failures, then edit the file." The agent figures out the steps. > [!TIP] > > If the agent gets stuck or goes in the wrong direction, just say so. "Stop, the issue is in the network layer, not the UI" is enough to redirect it. > [!NOTE] > > The **Fix All** button in the Inspector's Issues and Tests tabs sends all current errors or failures to the agent in one step, no need to describe them. # Build & Run Source: https://docs.flowdeck.studio/macos/building Build and run iOS and macOS apps from FlowDeck FlowDeck uses the Xcode toolchain to build and run your apps without making you leave FlowDeck. Pick a scheme and destination from the toolbar, then build — or ask the agent to do it. ## Setting up a project When you open a workspace or project, FlowDeck discovers available schemes and build configurations automatically. Select your scheme and destination from the toolbar before building. > [!TIP] > > Not sure which scheme to use? Ask the agent: "What schemes are available in this project?" ## Building Click **Build** in the toolbar, or press **⌘B**. When the build finishes, the Inspector opens automatically on the **Issues** tab if there are errors. Click any issue to jump to the source file. ### Build configurations Switch between Debug and Release from the configuration selector in the toolbar. Debug is the default for development; use Release to test performance or prepare for distribution. ### Clean build Press **⌘⇧K**, or choose **Project → Clean**. ## Running on a simulator 1. Select an iOS simulator from the destination picker in the toolbar 2. Click **Run** (or press **⌘R**) FlowDeck boots the simulator if needed, installs your app, and launches it. Log output streams in the Console (⌘⇧Y). ### Switching simulators Change the destination in the toolbar at any time. The next run targets the new simulator. The destination picker has a **Filter** search field to quickly find a specific device. ## Running on a physical device 1. Connect your device via USB (or pair wirelessly via Xcode's Device Manager) 2. Select the device from the destination picker in the toolbar 3. Click **Run** FlowDeck handles provisioning and signing using your existing Xcode credentials. If there's a signing issue, it appears in the Inspector's **Issues** tab. ## Running a macOS app Select **My Mac** as the destination and click **Run**. The app launches natively on your Mac. For Mac Catalyst, select **My Mac Catalyst** from the destination picker. ## Run Without Building To launch the last built binary without recompiling, use **Run Without Building** from the Run toolbar dropdown, or press **⌃⌘R**. If no prior build exists, FlowDeck falls back to a full build automatically. ## Log streaming When your app is running, log output streams in the **Console** panel at the bottom of the window. Toggle it with **⌘⇧Y**. See [Logging](/macos/logging) for filtering and search. ## Using the agent The agent can build, interpret errors, and fix them in a single step: ```text theme={null} Build the app and fix any compiler errors you find. ``` ```text theme={null} Run the app on iPhone 16 Pro and tell me if it launches cleanly. ``` ```text theme={null} Do a release build and report any warnings. ``` ## Troubleshooting ### Build errors in the Issues tab Click any issue to jump to the source. The **Fix All** button in the Issues tab sends all current errors to the agent for resolution in one step. ### Signing failures Ensure your Apple ID is signed in via **Xcode → Settings → Accounts** and the bundle identifier matches a provisioning profile in your account. ### Build succeeds but app won't launch Check that the selected simulator or device is compatible with the deployment target in your project settings (**Project → Project Settings…** or ⌘⇧,). # Disk Cleanup Source: https://docs.flowdeck.studio/macos/clean Reclaim disk space used by FlowDeck, Xcode, and the Simulator from a dedicated window FlowDeck is one of the heaviest disk consumers on a developer's machine. **Tools → Disk Cleanup** shows where that space went, with a plain-language reason for every item, and lets you reclaim exactly what you select. ## Open Disk Cleanup Go to **Tools → Disk Cleanup**, or search "Disk Cleanup" in Open Quickly (**⌘K**). This opens a dedicated scan-and-select window, the same shape as **Simulators & Runtimes**. Nothing scans, warns, or deletes until you open this window and ask. There is no background scanning or scheduled pruning. ## Reclaim space safely 1. Open **Disk Cleanup** and let the scan finish. 2. Review each category and select only the items you understand. 3. Click **Reclaim** and check the risk-grouped summary. 4. Confirm the selected items. FlowDeck reports the measured free-space change when it finishes. The initial selection contains only regenerable items. Review every unticked item individually, especially worktrees, simulators, Device Support symbols, archives, and installers. ## What it scans Disk Cleanup groups everything it finds into ten categories: * **Orphaned build data** — FlowDeck's own DerivedData for projects that no longer exist. * **Sessions & attachments** — chat history and attachments for worktrees that were deleted, plus data left behind by older builds of FlowDeck. * **FlowDeck logs** — rotated log segments older than 30 days. * **Worktrees** — agent worktrees whose branch is merged and whose working copy is clean. * **Xcode DerivedData** — build output for workspaces that no longer exist. * **Documentation Cache** — superseded Xcode documentation cache versions. * **Developer downloads & caches** — simulator/platform downloads and the Swift Package Manager cache. * **Device Support symbols** — superseded per-OS-build debug symbols. * **Archives & installers** — superseded, non-distributed `.xcarchive` builds and Xcode installers already installed. * **Simulators & Runtimes** — simulators unused for 90+ days and runtimes no longer needed. ## Selecting what to reclaim Every row shows a size and a reason, e.g. "Built for MyApp, which no longer exists." Rows are grouped by category in the sidebar, which also shows the size found so far. Only regenerable items — things that rebuild automatically the next time they're needed — are ticked by default. Destructive items (worktrees, Device Support, simulators) and items that need a second look (archives, installers) always start unticked, so nothing you can't get back is ever preselected. Click **Reclaim** to review a summary of what you selected, grouped by risk, before anything happens. ## Where reclaimed space goes Everything that can go to the Trash does — it stays recoverable until you empty it. Two categories can't be trashed and are labelled **Permanent** in the window: * **Simulators and runtimes** are removed through the same path as `flowdeck simulator delete`, since there's no supported way to move a CoreSimulator device to the Trash. * **Worktrees** are removed through git directly, so the branch itself always survives — only the working copy on disk is removed, and only after Disk Cleanup has confirmed it's merged, pushed, and has no uncommitted changes. The header shows both the total size of everything found and the volume's free space; because of how APFS clones and snapshots share storage, reclaiming a given amount of candidate size doesn't always free that same amount of real disk space. After a reclaim, Disk Cleanup reports the actual measured free-space change alongside the summed candidate size. ## Safety Disk Cleanup re-checks every item immediately before deleting it — if a file changed size, was already deleted, or its worktree is now in active use (open in FlowDeck, or has a live agent session, build, or test), that item is skipped rather than deleted. A skip or a failure on one item never stops the rest of the run. Disk Cleanup is a window you drive yourself — the AI agent has no access to the scanner or the ability to delete anything through it. ## If a reclaim is skipped or incomplete FlowDeck skips an item that changed, disappeared, or became active while the cleanup was running, then continues with the rest of the selection. Reopen Disk Cleanup to scan again after you close a worktree, finish an agent session, build, or test. For a recoverable item, restore it from the Trash if needed. Permanent simulator and runtime removal requires creating or downloading the item again; a removed worktree must be recreated from its surviving branch. # Open Quickly (⌘K) Source: https://docs.flowdeck.studio/macos/command-palette One search field for every project, session, and action in FlowDeck Press **⌘K** to open a search field over the workspace. Type a few letters and press Return to run an action or switch context. It is the fastest way to reach most of FlowDeck, including actions whose normal UI is not currently visible. ## What it searches > [card] Projects and sessions > > Switch projects or worktrees, start a new session, open a new chat, or close and delete the active session. > [card] Build, run, and test > > Build, Run, Test, and Clean, plus the scheme and destination to run them on. > [card] Source control > > Commit, push, pull, fetch, publish, open the diff viewer, create or merge a pull request, and discard changes. > [card] Panels and tools > > Show or hide Changes, Tests, Issues, the Console, and the Simulator; open Simulators & Runtimes, Skills Manager, or Disk Cleanup. > [card] Agent setup > > Change the active session's model, reasoning effort, permission mode, and Code or Plan mode. > [card] Project settings > > Select schemes and destinations, open build settings, manage Swift packages, and configure build arguments or environment values. It also opens the selected worktree in Finder, your configured editor, terminal, or Xcode when those tools are available. ## Things worth knowing **Results explain themselves.** Every result includes a short description, so actions such as Push or Disk Cleanup make their effect clear before you choose them. **Unavailable actions remain visible.** An action that cannot run yet — such as Merge with no pull request — is shown as unavailable instead of disappearing. **Settings show their current state.** Toggles such as PR auto-merge and remote-branch cleanup report whether they are currently on or off. > [!TIP] > > If you remember only one shortcut, make it **⌘K**. It can lead you to the rest. # Coding Standards Source: https://docs.flowdeck.studio/macos/engineering-standards The engineering rules FlowDeck holds every agent session to, and how to change them A capable model already writes reasonable code. What it does not do reliably is stay inside the change you asked for, ship the test with it, keep your docs honest, or apply the Swift fundamentals consistently. Coding Standards are the rules FlowDeck can add to the instructions of every agent session in the app, so you stop repeating them in chat. They apply to code sessions, Plan sessions, and every Team worker, including the QA Reviewer. Task-scoped guidance is composed beside the selected standards for assignments that need Apple-platform, tool-use, or image-input expertise. **Every standard starts on by default.** After the first substantial Swift turn in an Apple project, FlowDeck presents that recommendation with the full set enabled. Turn its switch off to opt out, or fine-tune the set later in Settings. ## Where to change them **Settings ▸ AI Workflows ▸ Coding Standards.** Every rule has its own switch and an info button showing the exact text FlowDeck adds to the agent's instructions. Nothing is hidden from you, and turning one off removes it from the prompt entirely. There is no separate baseline engineering-rules block underneath your selection. There is an **All standards** switch at the top of the page, and each section has its own, so you can turn off a whole category in one click. The first time an agent does real Swift work in an Apple project, meaning a couple of files and a diff worth reading, FlowDeck recommends the standards with one switch. That is the only time it interrupts you. The switch starts on and saves immediately; turn it off to opt out. The choice takes effect from your next session, so sessions already running are not changed. ## What they cover > [card] Works the way you asked > > Changes only what you asked for, debugs from evidence instead of guesses, and tells you honestly what it changed and what it actually verified. > [card] Writes changes you can trust > > Ships tests with behavior changes, tests observable outcomes instead of private implementation, keeps refactors behavior-preserving, justifies new dependencies, and leaves your commits, comments, and docs clean. > [card] Keeps Swift fundamentals sound > > Chooses narrow types and protocol boundaries, owns mutable state and tasks, avoids crashes and leaks, protects secrets, and writes tests that can actually fail. ## Why these and not others Every rule in the catalog has to clear two bars. **It has to change something.** A rule that restates what a current model already does is not included, because it would cost context on every session and change nothing. Telling an agent to write clear code is wasted breath; telling it to keep one owner for each running task is not. **It has to be a principle, not a preference.** These are written to be things a working engineer would agree with regardless of how their team operates. Where a genuine choice exists — test-first or implementation-first, coordinators or native navigation, one composition root or a container — the standards defer to what your project already does rather than picking for you. That matters because you remain in control of the set. A standard that argues with your codebase is worse than no standard, and every rule can be disabled in Settings. The Tested Changes rule controls implementation order: use the smallest relevant test selector to see the expected failure, make it pass, and keep that behavior covered. It does not increase validation breadth. TDD alone is not a reason to run every suite, sweep the UI, repeat the flow, or add a device matrix; the Validation settings and explicit repository gates decide that scope. ## If you already keep your own rules If you maintain a detailed `CLAUDE.md`, `AGENTS.md`, or a skill, expect some overlap. These standards stay general precisely so they sit underneath your own instructions rather than fighting them, but on a specific enough setup a contradiction is possible. When that happens, turn the offending rule off in Settings. Your own file should win, and switching one off removes it from the prompt completely. ## Swift basics and Apple development skills Eight Swift basics rules only apply to Apple projects; FlowDeck leaves them out of the prompt when the project is not an Apple project. They cover type and API design, protocol boundaries, state and task ownership, strings, crash safety, memory, sensitive data, and meaningful tests. **Crash safety.** Force unwraps, force casts, and `try!` are how a model gets past a compiler complaint, and how your app dies in someone's hand. **Memory and lifetime.** Retain cycles from escaping closures, unbounded caches, and tasks that outlive their owner. **Sensitive data.** Secure storage for secrets; no credentials in source or personal data in logs. Framework and UI topics such as SwiftUI state updates, previews, animation, accessibility, adaptive layout, StoreKit, and platform security APIs live in **FlowDeck Apple Development Skills**. The separate **FlowDeck CLI Skill** owns build, run, test, simulator, device, and UI automation workflows. > [!NOTE] > > Switching an Apple rule on in a Rust or TypeScript repository costs nothing and changes > nothing. The gate is the project, not the setting. ## What they cost Each enabled rule adds its text to the system prompt. The eight Swift basics rules are only spent in Apple projects. If you want that back, turn off the ones you do not need. The catalog is deliberately small for this reason: everything in it earns its place, or it would not be there. ## When changes take effect The prompt is composed when a session starts or is restored, so a change applies to your next session rather than one already running. Start a new session to pick it up immediately. # Install FlowDeck Source: https://docs.flowdeck.studio/macos/install Download FlowDeck and open your first project ## Prerequisites Before installing, make sure you have: **1. macOS on Apple Silicon** > [!WARNING] > > Windows and Linux are not supported. * Apple Silicon Mac (M1 or later) * macOS 26 (Tahoe) or later > [!NOTE] > > Support for macOS 15 (Sequoia) is temporarily suspended. We are working to > restore it in an upcoming release. **2. Xcode** * Download from the [Mac App Store](https://apps.apple.com/us/app/xcode/id497799835?mt=12) (26 or later) * Launch Xcode at least once to install components and accept the license agreement **3. Xcode Command Line Tools** ```bash theme={null} xcode-select --install ``` ## Download FlowDeck [Download FlowDeck from flowdeck.studio](https://flowdeck.studio) Move the app to your Applications folder and launch it. ## Open a Project FlowDeck works with existing Xcode projects and workspaces. 1. Choose **File → Add Project…** (or press **⌘O**) 2. Choose **Local folder** and select an `.xcodeproj`, `.xcworkspace`, or project folder 3. FlowDeck discovers available schemes and destinations automatically 4. Pick a scheme and destination from the toolbar, then hit **Build** — or open a conversation with the agent You can also choose **New App** to scaffold a project, or **GitHub** to browse and clone a repository. See [Projects & Sessions](/macos/projects-and-sessions) for the full workflow. ## Next Steps > [card] [The AI Agent](/macos/ai-agent) > > Learn what the built-in agent can do and how to talk to it effectively. > [card] [Build & Run](/macos/building) > > Build and run your first app from FlowDeck. > [card] [The Sample Project](/macos/sample-project) > > Explore FlowDeck with a ready-to-run iOS project before opening your own code. # FlowDeck for Mac Source: https://docs.flowdeck.studio/macos/introduction A native macOS IDE for Apple development, with a built-in AI agent FlowDeck is a native Mac app for iOS and macOS development. You get a complete IDE — build, run, test, debug, manage simulators and devices, stream logs, and review source control — plus an AI agent that can drive all of it from a conversation. ## Requirements > [!WARNING] > > FlowDeck requires macOS with Xcode installed. It does not support Windows or Linux. * **macOS** 26 (Tahoe) or later * **Apple Silicon Mac** (M1 or later) * **Xcode** 26 or later, launched at least once to install components > [!NOTE] > > Support for macOS 15 (Sequoia) is temporarily suspended. We are working to > restore it in an upcoming release. ### AI Agent requirements The built-in agent works through your existing AI CLI installation. Before using the agent, install and authenticate one supported CLI: **Claude Code**, **Codex**, **OpenCode**, **Cursor**, or **Grok Build**. FlowDeck detects available providers in **Settings → AI → Agents**. > [!NOTE] > > FlowDeck drives the agent through your installed CLI — it does not manage credentials itself. If the agent doesn't respond, make sure you can run it successfully in your terminal first. ## First project checklist 1. Open Xcode once, then launch FlowDeck. 2. Add a local project, create an app, or connect GitHub to clone a repository. 3. Select the project workspace, scheme, destination, and build configuration when prompted. 4. Create a session before starting independent work, then choose an installed agent if you want help. See [Projects & Sessions](/macos/projects-and-sessions) for the project and worktree workflow, or [The AI Agent](/macos/ai-agent) to configure a provider. ## Two ways to work FlowDeck gives you two interaction modes that complement each other. Use whichever fits the task. ### Direct — keyboard shortcuts and UI Fast, precise actions you control step by step. Best when you know exactly what you want to do. | Action | Shortcut | | - | - | | Build | **⌘B** | | Run | **⌘R** | | Run Without Building | **⌃⌘R** | | Test | **⌘U** | | Clean Build Folder | **⌘⇧K** | | Open Project | **⌘O** | | Simulators & Runtimes | **⌘⇧S** | | Toggle Console | **⌘⇧Y** | | Toggle Inspector | toolbar button | | Toggle Sidebar | **⌃⌘⇧S** | You can also drive everything from the toolbar and sidebar panels without remembering shortcuts. ### Agent — natural language Describe a goal and the agent figures out the steps. Best for multi-step tasks, debugging, and anything that would take several manual actions to accomplish. | Instead of... | Say to the agent... | | - | - | | Build → read errors → open file → fix → rebuild | "Build the app and fix any compiler errors you find." | | Run tests → read failures → trace to source → edit → rerun | "Run the LoginTests suite. If anything fails, fix it." | | Launch → navigate manually → screenshot → compare | "Open the app, go to the profile screen, and take a screenshot." | | Write test boilerplate manually | "Write unit tests for the PaymentProcessor class." | | Read logs while tapping through the app | "Run the app, go through the onboarding flow, and tell me if there are any errors in the logs." | | Review Changes tab → write commit message → stage → commit | "Summarize what I've changed and suggest a commit message." | The agent shows every action it takes in the conversation so you can follow along, intervene, or redirect at any point. ## Feature overview > [card] [AI Agent](/macos/ai-agent) > > The built-in agent builds, tests, debugs, and automates — driven by a conversation. > [card] [Build & Run](/macos/building) > > Compile and launch apps on simulators, devices, or your Mac. > [card] [Testing](/macos/testing) > > Run unit and UI tests, see results inline, let the agent fix failures. > [card] [Simulators & Devices](/macos/simulators) > > Boot simulators, deploy to physical devices, manage runtimes. > [card] [Console](/macos/logging) > > Real-time OSLog streaming from running apps, with level and keyword filtering. > [card] [UI Automation](/macos/ui-automation) > > Tap, type, scroll, and screenshot — driven by the agent. > [card] [Source Control](/macos/source-control) > > Review diffs, stage, commit, push, and sync from the Inspector's Changes tab. > [card] [Projects & Sessions](/macos/projects-and-sessions) > > Add or create projects, then give each task an isolated worktree and session. > [card] [Open Quickly](/macos/command-palette) > > Reach projects, sessions, tools, settings, and actions from one search field. ## Quick Start > [card] [Install FlowDeck](/macos/install) > > Download FlowDeck and open your first project in minutes. # Keyboard Shortcuts Source: https://docs.flowdeck.studio/macos/keyboard-shortcuts Every shortcut FlowDeck answers to Press **⌘/** in FlowDeck to see this list in the app. That in-app sheet is the source of truth for the version you are running. ## App | Action | Shortcut | | - | - | | Open Quickly | **⌘K** | | Add Project | **⌘O** | | New Session | **⌘N** | | New Chat | **⌘T** | | Archive Tab | **⌘W** | | Chat Archive | **⇧⌘I** | | Settings | **⌘,** | | Keyboard Shortcuts | **⌘/** | | Quit FlowDeck | **⌘Q** | ⌘W archives the selected conversation and selects its previous neighbor, falling forward when archiving the first tab. It asks for confirmation only when the agent is active; auxiliary windows keep their normal Close behavior. ## Build & Run | Action | Shortcut | | - | - | | Build | **⌘B** | | Build and Run | **⌘R** | | Run Without Building | **⌃⌘R** | | Test | **⌘U** | | Clean | **⇧⌘K** | ## Projects & Sessions | Action | Shortcut | | - | - | | Active Sessions | **⌘0** | | Select Tab 1 to 9 | **⌘1…9** | | Select Project 1 to 9 | **⇧⌘1…9** | > [!NOTE] > > Tab shortcuts follow the visible tab order in the current session, with Plan tabs first. > Project shortcuts follow the navigation rail order. A number beyond the available tabs > or projects does nothing. Active Sessions becomes useful once more than one project is open. ## Panels | Action | Shortcut | | - | - | | Show or Hide Sidebar | **⌃⇧⌘S** | | Show or Hide Simulator | **⇧⌘0** | | Show or Hide Inspector | **⌥⌘0** | | Show or Hide Console | **⇧⌘Y** | | Inspector: Changes | **⌥⌘1** | | Inspector: Tests | **⌥⌘2** | | Inspector: Issues | **⌥⌘3** | ## Tools | Action | Shortcut | | - | - | | Simulators & Runtimes | **⇧⌘S** | | Skills Manager | **⇧⌘M** | | Disk Cleanup | **⇧⌘D** | ## Chat While writing in the composer: | Action | Key | | - | - | | Mention a File | **@** | | Run a Slash Command | **/** | | Use a Skill | **\$** | | New Line | **⇧↩** | | Send a Written Answer | **⌘↩** | ## Simulator While the simulator panel is showing: | Action | Shortcut | | - | - | | Home | **⇧⌘H** | | Save Screenshot | **⇧⌘S** | | Rotate Left | **⇧⌘←** | | Rotate Right | **⇧⌘→** | | Paste into the Simulator | **⌘V** | # Linear Source: https://docs.flowdeck.studio/macos/linear Connect your Linear account to FlowDeck When the Linear feature flag is enabled, open **Settings → Integrations → Linear** and choose **Connect Linear**. FlowDeck opens a connection sheet in the main window and sends you to Linear in your browser. After you authorize FlowDeck, return to the app. The sheet closes when the account is connected, and Settings shows your Linear account and workspace. You can disconnect from the same Settings pane. The account credential is stored in the macOS Keychain. # Console Source: https://docs.flowdeck.studio/macos/logging Stream and filter runtime logs from your app FlowDeck streams OSLog output from running apps in real time in the **Console** panel. No Console.app, no `log stream` commands. ## Opening the Console Toggle the Console with **⌘⇧Y**, or click the console button in the top-right toolbar. The Console appears at the bottom of the window. ## Filtering logs ### Search Use the **Filter** field in the Console header to filter by keyword. Only matching log lines are shown, updated in real time. ### Log levels Click the **Log Levels** button (eye icon) to open the level picker. Toggle individual levels on or off: * **Debug** * **Info** * **Warning** * **Error** All enabled levels are shown together — mix and match as needed. ### Metadata columns Click the **Metadata** button to toggle which columns are visible alongside the log message: * **Type** * **Timestamp** * **Category** ### Follow latest Click the **Follow Latest** button (arrow-down icon) to keep the Console scrolled to the most recent log entry. Disable it to scroll back through history while the app continues logging. ## Clearing the Console Click **Clear Console** in the Console header to clear the current log buffer. Incoming logs continue streaming after clearing. ## Hiding the Console Click **Hide Console** in the header or press **⌘⇧Y** again to collapse the Console. Logs continue streaming in the background. ## Using the agent The agent reads the Console the same way you do: ```text theme={null} Run the app and show me any errors that appear in the console on startup. ``` ```text theme={null} The app is crashing somewhere after login. Run it, reproduce the crash, and find the relevant log lines. ``` ## Troubleshooting ### No logs appearing Make sure the app is running. If built in Release configuration, some debug-level logs may be stripped — switch to a Debug build and make sure Debug is enabled in the Log Levels picker. ### Log output is very noisy Use the **Filter** field to narrow to a keyword, or deselect **Debug** in the Log Levels picker to see only Info, Warning, and Error entries. # Projects & Sessions Source: https://docs.flowdeck.studio/macos/projects-and-sessions Add projects, isolate work in Git worktrees, and move between active sessions FlowDeck can keep several repositories open in one workspace. Within a repository, each session has its own branch and Git worktree, so an agent can build and edit one task without touching another task's files. ## Add a project Choose **File → Add Project…** (or press **⌘O**) and choose one of three entry points: * **New App** creates a new Apple project, with platform and location choices before it opens in FlowDeck. * **Local folder** opens an existing `.xcodeproj`, `.xcworkspace`, or folder. * **GitHub** lets you browse or search accessible repositories, clone one, and open it in the workspace. If you choose a folder that is not an Apple project, FlowDeck explains that Apple development tools will be unavailable and lets you cancel or continue. If it is not a Git repository, choose whether to cancel, open it without Git features, or create a local repository. You can initialize Git later from the Changes tab. When a project needs configuration, FlowDeck guides you through selecting the workspace, scheme, destination, and build configuration. Those choices are saved per worktree, so a different task can use a different scheme or target without overwriting the first one. ## Configure a session Open a session's **Project Settings** from its menu or [Open Quickly](/macos/command-palette) (**⌘K**) to review its build setup. The window includes: * **Build Settings** for the workspace, scheme, configuration, and destination. * **Schemes** for the schemes FlowDeck discovers in the selected workspace. * **Xcodebuild Settings** for additional project build settings. * **Swift Packages** for direct remote or local package dependencies and their targets. New sessions start from the repository's last valid build selection. Use the session settings window when this task needs a different setup. For the global tools around a project, see [Settings & External Tools](/macos/settings). ## Create a session Press **⌘N** or choose **File → New Session**. You can start a fresh branch and worktree, open an existing local or remote branch, or create a session from another session's branch. Each session keeps its own chat and plan conversations, agent settings, drafts, project configuration, and DerivedData. Give a session a descriptive name to make its task easy to recognize in the sidebar. Start from a branch when you need to resume parked work; start from another session's branch when you need a related isolated task. Use the **+** menu above the conversation to create a **New Chat** or **New Plan**, choose **Open Plan** from the plan library, or browse **Chat Archive** across all projects and sessions. New tabs appear on the right, and **⌘T** creates a Chat tab. Opening the archive keeps your current conversation selected. Overflow arrows let you scroll the tabs in either direction. New conversations receive a title in the background after the first message is sent, using your configured utility model. You can rename a tab from its context menu while the agent is working; your chosen name always takes precedence. If title generation is unavailable, the current name stays in place. ## Archived chats Hover over a tab and use its archive-box button, or press **⌘W**, to archive it. Archiving selects the previous tab to the left, or the next tab when archiving the first. It preserves a newer selection you make while saving. Archiving from the button, tab menu, or keyboard asks for confirmation only if the agent is active. **Chat Archive** shows one searchable list grouped by project and session, with the archive date and recorded models. Search includes saved chat text, titles, models, providers, projects, and sessions; use the chat-kind and project filters to narrow the list. Restore a chat to its original tab, another existing session in the same project, or a new session with your chosen base branch. Restoring to another session keeps its existing chats and working files intact. Saved history can be restored even when its original checkout is gone, as long as the repository is available. The archive permanently keeps the newest **250 chats across all projects**. Older saved chats and their owned attachments are removed; chats involved in restore or recovery are protected until the operation finishes. You can also delete one archive or choose **Delete all**. Delete all includes archives hidden by search and filters, shows the global count for confirmation, and does not include chats archived afterward. Permanent deletion cannot be undone and does not remove the provider’s original history. ## Move between work The sidebar lists sessions and worktrees for the active repository. Select one to switch its chat and project context. With more than one project open, **⌘0** opens Active Sessions and **⇧⌘1** through **⇧⌘9** switch directly between projects. Use **⌘1** through **⌘9** to select conversation tabs in the current session, in their displayed order with Plan tabs first. Use [Open Quickly](/macos/command-palette) (**⌘K**) when you want to search projects, sessions, branches, and actions from one place. ## Close or delete a session Closing a session preserves its conversation and worktree so you can return later. Deleting a session asks for confirmation and removes its worktree, local branch, local conversation data, attachments, and per-worktree build data. FlowDeck protects the main worktree, and deleting a session never deletes its remote branch. > [!WARNING] > > Deleting a session can discard unpublished local work. Review the Changes tab and push > anything you need before confirming deletion. ## Generated projects For a project managed by **XcodeGen**, FlowDeck detects the manifest and offers to generate the Xcode project before you build. You can run **Regenerate Project** later from Open Quickly. ## Try it safely The [sample project](/macos/sample-project) is a local-only project with prepared sessions and a configured simulator. It is a good place to explore branches, worktrees, and the agent before opening a production repository. # The Sample Project Source: https://docs.flowdeck.studio/macos/sample-project A complete iOS app, already set up, to learn FlowDeck on before you point it at your own code The final onboarding step offers to **open the sample project**. It is the fastest way to understand FlowDeck: a separate local repository with no remote that never touches your own projects. Declined it, or want it back later? Choose **File → Add Project…** (**⌘O**) and use the **sample project** link under the three source tiles. ## What you get A small iOS weather app in a real Git repository, already configured with a scheme, a dedicated simulator, and a saved destination. Build and Run work on the first click. It opens on a pinned **Welcome** screen with four steps. Work through them to build the app, review a diff, follow a failing test, and execute a plan. ## The sessions The sample is a tour, not filler. Each session is named after real work and opens the panel that suits the task. | Session | What it shows you | | - | - | | **Cloud cover in the Humidity card** | A conversation with its diff open beside it — review what an agent changed. | | **Flaky forecast timeout test** | The Tests panel with a failure — trace a red test to its cause. | | **Humidity gauge accessibility** | The simulator panel with the app running — see how the agent drives the screen. | | **Cache geocoding lookups** | A finished plan, ready to execute. | | **Offline last-known forecast** | A second finished plan, ready to explore. | One session carries uncommitted changes on purpose, so the Changes tab has something to review as soon as you open it. ## It is a real project Everything you can do to your own code works here: edit files, build, run on the simulator, run tests, commit, and ask the agent to make a change. The repository is local only, so there is nothing to push. > [!NOTE] > > The sample project lives at `~/.flowdeck/sample-project` with a dedicated simulator > named **FlowDeck Sample Project**. It stays separate from every project you add. ## After the tour Add your own project with **⌘O** whenever you are ready.\ \ **New App** to scaffold one, **Local folder** to open an existing project, or **GitHub** to clone one. The sample stays available until you choose to remove it. # Settings & External Tools Source: https://docs.flowdeck.studio/macos/settings Configure FlowDeck, its Apple toolchain, and the apps it opens for you Open **Settings** from the FlowDeck menu to adjust the app, your agents, and the tools around your projects. Settings are stored on this Mac; project build settings remain separate and are saved per worktree. ## AI and workflow preferences The **AI** sections let you choose the agents and models that appear in FlowDeck, set default, utility, and planning agents, and review the tools an agent may use without asking again. You can also decide whether chat shows reasoning and tool calls. Use **Agents** to enable the installed provider CLIs you want to offer, then use **Model List** to hide models from chat and command pickers without removing them. If a provider is missing or signed out, install or authenticate it in your terminal and choose **Refresh list**. FlowDeck keeps an unavailable saved choice visible so you can replace it; it does not silently select another provider or model. Default, planning, and utility agent roles each have their own agent, model, reasoning-effort, and permission defaults. These defaults apply when a new session is configured; they do not rewrite the instructions of a session already running. **AI Workflows** contains the [Coding Standards](/macos/engineering-standards) and [Validation](/macos/validation) controls. Use them to choose the guidance agents receive and how they check and report their work. ## Appearance and reading The **Appearance** section controls the system, light, or dark interface mode, window tint, log-viewer theme, and chat and diff-viewer fonts. Changes apply immediately, so you can choose a combination that is comfortable for long reviews. ## External Tools FlowDeck can hand the current worktree to tools already installed on your Mac. In **External Tools**, select a default editor, diff tool, and terminal. Only installed apps are offered. > [card] Editors > > Xcode, Cursor, Visual Studio Code, Nova, and Zed can open a worktree or file. > [card] Diff tools > > FileMerge, Kaleidoscope, Beyond Compare, DiffMerge, Meld, and P4Merge can review changes when installed. > [card] Terminals > > Ghostty, iTerm2, Terminal, and Warp can open at the worktree root. Use a worktree's menu or [Open Quickly](/macos/command-palette) to send it to the selected editor, diff tool, or terminal. FlowDeck never installs these apps or changes their own settings. ## Apple development and Git **Apple Toolchain** manages the Xcode versions and simulator platforms available to FlowDeck. Choose a specific project, scheme, configuration, and destination from the project's build settings; those choices belong to that worktree, not to the global Settings window. The **Git** and **GitHub** sections configure generated commit messages, automatic commit or push behavior, pull-request defaults, PR monitoring, and the GitHub connection. These settings support the workflows described in [Source Control](/macos/source-control); they do not override the review steps you choose for an individual change. To connect GitHub, follow the device-flow sign-in shown in Settings or when adding a project. Once connected, **GitHub** is available as an Add Project source for browsing, searching, and cloning repositories. FlowDeck stores the connection for the app and uses it only for the GitHub workflows you start. Disconnecting stops those workflows until you sign in again. Under **Integrations**, **Linear** has its own pane beside **GitHub** when the Linear feature flag is enabled. Connect your account there. See [Linear](/macos/linear). GitHub's device-flow sign-in is unchanged. ## License FlowDeck checks for a Studio or Teams license before opening the workspace. If no eligible license is present, the activation screen lets you start a trial or paste an activation key. A FlowDeck CLI-only license remains valid for the CLI but does not unlock FlowDeck for Mac. Use **License** to review the masked key, product, plan, status, renewal or expiry date, and machine usage. **Manage License** opens the account site. **Remove License** asks for confirmation, deactivates this Mac, and returns FlowDeck to the activation screen. Because the app and CLI use the same machine license record, removing it also removes the local CLI activation. For activation or account problems, see [Support](/macos/support). > [!NOTE] > > Some advanced settings appear only when their corresponding product feature is > enabled. If a section is not shown, it is not required for the standard macOS > workflow. # Simulators & Devices Source: https://docs.flowdeck.studio/macos/simulators Manage iOS simulators and physical Apple devices from FlowDeck FlowDeck manages simulators and devices from a dedicated window — no Xcode or `simctl` needed. ## Open Simulators & Runtimes Go to **Tools → Simulators & Runtimes** (or press **⌘⇧S**). This opens a separate window where you can browse, create, and manage simulators. ## Simulators ### Browse simulators The Simulators & Runtimes window lists all installed simulators grouped by platform (iOS, watchOS, tvOS, visionOS). ### Boot and shutdown Click the power button next to any simulator to boot or shut it down. A running simulator shows a green indicator. ### Create a simulator 1. Click **+** at the bottom of the Simulators list 2. Choose a device type (e.g. iPhone 16 Pro) 3. Choose an OS runtime 4. Give it a name and click **Create** ### Rename a simulator Give an existing simulator a new display name without creating another device. 1. Open **Tools → Simulators & Runtimes** (**⌘⇧S**). 2. Click the pencil icon in that simulator's action pill (between Clone and Copy ID). 3. Type the new name in the sheet. The field starts with the current name; **Rename Simulator** stays disabled until the name is non-empty and different. 4. Click **Rename Simulator**. The simulator keeps its UDID. Destination pickers, scripts, and saved config that target that UDID continue to work. Only the name shown in the list and in `flowdeck simulator list` changes. From the command line, the same action is: ```bash theme={null} flowdeck simulator rename "iPhone 16" "My CI Device" ``` ### Delete a simulator Right-click any simulator and choose **Delete**. You can also delete all unavailable simulators at once via the context menu on the list header. > [!WARNING] > > Deleting a simulator permanently removes its installed apps, app data, and test state. > Use **Clone** first when you need to preserve a known-good device state. ### Simulator runtimes The Simulators & Runtimes window shows which runtimes are installed. Download additional runtimes directly from this window, or via **Xcode → Platforms**. ## Devices Physical Apple devices appear in the Simulators & Runtimes window when connected via USB or paired wirelessly. ### Connect a device 1. Connect the device via USB 2. Trust the Mac if prompted on the device 3. The device appears within a few seconds ### Wireless pairing Pair once over USB, then enable wireless pairing in Xcode's Device Manager. After pairing, the device appears in FlowDeck over Wi-Fi. ## Running on simulators and devices Select any simulator or device from the destination picker in the toolbar. The next **Run** targets that destination. ### iPhone Duo posture When the selected destination is an iPhone Duo on Xcode 27.1 or later, the inline simulator panel shows **Duo Posture** with **Closed**, **Partially Open**, and **Open**. The panel uses Apple’s V68 artwork when available and keeps the existing rotation controls. Exact angles and continuous monitoring are available through [`flowdeck simulator pose`](/cli/commands/simulator/pose). ### Phone ↔ Watch companion preview When you run an iOS app that embeds a Watch companion (`Host.app/Watch/*.app`), the inline simulator panel’s device-name title becomes a toggle. The phone launches as usual; the watch is **not** started until you tap the title to switch to watch. FlowDeck pairs/boots/installs/launches the watch as needed, then shows the watch stream with the same controls and pop-out as the phone. Tap the title again to return to the phone — the watch simulator stays running. Projects without an embedded Watch app keep a plain (non-toggle) device name. ### Use the simulator panel After a simulator run starts, open the simulator panel with **⇧⌘0**. The panel shows the running app inside FlowDeck and supports typing, pointer input, scrolling, paste, Home, screenshots, and rotation. These controls operate on the selected simulator; they do not change a physical device. The live panel accepts one pointer at a time. Use [UI Automation](/macos/ui-automation) when you need a multi-touch gesture or a repeatable accessibility-driven flow. ## Using the agent ```text theme={null} Boot an iPhone 16 Pro simulator and run the app on it. ``` ```text theme={null} List all available iOS simulators and tell me which ones are currently running. ``` ```text theme={null} Create a fresh iPhone 15 simulator running iOS 17 and run my tests on it. ``` ```text theme={null} Take a screenshot of the running simulator. ``` ## Advanced simulator controls ### Status bar overrides For clean screenshots (App Store, press kit), override the status bar to show a fixed time, full signal, and full battery. Available from the Simulators & Runtimes window when a simulator is selected. ### Push notifications Send a simulated push notification to test your notification handling — no APNs required. Right-click a running simulator and choose **Send Push Notification**, then paste a JSON payload. ### Location simulation Override the device's reported location for testing location-aware features. Set a fixed coordinate or simulate movement along a route. ### Privacy permissions Pre-grant or revoke app permissions (photos, location, microphone, etc.) to test different permission states without interacting with system prompts. Right-click a simulator and choose **Manage Permissions**. ### Simulator settings workflow 1. Select the simulator you want to change in **Simulators & Runtimes**. 2. Open its action menu and choose the test state you need, such as status bar, location, notification, media, privacy, accessibility, or appearance. 3. Apply the change, then run or relaunch the app on that same simulator. 4. Reset or erase the simulator when you no longer need the altered state. These settings are for development and testing. They can change the behavior your app observes, so reset them before treating the simulator as a clean test environment. ## Troubleshooting ### Simulator won't boot Try **Erase All Content and Settings** from the simulator's context menu. This resets it to a clean state. ### Device not appearing Check the USB connection and trust dialog. If the device still doesn't appear, restart both the device and FlowDeck. ### "No runtimes available" Open the Simulators & Runtimes window (⌘⇧S) and download the runtime for the iOS version you need, or open **Xcode → Platforms**. # Skills Manager Source: https://docs.flowdeck.studio/macos/skills-manager Install and remove the skills your agent CLIs read, without editing their folders by hand A skill is a folder of instructions an agent CLI loads for matching work. **Tools → Skills Manager** (**⇧⌘M**) lets you inspect and manage skills for supported agents in one place. ## The window The left column lists installed agent CLIs and the skills FlowDeck finds for each one. Choose an agent to see its included FlowDeck skills and the skills already installed in that agent's global or project scope. ## Included with FlowDeck Two skills can be installed or reinstalled from the manager: | Skill | What it gives the agent | | - | - | | **FlowDeck CLI Skill** | FlowDeck build, run, test, simulator, device, and log workflows. | | **FlowDeck Apple Development Skills** | Apple framework and API guidance for SwiftUI, concurrency, StoreKit, and other platform features. | The FlowDeck CLI Skill teaches an agent to use FlowDeck's tooling instead of reaching for Apple developer commands directly. ## Your skills The manager lists other skills it finds with their name, description, and version when available. You can add a custom skill from a `.md` file or `.zip` archive to the selected agent and scope. Installing a skill for one agent does not install it for another. Removing a skill always requires confirmation. Included FlowDeck skills can be reinstalled later; FlowDeck cannot restore a custom skill after it has been removed. The confirmation sheet warns that removing an included skill weakens Studio's Apple development guidance for the selected agent. ## Refresh after outside changes Use **Refresh** after installing a skill outside FlowDeck or after running an agent CLI for the first time. FlowDeck re-reads the agent's skill locations and updates the list. > [!NOTE] > > Skills are stored in the locations their agent CLI uses, not inside a FlowDeck project. > A global skill you install here is therefore also available when you run that agent from > your own terminal. # Source Control Source: https://docs.flowdeck.studio/macos/source-control Review and commit changes from FlowDeck FlowDeck includes source control in the **Changes** tab of the Inspector — the right-side panel. Review your diff, stage files, commit, and push without leaving the app. ## Opening the Changes tab Click the **Inspector** button in the top-right toolbar to open the Inspector, then select the **Changes** tab. The Changes tab is the default view when the Inspector opens. ## Reviewing changes The Changes tab shows all modified, added, and deleted files in the working tree. Click any file to see its diff inline. Files are marked as **Viewed** or **Not Viewed** — use this to track your code review progress across a large diff. ## Staging and committing Right-click any file to **Stage** or **Unstage** it. Then: 1. Review staged files 2. Type a commit message 3. Click **Commit** To discard changes in a file, right-click and choose **Discard Changes** — this is destructive and cannot be undone. In the full review window, **Discard all changes** applies to the complete working tree after confirmation, including binary files that do not appear in the text-diff list. If the repository changes while the confirmation is open, FlowDeck safely cancels the operation and asks you to review again. If any file cannot be discarded, FlowDeck reports that changes remain in the worktree; return to the Changes tab to review them. ## Syncing with remote The Changes tab shows your branch's relationship to its remote tracking branch and surfaces the right action: * **Fetch** — when your branch is up to date * **Pull** — when behind the remote * **Push** — when ahead of the remote * **Sync** — when branches have diverged (fetch + pull + push) * **Publish** — when the local branch has no upstream tracking branch yet ## Upstream commits The Changes tab also shows recent upstream commits so you can see what's changed on the remote without leaving FlowDeck. ## Connect GitHub Connect GitHub from **Settings → GitHub** or the GitHub option in **Add Project**. FlowDeck uses the connection to browse repositories, clone a selected repository, and create or monitor GitHub pull requests. You can also paste an HTTPS, SSH, or SCP-style repository address into the clone flow; FlowDeck normalizes a supported address before cloning. GitHub-specific features are unavailable until you connect, and pull-request automation does not apply to other forges. Disconnect from Settings when you no longer want the app to use the connection. ## Pull requests and PR Autopilot After publishing your branch, use **Open PR** in the Changes tab to create a GitHub pull request. The first time FlowDeck creates a PR successfully, it introduces **PR Autopilot** and lets you choose: * **One-click commits and PRs:** Generate context-aware commit and PR messages, commit your changes, and open the PR for you. * **Monitor PRs:** Keep watching for failing checks and merge conflicts so the same agent and context can fix them autonomously, even while you are away. * **Auto-merge PRs:** Appears after you enable monitoring and merges monitored PRs automatically once their checks pass. Choose **Save choices** to apply the selected options, or **Maybe later** to leave your current settings unchanged. You can change all three options later in **Settings > Workflows > Git**. Turning off **Monitor PRs** also turns off and hides **Auto-merge PRs**. Monitor and auto-merge are settings, not permission to bypass an approval request for a remote change. ## Using the agent The agent will not commit or push without your explicit approval — changes always land in the Changes tab for you to review first. ```text theme={null} What files have I changed since the last commit? ``` ```text theme={null} Summarize the changes I've made and suggest a commit message. ``` > [!NOTE] > > The agent never pushes to a remote without asking you first, even when running in fully autonomous mode. # Getting Help Source: https://docs.flowdeck.studio/macos/support Get help with FlowDeck for Mac ## Documentation You're reading it. Use the search at the top of any page to find what you need. ## Community Join the [FlowDeck Discord](https://discord.com/invite/VJ6nwb6Weg) to ask questions, share workflows, and get help from other users and the FlowDeck team. ## Customer Support Found a bug or have a feature request? Write us at [support@flowdeck.studio](mailto:support@flowdeck.studio?subject=Support%20Request) ## License issues If FlowDeck shows a license error or you need to activate your license: 1. Open **FlowDeck → Settings → License** 2. Enter your license key 3. Click **Activate** If activation fails, check that your Mac is connected to the internet. If the problem persists, email us with your license key and the error message you're seeing. ### Lost your license key? Log in to our [Customer Portal](https://license.flowdeck.studio/) using your registered email address to retrieve your license key. # Testing Source: https://docs.flowdeck.studio/macos/testing Run unit and UI tests from FlowDeck Run your tests directly from FlowDeck. Results appear in the Inspector's **Tests** tab, and the agent can trace failures to the source and fix them. ## Running tests Press **⌘U** or click **Test** in the toolbar to run the full test suite for the selected scheme. When a test run starts, the Inspector opens automatically on the **Tests** tab so you can watch results as they come in. ### Run a specific test target, class, or method In the **Tests** tab, expand the tree to find the test you want and click the play button next to it. You can run at any level: * An entire test target * A test class * A single test method ### Filter tests Use the **Filter** field at the bottom of the Tests tab to find tests by name. ## Test results Results update live in the Tests tab: * **Green checkmark** — passed * **Red X** — failed, with the failure message shown inline * **Yellow arrow** — skipped * **Spinner** — currently running Click any failure to see the full message and jump to the failing line in the source file. ## Test plans If your scheme has test plans configured, select the plan from the configuration picker in the toolbar before running. FlowDeck picks up the test plan configuration automatically. The Tests tab groups results by test plan when multiple plans are present. ## Using the agent The agent is especially useful for test workflows that span multiple steps: ```text theme={null} Run the LoginTests suite. If anything fails, trace the failure and fix it. ``` ```text theme={null} I just added a PaymentProcessor class. Write unit tests for it and make sure they pass. ``` ```text theme={null} Run the full test suite and give me a summary of what failed and why. ``` ```text theme={null} Run only the tests related to the cart feature. ``` The agent reads test output, understands what failed and why, and can edit production code or test code to fix the problem — then re-run to confirm. The **Fix All** button in the Tests tab sends all current failures to the agent in one step. ## UI Tests UI tests need a compatible destination. Select the simulator, device, or Mac target your scheme supports before running them. The agent can also drive UI automation directly (outside of XCTest) — see [UI Automation](/macos/ui-automation) for that workflow. ## Troubleshooting ### Tests won't start Make sure a compatible simulator is selected and booted. Check the Console (⌘⇧Y) for any launch errors. ### Tests pass locally but fail on retry Check for shared mutable state between tests. Tests should be isolated — each test should set up its own state and not depend on execution order. ### Test not appearing in the Tests tab Ensure the test file is added to the correct test target in your Xcode project. FlowDeck discovers tests from the scheme's test targets. # UI Automation Source: https://docs.flowdeck.studio/macos/ui-automation Interact with the simulator screen — tap, type, scroll, and take screenshots FlowDeck can interact with the iOS simulator screen: tapping buttons, typing text, scrolling, swiping, and capturing screenshots. This powers both the AI agent and manual automation workflows. ## With the AI agent UI automation is most powerful when driven by the agent. Describe the interaction you want and the agent handles the details: ```text theme={null} Launch the app, navigate to the settings screen, and toggle the notifications switch. ``` ```text theme={null} Take a screenshot of the current simulator screen. ``` ```text theme={null} Fill in the login form with test credentials and tap Sign In. Tell me what happens. ``` ```text theme={null} Scroll down to the bottom of the feed and take a screenshot. ``` The agent uses the simulator's accessibility tree to find elements by label, role, or identifier — it doesn't rely on fixed coordinates, so it works even if the layout shifts. ## Screenshots Capture a screenshot of the running simulator at any time: * **From the agent:** ask for a screenshot in the conversation * **From the UI:** click **Screenshot** in the simulator controls panel Screenshots are saved to the session's output folder and shown inline in the conversation. ## How element targeting works The agent reads the simulator's accessibility tree to find interactive elements. For best results, make sure your views have meaningful accessibility labels — the same labels that power VoiceOver also power automation. > [!TIP] > > If the agent can't find a button, it's likely missing an accessibility label. Add `.accessibilityLabel("Settings")` to the view in SwiftUI, or set `accessibilityLabel` in UIKit. ## macOS automation For macOS apps running on your Mac, the agent can interact with the app's window using macOS accessibility APIs. This requires Screen Recording permission and Accessibility permission for FlowDeck. > [!WARNING] > > macOS automation interacts with your real desktop, mouse, and keyboard. The agent will ask for your explicit approval before performing any macOS automation. ## Troubleshooting ### Agent can't find a UI element Check that the element has an accessibility label or identifier. You can inspect the accessibility tree by asking the agent: "What elements are visible on screen right now?" ### Taps aren't registering Make sure the simulator is booted and the app is in the foreground. Some animations need to finish before taps are registered — the agent handles this automatically with retries. ### Screenshots are blank or black The simulator may still be booting or the app may not be in the foreground. Wait a moment and try again. # Validation Source: https://docs.flowdeck.studio/macos/validation Choose how FlowDeck agents check their work and share the results Writing the change is only part of finishing it. Validation is the work an agent does afterward to show that the result builds, passes the right tests, and behaves as expected. FlowDeck always requires the smallest relevant tests and any checks the repository explicitly defines as gates. The Validation settings control the extra runtime checks and evidence an agent gathers after those required checks, so you can choose between a faster handoff and a more comprehensive review. ## Why FlowDeck validates more FlowDeck is built to let agents do more than edit files. An agent can use the project's saved target to build and test, run the real app, exercise changed flows, inspect logs, and capture evidence from simulators and devices. That makes it possible to catch problems a code diff or clean build cannot reveal, such as clipped text, a broken interaction, or state that fails only after the app is launched. Balanced is the default: tests, build/launch, then one check of the changed flow and its visible result. It checks both light and dark only for appearance-dependent styling changes; otherwise it uses the current appearance. It checks changed loading/empty/error/permission states, but does not add rotation, resizing, adjacent flows, or extra devices. ## Choose a starting point The preset at the top of **Settings ▸ AI Workflows ▸ Validation** sets every option below it. You can then change any option independently. When you do, the preset reads **Custom**. Choosing a named preset again resets all five options to that preset. > [card] Lean > > Runs relevant tests, confirms compilation and successful launch, then stops. > Uses the saved target, no screenshots or recordings, and a brief report. > [card] Balanced > > Adds one check of the changed flow and visible UI. Captures useful visual evidence. > No video, rotation, or extra devices. This is the default. > [card] Thorough > > Adds relevant edge cases, supported orientations/window sizes, and one additional > target with a meaningful compatibility difference. Captures evidence during those > checks and reports a compact results matrix. ## Customize each method ### Run the app Controls how much runtime behavior the agent exercises after the required checks pass. The other controls independently select artifacts, targets, and reporting; preset names add no extra instructions. For documentation-only work, validate the documents. For libraries/CLIs, use their test or executable entry point rather than launching an unrelated app. | Option | What the agent does | | - | - | | **Launch only** | After relevant tests pass, confirms compilation and successful startup. Does not navigate UI flows. | | **Changed features** | Confirms compilation/startup, exercises the shortest changed flow once, and visually inspects affected UI. Checks light/dark only for colors, materials, shadows, or appearance-dependent styling; otherwise uses current appearance. Checks changed loading/empty/error/permission states. No rotation, resizing, content-size sweeps, or adjacent flows. | | **Extended checks** | Adds applicable failure, empty, long-content, and permission states. Repeats an interaction once if lifecycle/state changed. For UI, checks light/dark and supported portrait/landscape on mobile or compact/wide windows on desktop. Lists applicable checks, avoids a Cartesian product, and stops when they pass. | ### Screenshots Controls still-image evidence. It does not decide whether the agent runs tests or checks the app. | Option | What the agent does | | - | - | | **No screenshots** | Does not capture screenshots and describes any visible result briefly. | | **Only when necessary** | One final image for meaningful visual changes; one per appearance only when both were checked. Skips copy-only work unless layout changes. Never adds runtime checks. | | **Always** | One final image per visually distinct configuration already checked. Before/after only when needed to explain the result. | ### Screen recordings Controls video evidence for behavior that a still image cannot explain well. | Option | What the agent does | | - | - | | **No recordings** | Does not record video. | | **Only when necessary** | Records selected checks only when motion or timing cannot be proven with stills. Does not add or repeat flows. | | **Always** | One short clip per motion or multi-step flow already selected. Captures during the check; skips when no such flow exists. | ### Additional devices Controls whether the agent repeats relevant runtime checks beyond the saved target. | Option | What the agent does | | - | - | | **Saved target only** | Uses only the target selected in FlowDeck unless the feature or task requires another one. | | **Only when necessary** | Adds one relevant simulator or device when there is a meaningful compatibility risk. | | **Multiple targets** | Saved target plus one additional relevant screen-size, OS, or platform. Repeats only difference-sensitive checks. More targets require explicit task scope; unavailable or irrelevant targets are reported as a limit. | ### Final report Controls how much validation detail appears in the agent's final response. It changes the report, not the checks that are required. | Option | What the agent does | | - | - | | **Brief** | Names the checks that passed, reports the test count, and includes only essential evidence. | | **Standard** | Summarizes tests, runtime checks, evidence, concrete outcomes, and any remaining gap. | | **Detailed** | Provides a target-by-target matrix with test counts, flows and states exercised, artifacts, results, and remaining gaps. | ## What never changes Validation preferences never let an agent skip required tests, repository gates, safety rules, permission requirements, or honest reporting. An agent must not claim a check or artifact it did not produce. A setting can reduce extra runtime work or evidence, but it cannot turn a failed check into completed work. Test-driven development controls whether a test is written and run before implementation; it does not turn that focused red-green cycle into a full test suite, UI sweep, or device matrix. Validation stops when the selected checks pass and the changed behavior is proven. If a check fails, the agent investigates that failure and repeats the smallest affected scope. A failure is not permission to start a general compatibility sweep. Changes take effect when a session is next configured or restored, and for Team workers hired after the change. They do not rewrite the instructions of an agent that is already running. # Requirements Source: https://docs.flowdeck.studio/requirements System requirements for running FlowDeck > [!WARNING] > > FlowDeck requires macOS with Xcode installed. It does not support Windows or Linux. ## System Requirements * **macOS** 13.0 (Ventura) or later * **Apple Silicon Mac** (M1 or later) recommended for best performance * Intel Macs are supported but may have reduced performance ## Xcode Requirements * **Xcode** 15.0 or later * Download from the [Mac App Store](https://apps.apple.com/us/app/xcode/id497799835?mt=12) * Launch Xcode at least once to install components * Accept the license agreement ## Command Line Tools Install the Xcode Command Line Tools: ```bash theme={null} xcode-select --install ``` ## Editor Requirements (Extension Only) The FlowDeck extension works with any VS Code-based editor: * [Visual Studio Code](https://code.visualstudio.com/download) 1.85 or higher * [Cursor](https://cursor.com/) 1.0 or higher * [Windsurf](https://windsurf.com) 1.0 or higher # Getting Help Source: https://docs.flowdeck.studio/support Resources for support and community ## Documentation You're reading it. Use the search at the top of any page to find what you need. ## Community Join the [FlowDeck Discord](https://discord.com/invite/VJ6nwb6Weg) to ask questions, share workflows, and get help from other users and the FlowDeck team. ## Customer Support Found a bug or have a feature request? Write us at [support@flowdeck.studio](mailto:support@flowdeck.studio?subject=Support%20Request) ## License issues If FlowDeck shows a license error or you need to activate your license: 1. Open **FlowDeck → Settings → License** 2. Enter your license key 3. Click **Activate** If activation fails, check that your Mac is connected to the internet. If the problem persists, email us with your license key and the error message you're seeing. ### Lost your license key? Log in to our [Customer Portal](https://license.flowdeck.studio/) using your registered email address to retrieve your license key.