Simulators and devices
How to build, run, drive, test and verify Seed Exact on an iOS simulator or phone, and how the team's Mac and the Ion agent's dedicated simulator are set up.

The iOS simulator is where a change to the mobile app is proved. It runs the real UIKit presenters and the real Hermes engine, so it enforces the 100 ms turn budget and native grant checks that the web host cannot. Simulator work needs no signing credentials.

Build and run

bun exact.mjs ios --sim 'iPhone 18 Pro' --run

ios builds for a simulator and installs the app. --run also launches it and returns once launched. The first build takes minutes, later ones a minute or two. --prebuild starts the build apart from the shell and returns at once, logging to .exact/ios-build.log (help). The target is iOS 17.0 and later on iPhone and iPad (app.json).

An edit to only .contract files, app.ts or what it imports "reaches iOS in seconds as a baked plan". A change to app.json, assets, grants or fonts rebuilds the native app (ios-driving).

Choosing a simulator

Mechanism

Effect

--sim <udid|name>

Names the simulator for one command

EXACT_SIM

The same, from the environment. The app's README says to set it "to a simulator UUID for repeatable test runs" (README)

neither

A booted iPhone, else the newest Pro. With several booted, Exact "takes the one the app is installed on, else refuses to guess"

Keep the same setting for ios, test ios, agent ios and verify ios.

Contract tests on iOS

bun exact.mjs test ios # every *.test.contract bun exact.mjs test ios read.test.contract # one file

Each test launches the app fresh with its own empty store, after its first data has landed. Exact starts the app's test server for the run. The step language is in Contract UI tests.

Driving by hand: agent ios

bun exact.mjs agent ios <op> … launches the app, runs each quoted operation on the agent's clock, and closes. A target is a testId, else a view's exact text or label.

Operation

What it does

tree [<target>|--ax]

The node tree, or the accessibility tree

state [<name>]

A state, resource or field, dotted: docs.0.title

tap <target>

A press. Also contextmenu, drag <dx> <dy>, down then tap up

type <target> <text> or key <Name>

Text into a field, or a key. type app /d/… on the navigate= root opens a route

clock data · clock settle · clock +<ms>

Land replies · finish transitions · advance timers

screenshot <png>

A screenshot. window includes the bars, compare <ref> diffs against a reference

check [dark|both]

What is wrong: clipped text, a covered control, a small target, low contrast

logs, layout, perf

console.log output, boxes, timing

prefer <feature> <value>, resize, back, fail fetch <prefix>

Preferences, size, navigation, network faults

Useful flags: --storage <name> to keep a scratch store between drives, --scale 3 for device-resolution screenshots, --touch platform to make every tap a real touch, --timing platform for UIKit's own transition timing (ios-driving). "Drive by testId … never by coordinates."

verify ios

bun exact.mjs verify ios is the final gate for a change that touches the interface. It builds if stale, runs every test with UIKit's bars, checks the first screen and each test's last screen in light and dark, reads them again at the largest text size, relaunches once on real time, and plays about 15 seconds of real touches on a long first-screen list ("like UIKit", or a finding). One screenshot of each screen goes to .exact/verify/, and --shots <dir> copies them out. A clean run ends with verify: clean (help). See Verify and visual checks and Review evidence.

Real-time checks

Tests run on a frozen clock. The race harness bun .tests/real-vault/race.ts drives iOS "with real platform time" against a real vault server, with RACE_ACCOUNTS and RACE_LATENCY_MS to scale the vault and slow the network (README, race.ts). It is the way to catch turn-budget overruns at real sizes, see Real vault compatibility suite.

A phone without TestFlight

bun exact.mjs share builds for iPhone and prints an AppDrop link. The person opens it on their phone and "AppDrop installs the app with their own Apple ID". The link is kept in .exact/appdrop.json, and a later share publishes a new version to the same link (help). ios --device builds for a connected iPhone signed with a development profile. Neither is how the team ships: every tested push to main goes to TestFlight, see Building and uploading to TestFlight.

The team's machines

Builds for TestFlight happen on a Mac called Clipper, and the Ion agent has a dedicated simulator there. See Clipper and the Ion simulator.

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime