Skip to content

iOS: a simulator booted for a labelled lease takes the label as its name #1756

Closed

Description

@V3RON

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.md boot 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 inside makeReady, outside the decision lock, under the boot claim the lease already holds.
  • src/drivers/AGENTS.md "Scope every command to the root": simctl rename goes through the driver's Simctl, 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 stored name in 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 an except lease); warm-pool boot passes none; recoverLeased passes none with purpose recover; an unlabelled lease passes none
  • B9: the iOS driver runs simctl rename <udid> <name> before simctl boot on a prepare boot: label given → the label; no label → the stored name; purpose recover → no rename; rename exits non-zero → warning logged, boot goes on; rename hangs past 5 s → killed, warning logged, boot goes on; slow lane, in e2e/slow-ios-window.test.ts beside its DeviceHub case: a lease with label on Xcode's set with ios.simulator.headless: false → simctl list names the simulator <label> (no window-title read: the lane has no Accessibility permission; F4 holds the title)

Done when

  • pnpm test:changed passes, with the B8 and B9 cases above.
  • pnpm typecheck and pnpm lint pass.
  • Slow lane: scripts/slow-e2e.sh e2e/slow-ios-window.test.ts -t "label" passes (B9's real-simulator case).
  • src/drivers/ios/AGENTS.md lists the rename as the first step of a prepare boot.
  • website/src/content/docs/docs/reference/cli.mdx says an iOS simulator booted for the lease takes the label as its name, seen in DeviceHub or Simulator.app with drivers.ios.deviceSet: "default" and ios.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

  1. added
    task:draft
    platform:ios
    on Nov 19, 2026
  2. added
    task:ready
    and removed
    task:draft
    on Nov 19, 2026
  3. self-assigned this
    on Nov 19, 2026
  4. V3RON commented on Nov 19, 2026

    @V3RON
    ContributorAuthor

    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 through merge-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 (or verify #1776).

    Written by an agent.

  5. added
    task:blocked
    and removed
    task:ready
    on Nov 19, 2026
  6. removed their assignment
    on Nov 19, 2026
  7. added
    task:ready
    and removed
    task:blocked
    on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform:iostask:ready

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions