--json for machine-readable output.
grantiva build
Build the app for a simulator using xcodebuild.
| Flag | Description |
|---|---|
--scheme | Xcode scheme to build |
--simulator | Simulator name (e.g., “iPhone 16”) |
--app-file | Path to a pre-built .app bundle or .ipa archive (skips build) |
--no-build | No-op pass-through (exits immediately) |
xcodebuild, and prints a build summary. Exits 1 on build failure.
grantiva install
Build, install, and launch the app on a simulator in one step.
| Flag | Description |
|---|---|
--scheme | Xcode scheme to build |
--simulator | Simulator name (e.g., “iPhone 16”) |
--bundle-id | App bundle identifier (derived from Info.plist if using --app-file) |
--app-file | Path to a pre-built .app bundle or .ipa archive (skips build) |
--no-build | Skip building and installing — assumes the app is already on the simulator |
- Boots the simulator
- Builds via
xcodebuild(unless--app-fileor--no-build) - Installs via
simctl install - Launches via
simctl launch
grantiva ci run, useful for iterating locally without capturing screenshots.
grantiva run
Run Maestro flows against a simulator. Reports step pass/fail for each flow and captures a screenshot on failure. Supports agent-native workflows via --keep-alive and --logs.
| Flag | Description |
|---|---|
--scheme | Xcode scheme to build |
--simulator | Simulator name (e.g., “iPhone 16”) |
--bundle-id | App bundle identifier |
--app-file | Path to a pre-built .app bundle or .ipa archive (skips build) |
--no-build | Skip building and installing — assume the app is already on the simulator |
--flow | Run a single flow YAML file instead of all configured flows |
--keep-alive | Hold the GrantivaAgent session open after flows complete so grantiva hierarchy can inspect UI state without relaunching. Release with Ctrl-C. |
--logs | Stream simulator app logs into this terminal, prefixed with [log]. Predicate auto-derived from the app’s bundle ID. |
--logs-predicate | Custom NSPredicate for simctl log stream --predicate. Implies --logs. |
--logs-level | Log level: default (warnings/errors/default), info, or debug. |
- Boots the simulator.
- Builds, installs the app (unless
--app-fileor--no-build). - Starts GrantivaAgent on the simulator. The flow drives the app — no pre-launch.
- If
--logsis set, teesxcrun simctl spawn log streamoutput inline with the flow output. - Runs all configured flows (or the single
--flowfile) and reports step pass/fail. - On failure: captures a screenshot of the simulator’s current state.
- If
--keep-alive, writes a session file to~/.grantiva/runner/sessions/<udid>.jsonand blocks waiting for Ctrl-C so external tools can inspect the final state. Otherwise the GrantivaAgent session is torn down. - Saves screenshots to
.grantiva/captures/(not compared against any baseline).
0 if all steps pass, 1 if any fail.
grantiva hierarchy
Dump the current UI hierarchy of a running simulator via an active keep-alive GrantivaAgent session. Read-only — no app relaunch, no state loss.
| Flag | Description |
|---|---|
--udid | Target a specific simulator’s session (defaults to the newest keep-alive session). |
--format | Output format: xml (default, unwrapped) or json. |
grantiva run --keep-alive to be running in another terminal (or a backgrounded process). If no keep-alive session is live, grantiva hierarchy fails with an actionable error rather than spinning up a fresh session (which would relaunch the app and destroy the state you wanted to inspect).
Typical agent workflow:
grantiva ci run
Run the full visual regression pipeline: build, capture, compare, upload.
| Flag | Description |
|---|---|
--scheme | Xcode scheme to build |
--simulator | Simulator name (e.g., “iPhone 16”) |
--bundle-id | App bundle identifier |
--app-file | Path to a pre-built .app bundle or .ipa archive (skips build) |
--no-build | Skip building and installing — assume the app is already on the simulator |
- Boots simulator
- Builds the app (unless
--app-fileor--no-buildis used) - Installs the app and starts GrantivaAgent
- Captures screenshots for all configured screens
- Compares against baselines (pixel + perceptual)
- Uploads results to the Grantiva dashboard
- Posts a GitHub Check Run with results
--app-file is provided, the binary is validated to be a simulator build and the bundle ID is derived from its Info.plist if not specified. .ipa archives are automatically extracted.
Exit code 0 if all screens pass, 1 if any fail.
grantiva diff capture
Capture screenshots without comparing.
| Flag | Description |
|---|---|
--app-file | Use a pre-built .app or .ipa instead of building |
--no-build | Skip building and installing (app must already be on simulator) |
.png files to .grantiva/captures/.
grantiva diff compare
Compare captures against baselines.
| Flag | Description |
|---|---|
--capture | Capture fresh screenshots before comparing |
--app-file | Use a pre-built binary when capturing (requires --capture) |
--no-build | Skip build/install when capturing (requires --capture) |
.grantiva/baselines/ locally. Diff images for failures are saved to .grantiva/captures/diffs/.
grantiva diff approve
Promote current captures as new baselines.
grantiva auth login
Authenticate with Grantiva.
--api-key, opens a browser login flow. With --api-key, validates the key directly. Credentials saved to ~/.grantiva/auth.json.
grantiva auth status
Show current authentication status.
GRANTIVA_API_KEY env var first, then ~/.grantiva/auth.json.
grantiva auth logout
Remove stored credentials.
grantiva doctor
Check environment and dependencies.
grantiva runner install
Extract or update the embedded UI automation runner binary.
grantiva runner start
Start the runner with WebDriverAgent and keep it alive for interactive use.
| Flag | Description |
|---|---|
--bundle-id | App bundle identifier (reads from grantiva.yml if omitted) |
--simulator | Simulator name or UDID (reads from grantiva.yml if omitted) |
--detach | Detach the runner from the terminal using nohup. The process survives terminal closure. Prints the log file path on start. |
grantiva runner dump-hierarchy to inspect the view hierarchy while running.
With --detach, the runner is launched via nohup in its own shell session so it keeps running after the terminal closes. The log file path is printed on startup — tail it with tail -f <path> to follow runner output.
grantiva runner stop
Stop the running runner session.
grantiva runner dump-hierarchy
Dump the view hierarchy from a running app.
| Flag | Description |
|---|---|
--port | WDA port (auto-detected from active session if omitted) |
--format | Output format: tree (default), json, or xml |
grantiva runner start.
grantiva runner version
Show the embedded runner version.
grantiva mcp
Start the Grantiva MCP server for AI agent integration.
grantiva init
Generate a grantiva.yml configuration file.