Skip to main content

flowdeck build

Build an Xcode project or workspace for simulator, macOS, or physical device.
# Build for iOS simulator
flowdeck build --workspace MyApp.xcworkspace --scheme MyApp --simulator "iPhone 16"

# Build for macOS
flowdeck build --workspace MyApp.xcworkspace --scheme MyApp --device "My Mac"

# Build for physical device (by name - partial match)
flowdeck build --workspace MyApp.xcworkspace --scheme MyApp --device "iPhone"
flowdeck build --workspace MyApp.xcworkspace --scheme MyApp --device "John's iPhone"

# Build for physical device (by UDID)
flowdeck build --workspace MyApp.xcworkspace --scheme MyApp --device "00008130-001245110C08001C"

# Release configuration
flowdeck build --workspace MyApp.xcworkspace --scheme MyApp --simulator "iPhone 16" --configuration Release

# JSON output for automation
flowdeck build --workspace MyApp.xcworkspace --scheme MyApp --simulator "iPhone 16" --json

# Load settings from config file
flowdeck build --config .flowdeck/state.json

Options

OptionShortDescription
--workspace <path>-wPath to .xcworkspace or .xcodeproj (required)
--simulator <name>-STarget simulator name or UDID
--device <name>-DPhysical device name/UDID, or “My Mac” for macOS
--scheme <name>-sBuild scheme name (auto-detected if only one)
--configuration <name>-CBuild configuration (Debug/Release)
--project <path>-pProject directory (defaults to current directory)
--derived-data-path <path>-dCustom derived data location
--config <path>-cPath to JSON config file with project settings
--json-jOutput JSON events for programmatic consumption
--verbose-vShow full xcodebuild output (default: progress only)
Either --simulator or --device must be provided:
  • Use --simulator for iOS/tvOS/watchOS simulators
  • Use --device "My Mac" (or "mac", "macOS") for macOS builds
  • Use --device "<name>" or --device "<UDID>" for physical devices

Device Matching

When using --device, FlowDeck supports:
  • UDID: Exact match (case-sensitive)
  • Name: Partial match (case-insensitive), e.g., "iPhone" matches "John's iPhone"

Config File Format

The --config parameter accepts a JSON file with portable project settings:
{
  "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:
{"type":"status","stage":"COMPILING","message":"Compiling sources..."}
{"type":"status","stage":"LINKING","message":"Linking..."}
{"type":"result","success":true,"operation":"build","duration":12.5}
Event Types:
TypeDescription
statusProgress updates with stage and message
logBuild log messages with level and message
warningCompiler warnings with file, line, message
errorCompiler errors with file, line, message
resultFinal result with success, operation, duration
Result Event (Success):
{
  "type": "result",
  "success": true,
  "operation": "build",
  "duration": 12.5
}
Result Event (Failure):
{
  "type": "result",
  "success": false,
  "operation": "build",
  "error": {
    "code": "BUILD_FAILED",
    "message": "Build failed with 3 errors",
    "suggestions": ["Check compiler errors above"],
    "recoverable": true
  }
}

flowdeck run

Build and launch the app on a simulator, macOS, or physical device.
# Build and run on iOS simulator
flowdeck run --workspace MyApp.xcworkspace --scheme MyApp --simulator "iPhone 16"

# Run on macOS
flowdeck run --workspace MyApp.xcworkspace --scheme MyApp --device "My Mac"

# Run on physical device
flowdeck run --workspace MyApp.xcworkspace --scheme MyApp --device "John's iPhone"

# Run with log streaming
flowdeck run --workspace MyApp.xcworkspace --scheme MyApp --simulator "iPhone 16" --log

# Interactive mode (R=rebuild, C=clean+rebuild, Q=quit)
flowdeck run --workspace MyApp.xcworkspace --scheme MyApp --simulator "iPhone 16" --interactive

# Wait for debugger to attach
flowdeck run --workspace MyApp.xcworkspace --scheme MyApp --simulator "iPhone 16" --wait-for-debugger

Options

OptionShortDescription
--workspace <path>-wPath to .xcworkspace or .xcodeproj (required)
--simulator <name>-STarget simulator name or UDID
--device <name>-DPhysical device name/UDID, or “My Mac” for macOS
--scheme <name>-sBuild scheme name
--configuration <name>-CBuild configuration
--project <path>-pProject directory
--derived-data-path <path>-dCustom derived data location
--config <path>-cPath to JSON config file
--log-lStream logs after launch (print statements + OSLog)
--wait-for-debuggerWait for debugger to attach before app starts
--interactive-iInteractive mode: R to rebuild, C to clean+rebuild, Q to quit
--json-jOutput JSON events
--verbose-vShow app console output (default: suppressed)
Either --simulator or --device must be provided (same as build command).

After Launching

When the app launches, you’ll get an App ID. Use it to:
flowdeck apps              # List running apps
flowdeck logs <app-id>     # Stream logs from the app
flowdeck stop <app-id>     # Stop the app

JSON Output

{"type":"status","stage":"COMPILING","message":"Building..."}
{"type":"status","stage":"INSTALLING","message":"Installing on iPhone 16..."}
{"type":"status","stage":"LAUNCHING","message":"Launching app..."}
{"type":"app_launched","appId":"abc123","bundleId":"com.example.MyApp","pid":54321}
{"type":"result","success":true,"operation":"launch","appId":"abc123"}
App Launched Event:
{
  "type": "app_launched",
  "appId": "abc123",
  "bundleId": "com.example.MyApp",
  "pid": 54321,
  "targetType": "simulator",
  "targetName": "iPhone 16"
}

flowdeck clean

Clean build artifacts for a project.
# Clean with workspace and scheme
flowdeck clean --workspace MyApp.xcworkspace --scheme MyApp

# Clean with custom derived data path
flowdeck clean --workspace MyApp.xcworkspace --scheme MyApp --derived-data-path /tmp/DerivedData

# Clean using config file
flowdeck clean --config .flowdeck/state.json

# Delete ALL DerivedData (nuclear option)
flowdeck clean --derived-data

Options

OptionShortDescription
--workspace <path>-wPath to .xcworkspace or .xcodeproj
--scheme <name>-sScheme name
--project <path>-pProject directory
--derived-data-path <path>-dCustom derived data path
--config <path>-cPath to JSON config file
--derived-dataDelete entire ~/Library/Developer/Xcode/DerivedData folder
--json-jOutput JSON events
--verbose-vShow clean output in console

When to Use

  • Build errors that don’t make sense
  • After changing build settings
  • After switching branches with different dependencies
  • When disk space is running low

JSON Output

{
  "type": "result",
  "success": true,
  "operation": "clean",
  "message": "Clean succeeded"
}