--json for machine-readable output.
grantiva build
Build the app for a simulator using xcodebuild.
Boots the simulator, runs
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.
What it does:
- 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.
What it does:
- 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.
Requires
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.
What it does:
- 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.
Saves
.png files to .grantiva/captures/.
grantiva diff compare
Compare captures against baselines.
Baselines are loaded from the Grantiva server (if authenticated) or
.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.
Boots the simulator, launches WDA, and writes a session file so other commands can auto-detect the port. Use
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.
Requires an active session started with
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.