Skip to main content

Generate a config file

This writes grantiva.yml in the current directory. The scheme is taken from the name of the .xcworkspace or .xcodeproj it finds there; the simulator defaults to iPhone 16. If grantiva.yml already exists, the command leaves it alone.
grantiva init is the one command with no --json. It still takes --verbose and --quiet.

Configuration reference

Every top-level key can be overridden on the command line: --scheme, --simulator, --bundle-id.
When you use --app-file to provide a pre-built binary, scheme is not required. The bundle ID is derived from the binary’s Info.plist if not specified.

Screens

Each screen has a name and a path that describes how to navigate to it.

Simple launch screenshot

A screenshot is taken automatically at the end of each screen’s path.

Flows

The flows: key lists paths to existing Maestro YAML files that grantiva run executes as standalone functional tests, in addition to any screens: entries.
How it differs from screens: Paths are resolved relative to the directory containing grantiva.yml. Flows with the same basename in different directories (smoke/login.yaml, regression/login.yaml) are staged separately, so one cannot shadow the other. grantiva run runs all screens: first, then each flow in flows: order, in a single GrantivaAgent session. By default the suite stops at the first broken flow; --continue-on-failure runs the rest. A runner failure captures a simctl screenshot of the current simulator state for debugging. Screenshots go to .grantiva/captures/, or to <report-dir>/captures when --report-dir is given. grantiva run --flow <path> runs one file and skips screens: entirely.
flows: is only used by grantiva run. The grantiva ci run and grantiva diff pipelines only process screens:.

Maestro compatibility

Grantiva can read Maestro flow files as a drop-in replacement. If you have existing Maestro flows, there’s no need to rewrite them.

Auto-detection

Grantiva auto-detects the format when loading configuration:
  1. Looks for grantiva.yml — parses it as Grantiva or Maestro format (auto-detected)
  2. If there is no grantiva.yml, looks for a .maestro/ directory and loads all flow files
A file is treated as Maestro format when it contains an appId: key or a line starting with - tapOn:, - launchApp, - inputText:, - assertVisible:, or - takeScreenshot:.

Using Maestro flows

Write grantiva.yml in Maestro format, or place flows in .maestro/:
Each takeScreenshot becomes a named screen capture point. Commands between screenshots become navigation steps.

Supported Maestro commands

Unsupported commands (pressKey, setPermissions, evalScript, repeat, and others) are silently skipped.

Sub-flows

Maestro sub-flows referenced via runFlow are also parsed in Maestro format when auto-detected. You can mix Grantiva and Maestro flow files.

Diff thresholds

A screen fails if either threshold is exceeded.

Build settings

Pass extra flags directly to xcodebuild:
Each entry is appended verbatim to the xcodebuild invocation. The --derived-data-path flag is available on every command that builds the app. When both are given it wins: any -derivedDataPath in build_settings is stripped and replaced. Absolute and relative paths both work, including paths containing spaces.

Accessibility rules

a11y.rules selects which rules the grantiva_a11y_check MCP tool enforces. Both rules run when the key is absent.

Directory structure

Commands write under .grantiva/ in your project:
grantiva run --report-dir <dir> moves the runner’s report.json, assets, failure screenshots, and captures under that directory instead, so nothing is written to ./.grantiva. Credentials live outside the project, at ~/.grantiva/auth.json. Keep-alive session files are at ~/.grantiva/runner/sessions/, and the simulator capacity registry at ~/.grantiva/simulator-capacity/.

Next steps