> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mobster.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Checks, assertions and verdicts

> The check file, every assertion, the verdict rules and the result JSON, for mobster test, mobster verify and the MCP tools.

A check says what must be true of an iOS app after a flow, such as "The Mozilla bookmark opens mozilla.org". Mobster runs the flow, then decides on the app's accessibility tree and any app-state expectations you registered. [Test your app](https://docs.mobster.dev/quickstart/test.md) walks through a first one.

A check is a YAML file in `.mobster/checks`, and `mobster test` runs them all. `mobster verify` runs one, from flags (`--text …`) or a file (`--check`), and `--save NAME` writes the file. The MCP tools take the same fields as arguments ([MCP server](https://docs.mobster.dev/mcp-server.md)).

> [!NOTE]
>
> You get this in the next release, not in Mobster for Mac 0.4.0 or Mobster CLI 0.4.4.

`mobster test guide` prints the check file, the assertions and how to read a result on one page of about 1,500 tokens, for you or a coding agent. The Agent Skill ships the same page.

## The check file

A check of Firefox for iOS, built from mozilla-mobile/firefox-ios:

```yaml theme={"theme":"css-variables"}
# .mobster/checks/mozilla-bookmark.yaml
version: 1
name: The Mozilla bookmark opens mozilla.org
app:
  bundle: org.mozilla.ios.Firefox
  path: .mobster/build/Build/Products/Debug-iphonesimulator/Firefox.app
device: iPhone 17 Pro
runtime: iOS 26.4
reset: reinstall
tags: [smoke, bookmarks]
steps:
  - Open Bookmarks and tap Mozilla.
expect:
  - name: The address bar shows mozilla.org
    text: mozilla.org
  - name: The page shows its links
    count: { role: link }
    at_least: 1
  - name: Bookmarks closed
    absent: { label: Bookmarks, role: navbar }
budget: { max_seconds: 180, max_usd: 0.25 }
```

A `.json` file with the same shape works too.

| Key | Required | Meaning |
| - | - | - |
| `version` | no | `1`, the only version |
| `name` | no | The check's name in reports, up to 120 characters |
| `app.bundle` | unless `app.path` is given | The app's bundle ID |
| `app.path` | no | The `.app` built for the iOS Simulator, relative to the project root. Mobster installs it before the run and reads the bundle ID from its `Info.plist`. With `MOBSTER_EXPERIMENTAL_ANDROID=1`, an `.apk` runs on an Android emulator ([Android](https://docs.mobster.dev/android.md)) |
| `device` | no | The simulator device type. Default `iPhone 17 Pro`, else the newest available iPhone |
| `runtime` | no | The iOS runtime, such as `iOS 26.4`. Default: the newest installed |
| `fixture` | no | A fixture name, or a list of them, from `.mobster/fixtures/`: the state the check starts from ([Fixtures](https://docs.mobster.dev/fixtures.md)) |
| `business` | no | A locally registered simulator app-state fixture and up to 20 field comparisons. Saved check files only. See [Check app state your app saves](#check-persisted-app-state) |
| `reset` | no | `none`, `data` or `reinstall` (see [Reset levels](https://docs.mobster.dev/simulators.md#reset-levels)). Default `reinstall` with `app.path`, else `data` |
| `tags` | no | Up to 10 words (`a-z`, `0-9`, `-` and `_`) that `mobster test --tag` picks checks by, such as `[smoke, tasks]`. Check files only, not tool arguments |
| `schedule` | no | `every 1h` (minutes, hours or days, 5 minutes to 7 days) or a five-field cron. While Mobster runs, it runs this check by itself on that schedule ([Scheduled health checks](https://docs.mobster.dev/testing.md#scheduled-health-checks)). Check files only |
| `launch.args` | no | Launch arguments, up to 20 |
| `launch.env` | no | Launch environment variables, up to 20. Keys match `[A-Z_][A-Z0-9_]*`. Each reaches the app as `KEY` |
| `launch.url` | no | A deep link opened after launch, up to 2,000 characters. [Deep links](https://docs.mobster.dev/deep-links.md) lists the ones your project has and opens them by name in steps |
| `steps` | no | The flow in plain English, up to 20 steps of up to 500 characters. None means a launch-only check |
| `relaunch` (next release) | no | The steps, by number and in order, that quit and reopen the app, such as `[3]`; `[]` says none does. The run needs a quit and reopen for each listed step, and its first quit and reopen counts for the first one listed, the second for the second. With fewer, it ends `needs_review`, class `step_not_done`. With no key, Mobster reads the steps widely: a step with a quit word (quit, kill, terminate, restart, relaunch, reopen, cold start) that mentions the app, by "app" or by name, needs a quit and reopen too, and `relaunch: []` says a step like that doesn't ask. A fixture's steps are read the same way and come first; reword a fixture's step that reads as one and doesn't ask. `mobster test migrate [CHECK or FOLDER ...] [--dry-run]` (next release) writes the key into every check `mobster test` runs: the steps with a quit word, or `[]` when no step has one. It leaves a check whose quit word names an app it can't name, and lists it for you. A check you save (`--save`, `save_check`, a task's draft) or import from Maestro gets the key when it's written |
| `expect` | no | Accessibility-tree assertions, up to 50, and at most one `snapshot` entry ([Snapshot](#snapshot)). With no other deciding assertion or audit, the run ends `needs_review` |
| `throughout` | no | Assertions that must hold on every screen the run visits. Only `no_text` and `absent`, such as `no_text: /lorem ipsum/i`. A screen that breaks one is a finding with that frame |
| `somewhere` | no | Assertions that must hold on at least one screen the run visits. A miss is a finding for a person, because the run may not have reached the screen |
| `audit` | no | Audits by name. `usage-descriptions` and `privacy-manifest` read the built app and need `app.path` ([App Review pre-check](https://docs.mobster.dev/dev/app-review.md)). `a11y` reads the accessibility trees the run reads and needs no build: see [Accessibility audit](https://docs.mobster.dev/accessibility.md) |
| `conditions` | no | The device's state while the check runs: `appearance`, `locale`, `content_size`, `location`, `permissions`, `media`, `status_bar` and `push`, and also `increase_contrast`, `route`, `biometric` and `network`. Mobster checks them when it loads the file. You can use lists for `appearance`, `content_size` and `locale`. The check runs once for each combination. See [Device conditions](https://docs.mobster.dev/testing.md#device-conditions) |
| `dialogs` | no | How the run answers iOS's own dialogs with no model: `permissions` (`allow`, `deny`, `ask`), `paste` (`allow`, `deny`, `ask`), `sign_in_with_apple` (`continue`, `cancel`), `biometric` (`match`, `nonmatch`, `cancel`) and `purchase` (`confirm`, `cancel`). A fixture can hold the same block. On your iPhone only the keys you name apply: `permissions: allow` and `sign_in_with_apple: continue` press there too, and a purchase or a Face ID match never does. The app's own alerts and screens are never answered. See [System dialogs](https://docs.mobster.dev/testing.md#system-dialogs) |
| `expect` wire assertions | no | `request`, `no_request` and `storage` entries in `expect` judge what the app sent over the network and stored in its container, on a simulator, behind `MOBSTER_EXPERIMENTAL_NETWORK=1`. See [Wire assertions](https://docs.mobster.dev/testing.md#wire-assertions) |
| `stubs` | no | Fixed responses to named requests, served on a simulator by a local proxy: `match` (`host`, `path_prefix`, `method`) and `respond` (`status`, `json` or `file`, `delay_ms`). See [Network conditions and stubs](https://docs.mobster.dev/testing.md#network-conditions-and-stubs) |
| `budget.max_seconds` | no | The time limit for the steps, in seconds. Default 180, at most 600 |
| `budget.max_usd` | no | The model spend cap for the steps, in US dollars. Default 0.25, at most 1.00 |
| `budget.launch_ms` | no | The most milliseconds the app may take from a cold launch to its first stable screen, at most 600,000. A run over it fails with class `budget_exceeded`. Check files only. [What a check measures](https://docs.mobster.dev/testing.md#what-a-check-measures) says how the time is taken |
| `budget.memory_mb` | no | The most megabytes of resident memory the app may peak at during the run, at most 65,536. A run over it fails with class `budget_exceeded`. Simulator only |
| `budget.hangs` | no | The most hangs of 250 ms or longer the app may log during the run, from 0 to 1,000. A run over it fails with class `budget_exceeded` |

Rules:

* An unknown key at any level is an error, so a typo can't quietly weaken a check.
* `launch` and `budget` take an object or `null`. A boolean, number, string or list is an error.
* `text` and `no_text` take a string or a list of strings. A list becomes one assertion per string.
* The **project root** is the folder that holds `.mobster/`, found by walking up from the check file. Without one, it is the check file's folder. Your home folder is never a project, so keep checks in your app's folder.
* YAML is read with PyYAML's `safe_load`. Quote a value that YAML would read as something else, such as `"YES"` or `"1.0"`.

### Get autocomplete in your editor

A check file has a JSON Schema at `https://mobster.dev/schema/check.json`. A check Mobster saves names it on its first line:

```yaml theme={"theme":"css-variables"}
# yaml-language-server: $schema=https://mobster.dev/schema/check.json
```

Put the same line at the top of a check you write by hand. VS Code with Red Hat's YAML extension, or any editor that runs `yaml-language-server`, then completes the keys and underlines a typo as you type. In a JetBrains IDE, map the URL to `.mobster/checks/*.yaml` under Settings › Languages & Frameworks › Schemas and DTDs › JSON Schema Mappings.

The schema never refuses a check Mobster reads. Mobster still checks what a schema can't see, such as a `/regex/` that doesn't compile, and names the line when the check loads.

### Keep test credentials out of the repository

A sign-in flow needs a test account. Name its variables in `.mobster/env.example`, which you commit, and keep the values in your Keychain:

```text theme={"theme":"css-variables"}
# .mobster/env.example: names only
TEST_EMAIL
TEST_PASSWORD
```

```sh theme={"theme":"css-variables"}
mobster env set TEST_EMAIL        # asks for the value, hidden
printf '%s' "$PW" | mobster env set TEST_PASSWORD --stdin
mobster env list
```

```text theme={"theme":"css-variables"}
TEST_EMAIL     set (keychain)
TEST_PASSWORD  set (keychain)
```

Write `${TEST_EMAIL}` in `launch.args`, `launch.env`, `launch.url` and in `steps`. A run fills the names in when it starts:

```yaml theme={"theme":"css-variables"}
launch:
  env: {API_TOKEN: "${API_TOKEN}"}
steps:
  - Sign in as ${TEST_EMAIL} with ${TEST_PASSWORD}
```

* **Values stay out of the project.** `env set` writes the value to the login Keychain, per project folder, and adds only the name to `env.example`. It never takes a value as an argument, and nothing prints one.
* **Masked everywhere the run writes.** Every text file in the run folder, the step list and the progress lines show `••••••` where a value was. `check.yaml` keeps `${TEST_PASSWORD}`. A check that uses a project secret runs its steps with a model every time and keeps no replay, because a recorded path could hold the value.
* **Steps reach your model.** A secret in a step goes to the model that types it. Use a throwaway test account. A screenshot of a field that shows its text isn't masked.
* **A missing value refuses the run.** A name with no value, or one missing from `env.example`, ends the run `couldnt_run` (class `usage`) before a simulator starts, and names the variable.
* **CI.** With no Keychain value, an environment variable of the same name supplies it, so a CI job sets `TEST_PASSWORD` as its own secret.

Mobster for Mac's API lists and sets them: `GET`, `POST` and `DELETE /api/project/env` take the project folder as `root`, and never return a value.

### The project folder

```text theme={"theme":"css-variables"}
.mobster/
  .gitignore       "runs/", "build/", "cache/", "test-results/", "ci/" and "memory.yaml.lock", written the first time Mobster creates .mobster/
  checks/          saved checks: commit these
  fixtures.json    registered app-state adapters and named scalar starting states: review and commit this
  matrix.yaml      the simulators `mobster test` runs every check on, when you give it none: commit it
  quarantine.yaml  checks `mobster test` runs and reports but never fails on: commit it
  workflows/       workflows as files, kept in step with Mobster for Mac (/projects#workflows-as-files): commit these
  runs/<run_id>/   one folder per run
  test-results/    one folder per `mobster test` run: results.json, junit.xml, index.html
  build/           a good -derivedDataPath for simulator builds
  ci/              the report of the last `mobster ci run`: pr.json, junit.xml, the comment, frames, GIFs and videos
```

A `.gitignore` an earlier Mobster wrote, word for word, gains the folders it lacks; one you edited is left as it is.

A `run_id` is the local time plus 4 random hex characters, such as `20261001-101500-3f9a`.

## Assertions

Every assertion is an object with exactly one kind key. Mobster checks it against the accessibility tree that WebDriverAgent reports for the app. No model, OCR or pixel comparison is involved.

| Kind | Form | Holds when |
| - | - | - |
| Text present | `text: "mozilla.org"` | A shown element's label or value contains the text |
| Text absent | `no_text: "Loading"` | No shown element's label or value contains it |
| Element shown | `visible: {selector}` | At least one shown element matches the selector |
| Element absent | `absent: {selector}` | No shown element matches |
| Value | `value: {selector}` with `equals: X` | Exactly one shown element matches, and its value equals X. No match fails as "not found", and two or more as "ambiguous" |
| Count | `count: {selector}` with `equals: N`, `at_least: N` or `at_most: N` | The number of shown elements that match meets the bound |

Any assertion can also have a `name`: a label of up to 120 characters used in reports.

### Check app state your app saves

An app that implements the `mobster.business/1` protocol can publish a small snapshot of its saved model on a Mobster simulator, and a check can assert on its fields. Register the bundle, the field names and named starting states in `.mobster/fixtures.json`, apart from the YAML fixtures in `.mobster/fixtures/`. A check picks a registered adapter and fixture. It can't pass a command, URL or file path through `business`.

```json theme={"theme":"css-variables"}
{
  "version": 1,
  "adapters": {
    "yourapp": {
      "kind": "app_container_json",
      "bundle": "com.example.yourapp",
      "fields": ["cart.count"],
      "fixtures": {"empty-cart": {"cart.count": 0}}
    }
  }
}
```

```yaml theme={"theme":"css-variables"}
# In a saved check for com.example.yourapp
business:
  adapter: yourapp
  fixture: empty-cart
  expect:
    - field: cart.count
      equals: 1
```

Before launch, Mobster resets the app and writes `Documents/mobster-business.json`: `schema: "mobster.business/1"`, a fresh `runToken`, `generation: 0` and the fixture's `state`. It launches the app with `-MobsterBusinessRun <runToken>`. Your app checks the token, loads a test model from the seed, and writes its saved model back to the same file, atomically, with the same token and `generation` 1 or more. It writes again after each change, from the saved value, not from the screen. A seed the app never rewrote can't satisfy an assertion. `reset: none` and real iPhones refuse this fixture.

Each `business.expect` field is compared against one snapshot the app wrote. Field names are literal keys. `true` differs from `1`, and the numbers `1` and `1.0` are equal. A mismatch fails the check. A missing, stale or malformed snapshot ends `couldnt_run`, class `business_evidence`. An empty `business.expect` can't make a check pass by itself. A fixture write or cleanup with an unknown outcome stops the run with no retry and says what to reconcile.

The snapshot is what your app says it saved. It doesn't check a server, and Mobster reads no other app data.

### Selectors

A selector has at least one of these fields, and every field given must match.

| Field | Matches | Notes |
| - | - | - |
| `id` | The accessibility identifier | Set in SwiftUI with `.accessibilityIdentifier("checkout_total")`. An element with no identifier never matches `id` |
| `label` | The accessibility label | Exact, or a `/regex/` |
| `value` | The accessibility value | Exact, or a `/regex/`. A switch's value is `1` or `0` |
| `role` | The element type | A role from the table below, or any `XCUIElementType` name with or without the prefix |
| `enabled` | `true` or `false` | |
| `selected` | `true` or `false` | From the `Selected` trait, which SwiftUI sets with `.accessibilityAddTraits(.isSelected)` |

| Role | Element types |
| - | - |
| `button` | Button |
| `text` | StaticText |
| `field` | TextField, SecureTextField, SearchField, TextView |
| `switch`, `toggle` | Switch, Toggle |
| `cell` | Cell |
| `image` | Image, Icon |
| `link` | Link |
| `tab` | Tab, and a Button inside a TabBar |
| `slider` | Slider |
| `stepper` | Stepper |
| `picker` | Picker, PickerWheel, DatePicker |
| `segment` | SegmentedControl |
| `navbar` | NavigationBar |
| `alert` | Alert |

A string written `/pattern/` or `/pattern/i` is a regular expression, matched with Python's `re.search`. `i` ignores case. A pattern is up to 500 characters, and an invalid one is a usage error.

### Matching

Before comparing, Mobster normalizes text: NFKC, curly quotes and dashes become ASCII, invisible marks such as zero-width spaces are removed, and every run of whitespace becomes one space.

* `text` and `no_text` ignore case and match a substring of one element's label or value. They never join two elements, so "Mozilla" in one element and "Firefox" in the next don't make "Mozilla Firefox".
* Selector fields are exact and case-sensitive, unless they are a `/regex/`.
* `equals` on a `value` assertion compares by its type. `true` and `false` compare on/off meaning, so `1`, `on` and `yes` equal `true`. A number compares the first number in the element's value, at the expected number's precision, with thousands separators removed. A string compares exactly.
* `equals`, `at_least` and `at_most` on a `count` are whole numbers from 0.

### What counts as shown

An element is shown when WebDriverAgent reports it visible, its frame overlaps the app's frame, and it isn't the application or a window. Each element is judged on its own, so the rows of a SwiftUI `Form` or `List` are shown even when iOS reports their container hidden. Content scrolled out of view isn't shown: scroll to it first, with `swipe` and `until` from a coding agent, or in a plain-English step.

Secure text fields count as shown, so `visible: {role: field, label: Password}` works. Their value reads as bullets.

### Timing

Mobster decides on a settled screen, with every assertion on one read:

1. It reads the tree, waits 0.3 s, and reads again. Two reads with the same fingerprint are settled.
2. When a settled read satisfies every assertion, that read decides.
3. Otherwise it reads again every 0.5 s until the assertion timeout (5 s by default, `--assert-timeout` from 0 to 60).
4. At the timeout the last read decides, and the result says whether the screen was still changing.

Two assertions that hold on two different reads never combine into a pass.

### Compare the screen to a baseline

A `snapshot` entry in `expect` compares the screen the check ends on to a baseline PNG:

```yaml theme={"theme":"css-variables"}
expect:
  - text: Home
  - snapshot: home
    mask: [{ id: clock }, { label: Last synced }, { rect: [0, 100, 390, 40] }]
    threshold: 0.1
```

| Key | Meaning |
| - | - |
| `snapshot` | The screen's name: 1 to 60 of `a-z`, `0-9`, `-` and `_`. It names the baseline file. A check has one snapshot, because it ends on one screen |
| `mask` | Regions the diff ignores, up to 20: the elements an `id` or `label` matches, or a `rect` in points as `[x, y, width, height]` |
| `threshold` | The percent of the unmasked pixels that may differ, from 0 to 100. Default 0.1 |

A snapshot is decided by pixels, not the accessibility tree, so it isn't an assertion: it has no `name`, `equals` or selector, and `--expect` and the MCP `expect` list don't take it. A changed screen fails the check (rule 7 below). A first run records the baseline and needs review (rule 8). [Screenshots that must not change](https://docs.mobster.dev/testing.md#screenshots-that-must-not-change) says how the comparison works, where baselines live and how to update them.

## Check a sound the iPhone plays

`expect: [{sound: sent}]` passes when the iPhone plays a sound you recorded once, such as the chime your app makes when a message sends. Mobster compares the shape of the sound's spectrum in code, with no model. Set `MOBSTER_EXPERIMENTAL_SOUND=1` to use it.

Record the sound once per app, from a short WAV (16-bit PCM, up to 5 s) of that sound alone:

```sh theme={"theme":"css-variables"}
python -m mobile_agent.verify.sound record --bundle com.example.app --name sent --wav sent.wav
```

```text theme={"theme":"css-variables"}
wrote .mobster/sounds/com.example.app/sent.json
```

Commit the file. The fingerprint is a few kilobytes and matches at any volume, anywhere in the recording.

During a run, Mobster records the iPhone's sound for 20 seconds from the first step, through the same path as `listen`, and matches it when the steps end. A sound heard passes, with the time it was heard. A sound not heard fails with the best match it found, and a missing fingerprint or recording fails and says why.

It works on a real iPhone over USB only. On a simulator the sound plays on your Mac, so the assertion fails and says so. Sound sent to Bluetooth or AirPlay isn't heard. Opening the phone's capture device resets its USB network link for a moment, which can pause WebDriverAgent, so try it on your device before you rely on it.

## Check widgets, Spotlight and other system surfaces

`surfaces` checks what your app puts outside its own window: a widget, a Live Activity, its Spotlight results, the share sheet. Mobster drives each one from outside the app with WebDriverAgent on a simulator, reads it from its accessibility tree, and judges it with the [assertions](#assertions) above. A surface runs after the check's steps, and the app comes back to the front before the verdict is read. Set `MOBSTER_EXPERIMENTAL_SYSTEM_SURFACES=1` to use it. Without it, a check with the key is refused.

```yaml theme={"theme":"css-variables"}
surfaces:
  - surface: widget
    add: YourApp
    expect: [{text: Today}]
  - surface: live_activity
    where: lock_screen
    expect: [{text: Today}]
  - surface: spotlight
    query: YourApp
    expect: [{text: YourApp}]
    pick: {label: YourApp, role: cell}
    then: [{text: Today}]
```

Every surface takes `name` (its label in the report) and `expect`, what must show once the surface is up. `spotlight`, `share_sheet` and `control_center` also take `pick`, an element to tap (text for its label, or a selector), and `then`, what must show after it. A surface with no `expect` and no `then` checks nothing and is refused.

| `surface` | Keys | What Mobster does |
| - | - | - |
| `intent` | `shortcut` (a shortcut's name) and `input`, or `siri` (a phrase) | Opens `shortcuts://run-shortcut?name=...` so Shortcuts runs the app's App Intent, or sends the phrase to Siri, then reads the screen. The shortcut must exist on the simulator |
| `widget` | `add` (the app's name) | Presses Home. With `add`, presses and holds an empty spot, taps **Edit** (or **Edit Home Screen**), **Add Widget**, searches the gallery for the app, taps the app's row, **Add Widget** and **Done**. Then reads the Home Screen |
| `live_activity` | `where`: `dynamic_island` (default) or `lock_screen`; `expanded` | Your steps start the activity. Mobster presses Home and reads the Dynamic Island, or locks the simulator, reads the Lock Screen and unlocks it. `expanded: true` presses and holds the island first |
| `control_center` | `pick`, `then` | Swipes down from the top right and reads Control Center |
| `app_clip` | `bundle`, `url`, `path` (a Clip `.app` to install first) | Launches the Clip with its invocation URL in `_XCAppClipURL`, as Xcode's scheme does, and reads it |
| `spotlight` | `query`, `pick`, `then` | Presses Home, swipes down, types the query and reads the results |
| `share_sheet` | `open` (the app's own share control), `pick`, `then` | Taps `open`, reads the sheet, taps `pick`. With no `pick`, taps outside the sheet to close it |

The strings Mobster looks for are English, so run the simulator in English. On a simulator:

* Control Center shows no controls, so a `pick` there has nothing to tap.
* `siri:` shows nothing.
* A `pick` inside the share sheet misses, because the sheet reports its targets' frames from its own top edge. A `pick` of the app's own menu item works.

### What fails, and how

A surface that doesn't show, or whose assertion doesn't hold, is a fail-level `finding` with the surface's frame, and the next surface still runs. The verdict is `failed`, class `finding`. An action WebDriverAgent never answered ends the run as `unknown_outcome`, and is never sent again.

Surfaces run on simulators only. On a real iPhone the run ends `couldnt_run`, class `environment`, before it presses anything.

### No simulator path

The `app_clip` step takes `via`: `url`, `nfc`, `qr`, `banner` or `maps`. Only `url` runs on a simulator. The others end the run as `couldnt_run` with "Not on a simulator", so a check that names a tag or a place card can't pass by skipping it. Mobster doesn't push Live Activity updates from a server: start and update the activity in your app's steps.

## Verdicts and exit codes

| Verdict | Exit | Means |
| - | - | - |
| `passed` | 0 | The assertions and execution checks passed |
| `failed` | 1 | An assertion or another check failed, such as crash detection |
| `needs_review` | 2 | The run needs review, for example because evidence or required measurements are missing |
| `couldnt_run` | 3 | The run could not finish, for example because of an invalid check, an execution error or a resource limit |

`ctrl+c` exits 130 (SIGTERM 143, SIGHUP 129), and the run ends as `couldnt_run`, class `stopped`. A usage error in `mobster verify` exits 3, not 2, because 2 means needs review.

The first rule that applies decides:

| # | Condition | Verdict | `reason.class` |
| - | - | - | - |
| 1 | The check or an assertion is invalid, or steps were given to `mobster verify --keyless`, or with no key and nothing recorded to replay | couldnt\_run | `usage` |
| 2 | The steps need a model and there is no key for it (Anthropic or OpenAI) | couldnt\_run | `model` |
| 3 | Xcode, the runtime or the device type is missing | couldnt\_run | `environment` |
| 3 | The simulator couldn't be created or booted | couldnt\_run | `simulator` |
| 3 | WebDriverAgent couldn't be built, started or read | couldnt\_run | `wda` |
| 3 | The `.app` is invalid, is a device build, or didn't install | couldnt\_run | `install` |
| 3 | The app didn't launch | couldnt\_run | `launch` |
| 3 | Every Mobster simulator is in use | couldnt\_run | `busy` |
| 4 | The model failed or ran out of credit | couldnt\_run | `model` |
| 4 | The run lost WebDriverAgent past recovery | couldnt\_run | `wda` |
| 4 | The run hit its spend cap and an assertion fails | couldnt\_run | `budget` |
| 4 | You stopped the run, or a key-less session sat idle for 15 minutes | couldnt\_run | `stopped` |
| 4 | A replay or a launch-only check meets an iOS dialog that `dialogs` has no answer for on this device, or can't confirm the answer it gave | couldnt\_run | `system_dialog` |
| 4 | On your iPhone, a step was refused because **Ask before acting** asks about it, or the model opened another app, whatever the assertions say ([On your iPhone](https://docs.mobster.dev/testing.md#on-your-iphone)) | couldnt\_run | `usage` |
| 4 | An unexpected error. The traceback is in `run.log` | couldnt\_run | `internal` |
| 4 | An action may have reached the device but Mobster can't confirm it. It is never retried | couldnt\_run | `unknown_outcome` |
| 4 | Mobster could not save a durable action intent before dispatch | couldnt\_run | `journal` |
| 4 | An app-state fixture cannot be registered, seeded or observed | couldnt\_run | `business` or `business_evidence` |
| 4 | Fixture cleanup could not be confirmed | couldnt\_run | `business_cleanup` |
| 5 | The app crashed during the run: its process ended on a signal, the watchdog or jetsam, whatever the assertions say | failed | `app_crashed` |
| 5 | The app in front at the end isn't the app under test: the flow left it, or it crashed where Mobster reads no log (a WebDriverAgent address) | failed | `app_not_running` |
| 6 | A replay stopped at a changed step, and an assertion failed or the recording has a step you rejected a heal for ([Replay and heals](https://docs.mobster.dev/testing.md#replay-and-heals)) | failed | `drift` |
| 6 | A replay stopped at a changed step, and every assertion held | needs\_review | `drift` |
| 6 | An assertion failed, and the model ended blocked, out of time or out of steps | failed | `blocked` |
| 6 | An assertion failed | failed | `assertion` |
| 6 | A fresh app-produced persisted value did not equal the registered expectation | failed | `business` |
| 7 | The run measured more than a `budget.launch_ms`, `budget.memory_mb` or `budget.hangs` allows | failed | `budget_exceeded` |
| 7 | An audit, `throughout` or `somewhere` finding is at fail level, or the snapshot differs from its baseline | failed | `finding` |
| 8 | An audit or `somewhere` finding is for a person to judge, or the snapshot had no baseline and Mobster recorded one | needs\_review | `finding` |
| 9 | A `budget` limit is set on a number the run could not measure | needs\_review | `budget_unmeasured` |
| 9 | No accessibility, snapshot, app-state, audit or system-surface assertion decides the run | needs\_review | `no_assertions` |
| 10 | The check launches the app with arguments or an environment (its own, a locale, network conditions, stubs, wire assertions or an app-state fixture), and the app at the end is a process the run didn't launch, such as one a tap on its Home Screen icon started | needs\_review | `unlaunched_process` |
| 10 | The check launches the app with arguments or an environment, and Mobster can't confirm which process the app ended in: the simulator didn't answer its process list, it listed no process for the app WebDriverAgent had in front, or one of the run's launches named no process | needs\_review | `process_unconfirmed` |
| 10 | The check's `relaunch` names more steps than the run quit and reopened the app, or a check with no `relaunch` has a step that reads as one and the run has none | needs\_review | `step_not_done` |
| 10 | Steps were given, and every assertion already held right after launch | needs\_review | `held_before_flow` |
| 11 | Otherwise | passed | |

A crash also takes the place of rules 3 and 4 when they're `wda`, `launch` or a stopped replay, because WebDriverAgent losing a crashed app is the app's failure. It never replaces `stopped`, `usage`, `budget` or `unknown_outcome`. [Logs, crashes and video](https://docs.mobster.dev/testing.md#logs-crashes-and-video) says how Mobster sees a crash.

`unlaunched_process` compares the app's process at the end with the processes the run's own launches started, read from the simulator. An iPhone or an Android device gives no such read, so the rule doesn't apply there, and `run.log` says so.

`held_before_flow` uses one read taken after launch and the deep link, before any step. Add an expectation that only holds after the flow.

What the model says about its own run is never an input to the verdict.

## The result JSON

`mobster verify --json` prints one object, the same one saved as `result.json` in the run folder and returned by the MCP tools. Its schema is `mobster.verify/1`. The shape:

```json theme={"theme":"css-variables"}
{
  "schema": "mobster.verify/1",
  "run_id": "20261001-101500-3f9a",
  "verdict": "failed",
  "exit_code": 1,
  "summary": "count role=link >= 1 failed: found 0",
  "reason": {"class": "assertion", "message": "1 of 3 expectations failed", "fix": null},
  "mode": "smart",
  "check": {"name": "The Mozilla bookmark opens mozilla.org", "steps": ["Open Bookmarks and tap Mozilla."],
            "expect": [{"text": "mozilla.org"}, {"count": {"role": "link"}, "at_least": 1},
                       {"absent": {"label": "Bookmarks", "role": "navbar"}}], "source": null},
  "app": {"bundle_id": "org.mozilla.ios.Firefox", "name": "Firefox", "version": "…", "path": "/abs/…/Firefox.app"},
  "device": {"name": "Mobster · iPhone 17 Pro · iOS 26.4", "udid": "…", "type": "iPhone 17 Pro", "runtime": "iOS 26.4"},
  "assertions": [
    {"index": 1, "assertion": {"count": {"role": "link"}, "at_least": 1}, "text": "count role=link >= 1",
     "ok": false, "observed": "found 0", "matches": [], "frame": "frames/06-verdict.jpg"}
  ],
  "screenCoverage": {"complete": true, "a11yScreens": 0},
  "baseline": {"taken": true, "held": [false, false, true]},
  "stable": true,
  "steps": [
    {"index": 2, "op": "TAP", "text": "Tapped “Mozilla”",
     "target": {"id": null, "label": "Mozilla", "role": "Cell"},
     "typed": null, "changed": true, "frame": "frames/03-step.jpg", "at_ms": 3120}
  ],
  "agent": {"status": "completed", "note": "…", "model": "claude-sonnet-5-5", "turns": 4},
  "frames": ["frames/01-launch.jpg", "frames/02-step.jpg", "frames/03-step.jpg", "…", "frames/06-verdict.jpg", "frames/07-verdict-ax.jpg"],
  "proof": ["/abs/…/frames/07-verdict-ax.jpg", "/abs/…/frames/06-verdict.jpg", "/abs/…/frames/05-step.jpg"],
  "alert": null,
  "report": "/abs/…/report.html",
  "draft_check": "/abs/…/check.yaml",
  "run_dir": "/abs/…/.mobster/runs/20261001-101500-3f9a",
  "repro": "mobster verify --check /abs/…/check.yaml",
  "seconds": 12.4,
  "timing": {"simulator": 0.4, "install": 2.1, "launch": 1.3, "flow": 6.8, "assert": 1.2, "report": 0.3},
  "cost_usd": 0.031,
  "mobster": {"version": "0.4.0"}
}
```

| Field | Meaning |
| - | - |
| `verdict`, `exit_code` | The verdict and its exit code, from the tables above |
| `summary` | One line: the first failing assertion, or what happened |
| `reason` | `class` from the precedence table, a `message`, and a `fix` sentence when there is one |
| `mode` | `launch` (no steps), `keyless` (a coding agent drove) or `smart` |
| `assertions[]` | Per assertion: `ok`, `text` (a one-line rendering), `observed` (what was on screen, with up to 5 near misses when the text wasn't found), up to 10 `matches`, and the `frame` it was decided on |
| `business` | Registered adapter and fixture IDs, binding digest, app-produced snapshot generation and digest, comparison outcomes, and separate setup/cleanup status. String and numeric observed values are redacted |
| `findings[]` | Findings from the check's audits (each a11y finding also has `audit: "a11y"` and an `element`). An empty list when there are none, or the check never started |
| `screen` | The last read's `title`. In a run that didn't pass, also `shown`: up to 40 elements on that read that have a label, a value or an identifier, each as the selector fields that find it (`role`, `id`, `label`, `value`). A value equal to the label is left out, and a label or value longer than 80 characters is a `/regex/` of its start. The keyboard's keys are left out, and your project's secrets are masked |
| `screenCoverage` | Whether requested per-screen checks had complete observed XML evidence, and how many unique accessibility screens were audited. A check that never started reports `false` and `0` |
| `baseline` | Whether the after-launch read was taken, and which assertions already held on it |
| `stable` | `false` when the screen was still changing at the timeout |
| `steps[]` | Each action: `op`, its `text`, the `target`, `typed` (masked as `••••` in a secure field), whether the screen `changed`, its `frame`, and when (`at_ms`) |
| `agent` | With steps a model drove: its status, its note, the model and its turns. `null` otherwise |
| `frames` | Every frame, relative to `run_dir` |
| `proof` | The frames that show the verdict best, as absolute paths: the overlay first |
| `report`, `draft_check`, `run_dir` | Absolute paths to the HTML report, this run's check as a file, and the run folder |
| `repro` | The command that runs the check again |
| `seconds`, `timing` | The run's length, and each phase's |
| `perf` | What the run measured: `launch` (`interactiveMs`, `foregroundMs`), `memory` (`peakMb`, `p95Mb`, `cpuPeakPct`, `samples`; `null` when not sampled), `hangs` (`count`, `longestMs`, `thresholdMs`; `null` without a log), the Mac's 1-minute `loadAverage` when the run ended, and `notMeasured`, which names each number Mobster could not take and why. [What a check measures](https://docs.mobster.dev/testing.md#what-a-check-measures) |
| `cost_usd` | The model spend. `0` for launch-only and key-less runs |
| `evidence` | On a simulator or a USB iPhone: the app's log (`log.path`, relative to `run_dir`), and for a run that didn't pass, the log `window` around the failure, the `step` it followed and the `crash`. [Logs, crashes and video](https://docs.mobster.dev/testing.md#logs-crashes-and-video) has every field |
| `step_proof` | Why a run that didn't pass went red and what each step did: the `cause` (`side`, `kind`, one `line`), the `judged` frame (`frame`, `overlay`, the `treeHash` of the screen read, `verdictAtMs`), and per step the span (`fromMs`, `toMs`), the app's `log` lines in that span and the `network` requests the log shows. [Proof for every step](https://docs.mobster.dev/testing.md#proof-for-every-step) has every field |

## The run folder

```text theme={"theme":"css-variables"}
.mobster/runs/<run_id>/
  result.json      the object above
  report.html      one file with no external requests: verdict, assertions, overlay, steps, run facts
  check.yaml       this run's check, which `repro` runs
  events.jsonl     the run's actions, one per line (no prompts, no images)
  actions.jsonl    each device action's journaled intent and outcome, by category only (no text)
  run.log          progress lines, and a traceback for `internal`
  logs/app.log     the app's log, on the run clock, secret-filtered, at most 1 MB
  crashes/*.ips    the app's crash report, when it crashed, secret-filtered
  app-icon.png     your app's own icon, when its bundle has one to read
  frames/NN-<label>.jpg
```

The report shows your app's own icon, the largest one its `Info.plist` lists, beside its name.

Frames are JPEGs at half the simulator's width. Every run has `01-launch`, one frame per step, the verdict frame, and the same frame with the **accessibility overlay**: each shown element outlined in violet, and each asserted element in green when its assertion held or red when it failed, numbered in the check's order. A run folder stays under 20 MB and keeps at most 60 step frames.

`mobster verify --save NAME` also copies `check.yaml` to `.mobster/checks/NAME.yaml`, replacing a file of that name. `NAME` is lowercase letters, digits and dashes, up to 60 characters. When the run passes, Mobster keeps the steps Smart took in `.mobster/cache/replay/`, as `mobster test --fresh` does, so the saved check's first `mobster test` on the same simulator model and iOS version replays them. A step that types text Smart made up, rather than text the check spells out, needs Smart on each run. A run of a check file (`--check`) records nothing.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.