Repository navigation
Description
Part of #1745.
Scope
An iOS simulator booted for a labelled lease takes the label as its name before it boots, so DeviceHub, Simulator.app and simctl list show feature-x. Every other prepare boot of a simulator names it back to its own stored name, so a label never stays on a simulator its lease did not get. A recovery boot renames nothing, and a rename that fails or hangs costs the lease nothing.
If this goes wrong, a user would see a leased simulator still named simlock-<id> (logged as a warning), a simulator keeping an older lease's label, or, worst, a lease boot that waits on a hung simctl rename.
Technical spec
Commit fb42676.
Rows
- Behaviours: B8, B9
- Stored state: S4
- Interfaces: I7, I8
- Existing code: X11, X12, X13, X14, X15, X16
Facts
| # | Fact | Source |
|---|---|---|
| F1 | Simctl.run bounds simctl by its timeout and throws DriverCrashError on a non-zero exit or a timeout |
src/drivers/ios/simctl.ts:115-131 |
| F2 | The fake driver records every makeReady call with its options, for B8 |
src/core/fake-driver.ts:518-526 |
| F3 | The iOS driver's makeReady tests run it with a scripted process runner and assert the command order |
src/drivers/ios/index-simulator-audio.test.ts:130-150 |
| F4 | On Xcode 27.2, DeviceHub retitles its window when a shut-down simulator is renamed, keeps the name through simctl boot, and retitles again on a rename of the booted simulator |
run on this Mac 2026-11-19, recorded in #1745 Decisions |
| F5 | e2e/slow-ios-window.test.ts leases on drivers.ios.deviceSet: "default" with ios.simulator.headless: false and checks DeviceHub, the model for the slow case |
e2e/slow-ios-window.test.ts:200-213 |
Modules touched
Searches: makeReady(, bootForLease, readyProvisionedForLease, rebootForLease, exceptOption, ProvisionDeviceOptions in src.
src/core/(driver.ts,managed-device-lifecycle.ts,device-provisioner.ts,fake-driver.ts, tests)src/leasing/(acquisition-workflow.ts, tests)src/drivers/ios/(index.ts, tests,AGENTS.mdboot steps)e2e/slow-ios-window.test.ts(a labelled case)website/src/content/docs/docs/reference/cli.mdx
Rules in play
src/leasing/AGENTS.md"The lock": the rename is driver I/O insidemakeReady, outside the decision lock, under the boot claim the lease already holds.src/drivers/AGENTS.md"Scope every command to the root":simctl renamegoes through the driver'sSimctl, scoped to the device set like every other call.src/drivers/AGENTS.md"Ownership is membership in the root, never a name prefix": a renamed simulator stays owned; the storednamein driverData is never changed.- Safety rule 2: a recovery boot changes nothing on the device, so it renames nothing.
- Documentation rule 9: the CLI reference says the simulator takes the label at boot.
Tests
The seam is createLeasing with the fake driver (model: src/leasing/lease-acquisition-coordinator.test.ts), ManagedDeviceLifecycle (model: src/core/managed-device-lifecycle.test.ts), and IosSimctlDriver.makeReady with a scripted runner (model: src/drivers/ios/index-simulator-audio.test.ts).
- B8: leasing passes the request's label to
makeReady: provision; boot of a shut-down device; reboot of a ready device (Xcode's set, and anexceptlease); warm-pool boot passes none;recoverLeasedpasses none with purposerecover; an unlabelled lease passes none - B9: the iOS driver runs
simctl rename <udid> <name>beforesimctl booton a prepare boot: label given → the label; no label → the stored name; purposerecover→ no rename; rename exits non-zero → warning logged, boot goes on; rename hangs past 5 s → killed, warning logged, boot goes on; slow lane, ine2e/slow-ios-window.test.tsbeside its DeviceHub case: a lease withlabelon Xcode's set withios.simulator.headless: false→simctl listnames the simulator<label>(no window-title read: the lane has no Accessibility permission; F4 holds the title)
Done when
pnpm test:changedpasses, with the B8 and B9 cases above.pnpm typecheckandpnpm lintpass.- Slow lane:
scripts/slow-e2e.sh e2e/slow-ios-window.test.ts -t "label"passes (B9's real-simulator case). src/drivers/ios/AGENTS.mdlists the rename as the first step of a prepare boot.website/src/content/docs/docs/reference/cli.mdxsays an iOS simulator booted for the lease takes the label as its name, seen in DeviceHub or Simulator.app withdrivers.ios.deviceSet: "default"andios.simulator.headless: false.
Out of scope
The console (#1757), renaming a warm simulator granted without a boot, Android and physical devices, and the feature's Non-goals.
Depends on
Written by an agent.
Activity
test: a prepare boot renames the simulator before it boots (#1756)
feat(ios): a prepare boot names the simulator after the lease's label…
docs: the iOS driver manual and CLI reference say a labelled lease na…
refactor(tests): the label and audio tests stay under Fallow's comple…
docs: the iOS manual states the rename inside the boot line (#1756)
docs: shorten the iOS manual's rename clause (#1756)
fix(drivers): a failed simulator rename warns with the I8 wording (#1756
V3RON commentedon Nov 19, 2026
Handoff
Done: PR #1776 built (B8, B9), audited, reviewed in two rounds (3 findings fixed at 496e3fe, none open). The PR is ready, labelled
needs-hardware, and sits at the top of stack #1768 → #1775 → #1776. Both lower PRs passed review and are ready.Not done: the slow-lane line
scripts/slow-e2e.sh e2e/slow-ios-window.test.ts -t "label"and feature #1745's first Completion condition (the real simulator titled with the label). After that, the ADR-free stack goes throughmerge-pr.sh 1776.Findings: none open. Two notes are on the PR.
Blocked on: DeviceHub was running on the lane machine (pid 52365). The test starts and quits DeviceHub itself, and quitting it shuts down every simulator, so the run did not stop it. Quit DeviceHub, then re-run
deliver #1745(orverify #1776).Written by an agent.
test(e2e): the queued-leases boot check keeps its slow boots long eno…
feat(leasing): an agent names its lease with a label (#1768)
feat(ios): a simulator booted for a labelled lease takes the label as…