CLI reference (fleetest subcommands)

in Japanese(日本語)

A list of the fleetest subcommands, grouped by purpose. --help shows the full arguments of each command. This page is a map for finding which command exists and where to read more.

How to call it

In this documentation, fleetest stands for ../fleetest/.build/debug/fleetest in the default layout where fleetest is cloned next to your work folder (see the Quick start). If you work inside the fleetest clone, swift run fleetest is equivalent.

../fleetest/.build/debug/fleetest --help                  # list of subcommands
../fleetest/.build/debug/fleetest help run                # detailed help for a subcommand
../fleetest/.build/debug/fleetest help bridge up          # detailed help for a child command
../fleetest/.build/debug/fleetest bridge --help           # list of child commands

fleetest help <subcommand> shows every option of that subcommand with its default. bridge, project, profile, devices, results, remote, services, hooks, monitor, job, vision and api have child commands. fleetest --version shows <short git revision> (protocol <version>); fleetest api version is a separate entry that returns only the protocol version as JSON.

Preparation and diagnosis

Command Description Main options Details
init Create your package (a Package.swift that depends on fleetest via SPM, plus a first test project) --no-project, --name Quick start
doctor Preflight checks for Foundation Models, Xcode and Simulators. It also stops bridges that are certainly stale --fm-only, --roots-only, --bundle <path> Troubleshooting

doctor --bundle <path> writes a zip of diagnostic logs to attach when reporting a problem (nothing is sent anywhere).

Projects and profiles

Command Description Main options Details
project create <name> Scaffold a test project and register it in Package.swift — Creating a test project
project list List test projects and whether they are registered in Package.swift — Same as above
project sync Regenerate the marker section of Package.swift from a scan of TestProjects/ (to resync after a manual copy or a git pull) — Same as above
project lint-selectors Check for drift between the #id selectors in scenarios and the contract (ui-contract.md) (only #id) --project, --contract Same as above
project copy <source> <new-name> Duplicate a test project under a new name (excludes reports / results / .fleetest state) — Same as above
project rename <old-name> <new-name> Rename a test project and update Package.swift — Same as above
project delete <name> Move a test project to the Trash and remove it from Package.swift --yes (required; without it nothing is deleted) Same as above
profile setup Create app and run profiles consistently (idempotent) --platform, --app-id, --auto-device, --count, --accept-licenses, --app-path Profiles
profile list List run profiles and their component profiles, and show how they resolve on this machine --project Same as above

The settings of a run profile are in Run profile settings.

Running and results

Command Description Main options Details
run Run Swift DSL scenarios --profile, --scenario, --folder, --failed, --dry-run, --set, --junit, --runner, --fleet Running scenarios
run-file <file> Run an unregistered .swift scenario as-is (profiles are borrowed from an existing project) --project, --profile, --scenario Running scenarios
job begin / job end Declare the planned runs up front in a script or CI pipeline that starts several runs in turn (the VSCode extension's run board then shows how many are still waiting). job begin only lists the plan and never starts a run itself begin: --title (required), --owner-pid (required), --run <project>:<profile> (repeatable) / end: --id Section below
draft-from-testbase Generate a scenario draft from a test base (docs/testbases/*.md) and write it to a file (unlike the MCP ft_draft_scenario, which drafts from the operations an AI actually performed and returns it) --testbase, --name, --no-fm, --dry-run Test bases and scenario drafts
results list List runs, newest first --since, --limit, --json Analyzing results (fleetest results, dashboard)
results summary Aggregate run count, pass rate and duration per scenario (lowest pass rate first) --scenario, --since, --json Same as above
results flaky List scenarios that both pass and fail, most flaky first --min-runs, --since Same as above
results trend Show the run history of a single scenario in chronological order --scenario (required), --since Same as above
results devices Aggregate run count and pass rate per worker (device) and per platform --since, --json Same as above
results slow List scenarios by average duration, slowest first --limit, --since Same as above
results response Aggregate response times (time to first frame and time until ready) of response-measurement runs per step, with the change from the previous run on the same host and device --since, --json Response measurement
results insights Detect things worth attention: regressions, consecutive failures, failures with a non-assertion signature, and stale selectors --since, --json Analyzing results (fleetest results, dashboard)
results log <runID> Print a run's per-scenario execution log (events/*.ndjson). The run ID can also be latest --scenario, --raw Same as above
results frames <runID> Cut frames out of a scenario's recording into one PNG contact sheet, each labelled with the recording time and the step running then (default: the first failed step and the 5 seconds before it) --scenario (required), --device, --steps, --seconds-before, --every, --out, --json Same as above
clean Delete old recordings, event logs, reports, logs, Simulator attachments and xcresult bundles. Any category above 90% of its limit is swept back down to 90% --dry-run, --recordings, --event-logs, --reports, --logs Maintenance for long-term use

Showing waiting runs with a job

A "job" here is the list of runs you are about to start (not the same thing as a CI job).

FLEETEST=../fleetest/.build/debug/fleetest   # see "How to call it" at the top of this page
FT_JOB_ID=$("$FLEETEST" job begin --title nightly --owner-pid $$ --run App:ios --run App:android) && export FT_JOB_ID
trap '"$FLEETEST" job end --id "$FT_JOB_ID" || true' EXIT
trap 'exit 130' INT TERM
rc=0
"$FLEETEST" run --project App --profile ios || rc=1
"$FLEETEST" run --project App --profile android || rc=1
exit $rc

Devices and bridges

Command Description Main options Details
devices up Start the devices in the run profiles (at most two at a time; already-running devices are skipped) --profile, --no-bridge, --device-machine Running scenarios
devices down Stop every bridge and shut down Simulators and Emulators (physical devices are never shut down, only their bridges are stopped). With --profile, only that profile's devices; without it, the devices and bridges of every registered runner machine are also stopped over SSH, in addition to this Mac (add --profile to stop only local devices). devices up acts on this Mac only --profile, --device-machine, --force Parallel execution
bridge up Start the bridge and keep it resident (iOS: a Simulator runner / Android: an on-device server) --device, --port, --physical, --platform, --with-sample-app (iOS only: also build and install SampleApp) Parallel execution
bridge down Stop the bridge --port, --all, --platform, --force Parallel execution, Adding physical devices
bridge status Show the bridge status --platform, --port, --serial Troubleshooting
install <package-path> Install an app from a package file (iOS: .app bundle / Android: .apk or .apks) --platform, --port, --serial "Operating a device by hand" below
launch <bundle-id> Launch the app under test Same as above Same as above
terminate Terminate the app under test Same as above Same as above
monitor pause Stop this Mac's Device Monitor (observation and streaming) --for <minutes> Response measurement
monitor resume Release the hold (idempotent) — Same as above
monitor status Show whether a hold is active — Same as above

monitor pause stops the monitor's polling and makes the VSCode extension close its streaming helpers, for example before a performance-measuring run (run --performance). It does not kill any process (killed processes just get restarted by the extension). An expired --for releases the hold by itself.

Operating a device by hand

These are the CLI versions of the same operations as the MCP ft_* tools (MCP server). They send screen reading and basic operations directly to a device whose bridge is running, which is useful for looking at a screen before writing a scenario or for isolating a problem. The target is given by the common options --platform (ios / android; default ios), --port (the iOS bridge port; default 8123) and --serial (the Android device; optional when only one is connected).

Command Description Main options
snapshot Print the accessibility tree of the current screen (compressed) --json (raw JSON)
tap Tap a coordinate --x, --y (iOS: pt / Android: px, the same units as the snapshot frames)
type <text> Type text into the focused element —
swipe <direction> Swipe (direction: up / down / left / right) —
press Long-press a coordinate --x, --y, --hold-seconds (up to 10 s), --max-gesture-seconds (allow up to 60 s for this press)
screenshot Save a screenshot -o / --output (default screenshot.png)

install, launch and terminate take the same target options. To operate an element by its reference number, use the MCP tools (ft_tap and others).

Services and hooks

Command Description Main options Details
services up Start the services declared in scripts/compose.yaml and keep them running until services down (for exploration, Live Control and scenario writing; a run takes them over and starts them again) --profile, --physical, --serial Services the app depends on
services down Stop the services started by services up (services held by a run are left to that run) --profile Same as above
services status Show the leases, the lock and the runtime resources of this workspace's services --profile Same as above
services pull Pull the images compose.yaml declares ahead of a run (and build the relay image on first use) --refresh Same as above
services load Load images from a tar archive into this Mac's container runtime, for machines without network access to the registry — Same as above
services reset Remove this workspace's service containers, networks and volumes, and its leases and lock --force (stop a resident services up first, then remove) Same as above
hooks reap Run the teardown scripts left behind by runs that died before they could clean up --quiet Same as above

Fleet

Command Description Main options Details
remote setup <runner> Provision a runner machine to receive --runner dispatches (idempotent) --remote-dir, --skip-verify Adding a Mac
remote machines Manage the machine registry (local alias to SSH destination). Child commands: list (default), add, remove add <machine> --host <destination> Remote runs
remote status Show reachability, login state, git revision, toolchain and free disk space of the runner machines --runner, --fm, --json Same as above
remote align Fetch, checkout and build the local HEAD revision on a runner (the align step of remote setup alone) --remote-dir Same as above
remote exec <runner> -- <args> Run fleetest <args> on a runner machine and relay its output and exit code --remote-dir (before the --) Same as above
remote clean Stop orphaned bridges and Simulators and delete results, reports and dispatch leftovers older than --keep-days on runner machines --runner, --keep-days, --dry-run (only list what would be deleted), --ignore-lock (kills a running run) Same as above
remote unlock Release a dispatch lock that a dead dispatch left behind (never releases a lock whose run is still alive unless --force) --runner, --force Same as above
remote teardown Delete the remote base directory of a runner (destructive) --remote-dir Same as above

The --runner (send to one runner), --fleet (send across several machines with a fleet definition), --split, --broadcast and --wait-lock options of run are described in Remote runs and Parallel execution.

Images

Command Description Main options Details
vision capture Crop an element from the live screen by its accessibility frame and save it as a sample image of an image classifier --classifier, --label, --selector (all required), --name Image assertion
vision check Train the classifiers if needed and report the sample images each one cannot tell apart (warnings only; the exit code stays 0) --classifier, --project Same as above

For external tools (api)

api is the machine-facing entry used by external tools such as the VSCode extension and the MCP server (JSON or NDJSON on standard output, diagnostics on standard error). It is not meant to be typed by hand. Only representative child commands are listed here; fleetest api --help shows all of them.

Child command Description
api list-scenarios Print the scenario list as JSON, including source locations (file and line)
api steps Dry-run a scenario and print the equivalent of its step table as JSON
api run Run scenarios and stream events as NDJSON
api monitor Poll the devices in the run profiles at a fixed interval and stream their state and screenshots as NDJSON
api list-devices Evaluate every device on this machine and its current state once, and print it as JSON
api validate-profile Validate the profile JSON (apps / runs)
api results Aggregate the run-results database (the machine-facing side of fleetest results)
api retention Read or update the retention policy
api install-ios-runtime --version <SDK version> Download and install the iOS Simulator runtime of the selected Xcode (NDJSON). Does nothing if it is installed; refuses a version other than the Xcode SDK's. The VSCode extension's "Add device" calls it once before creating a device

For the extension see the VSCode extension, and for MCP see the MCP server.