Skip to content

iOS: show a leased simulator in a window when headless is off #1237

Closed
1 of 1 issue completed
Closed

Description

@V3RON

Request: none

Problem

People who run agents against Simlock want to watch the iOS simulator their agent is using, in DeviceHub (Xcode 27) or Simulator.app (Xcode 26). Today Simlock never opens a window for a simulator, and there is no setting for it. Android has one: android.emulator.headless, default false, so emulators show a window unless the operator turns it off.

Who it is for

An operator who runs Simlock on their own Mac (a desk machine, a laptop) and wants to see what each agent does on its simulator, without opening the Simlock console.

Outcome

  • A worker setting, ios.simulator.headless, default true (as today). false makes Simlock show each simulator it boots: in DeviceHub's main window on a Mac with DeviceHub, else in its own Simulator.app window. Simlock never takes the keyboard focus from the app the operator is using.
  • false works only with drivers.ios.deviceSet: default, because DeviceHub and Simulator.app only see Xcode's own device set. With Simlock's own set, iOS does not start and simlock doctor says why, as for any other device set conflict today.
  • When Simlock starts DeviceHub or Simulator.app itself, closing a window or quitting the app leaves the simulators running.
  • A window that cannot be opened never stops a lease: the simulator is handed on, and the daemon log says why there is no window.

How it works for the user

flowchart LR
  C[operator: deviceSet default + ios.simulator.headless false, restart] --> B[simulator boots]
  B --> D{DeviceHub installed?}
  D -- yes --> M[DeviceHub main window shows it; others a click away in its list]
  D -- no --> S[Simulator.app opens a window for it]
  M & S --> L[agent uses it; operator watches]
  B -. window fails .-> W[warning in daemon log; simulator handed on]
  C -. deviceSet simlock .-> R[iOS turned off; doctor says why]
Loading

Before:

$ simlock config set ios.simulator.headless false
Unknown config key: "ios.simulator.headless"

After:

$ simlock config set drivers.ios.deviceSet default
$ simlock config set ios.simulator.headless false
Updated ios.simulator.headless in ~/.simlock/config.json; takes effect on daemon restart.

With drivers.ios.deviceSet left at simlock, the daemon starts without iOS, and simlock doctor shows the refusal: Refusing the ios device set: ios.simulator.headless is false, which needs drivers.ios.deviceSet "default".

Examples

ios.simulator.headless drivers.ios.deviceSet Today After
unset any no window no window
true any unknown key warning; no window no window
false default unknown key warning; no window a window per simulator
false simlock or unset unknown key warning; no window iOS turned off, doctor says why
"no" any unknown key warning invalid config naming ios.simulator.headless

What could go wrong

  • A new Xcode changes DeviceHub's undocumented link and no window opens. The daemon log warns; the slow lane catches it.
  • The operator closes DeviceHub's main window; DeviceHub then keeps showing the old simulator until it restarts (a DeviceHub bug). The docs say so.
  • The operator started DeviceHub or Simulator.app before Simlock did; quitting DeviceHub or closing a Simulator.app window then shuts the simulators down, and the health check reboots them within about a minute. The agent loses what was running.

Words used

  • headless: a simulator runs with no window on the Mac. Today every iOS simulator is headless.
  • DeviceHub: Xcode 27's app for simulators and devices, which replaces Simulator.app.
  • main window: DeviceHub's one window with the device list on the left and the selected device's screen on the right.
  • Xcode's device set: the folder Xcode keeps its simulators in, ~/Library/Developer/CoreSimulator/Devices; Simlock uses it under drivers.ios.deviceSet: default.

Non-goals

  • Windows for simulators in Simlock's own device set (DeviceHub and Simulator.app cannot see it).
  • Stopping a Simulator.app the operator already runs from opening windows by itself while headless is on.
  • Any Android change.
  • Arranging or sizing windows, or one DeviceHub window per simulator.
  • Changing any user-wide macOS or Xcode setting.

Completion conditions

  • On a Mac with Xcode 27, drivers.ios.deviceSet: default and ios.simulator.headless: false, a leased simulator shows in DeviceHub's main window and the front app does not change (slow lane).
  • ios.simulator.headless: false with Simlock's own set turns iOS off with the refusal message; Android still starts.
  • A failed window is a warning in the daemon log, and the lease is granted.
  • The configuration reference and the worker configuration page describe the setting, its device set rule, and what closing and quitting do.

Open questions

none

Decisions

Shared values

none

Behaviours

Behaviour (invoker, action, what it sees) Seam Cases Task
An operator sets ios.simulator.headless and the daemon loads it and answers it in config.get loadConfig, config.get unset → true; true; false; "no" → invalid config naming the key #1239
A daemon starts with ios.simulator.headless: false and a device set, and iOS starts or is refused IosSimctlDriver.create false + default → starts; false + simlock → refused, invalid-device-set and the message; false + unset → refused; true + simlock → starts #1239
Simlock makes a simulator ready with ios.simulator.headless: false and shows it in a window without taking focus iOS driver makeReady DeviceHub installed → open -g -b com.apple.dt.Devices --args -shutdownStartedDevicesOnQuit NO, then open -g devices://manage/select?id=<udid>; DeviceHub not installed → open -g -b com.apple.iphonesimulator --args -CurrentDeviceUDID <udid> -DetachOnWindowClose YES -DetachOnAppQuit YES; prepare; recover; slim; true → no open call #1239
Opening the window fails and the simulator is still made ready, with the failure reported iOS driver makeReady select exits non-zero; Simulator.app exits non-zero; a call times out; a call cannot start #1239
The daemon logs a window failure main.ts window-failure bridge one failure → one warn line Could not open a window for iOS simulator with deviceId and detail #1239
A leased simulator on Xcode 27 with ios.simulator.headless: false shows in DeviceHub's main window slow lane first lease with DeviceHub not running; front app unchanged; a screen stream gives frames with the window up #1239

Tasks

Completion conditions: all four are delivered by #1239's Done when.

Open work in the same area:

Written by an agent.

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. added
    feature:spec
    on Nov 3, 2026
  2. added
    feature:planned
    and removed
    feature:spec
    on Nov 3, 2026
  3. V3RON commented on Nov 3, 2026

    @V3RON
    ContributorAuthor

    Spec updated: Problem, Outcome, How it works, Examples, Non-goals, Completion conditions, Behaviours and Tasks written; task #1239 specified, checked and set ready.

    Written by an agent.

  4. V3RON commented on Nov 5, 2026

    @V3RON
    ContributorAuthor

    Delivery run

    Merged: none
    Parked: #1239 — needs-hardware: slow lane unavailable (11.7 GiB free disk, needs 15); PR #1290 ready, review passed
    Waiting: none
    Decided: none

    Written by an agent.

  5. V3RON commented on Nov 5, 2026

    @V3RON
    ContributorAuthor

    Delivery run

    Merged: none
    Parked: #1239 — gate refused twice; CI red on src/docs-manuals.test.ts (a module manual over 150 lines after the CI fix); PR #1290 reviewed, slow lane passes

    Written by an agent.

  6. github-actions commented on Nov 5, 2026

    @github-actions
    Contributor

    Closing: all 1 sub-issues are closed. The PR that closed the last one walks the completion conditions (delivery rule 9); reopen this if one does not hold on main. Flip its ADRs to Accepted if delivery has not.

  7. V3RON commented on Nov 5, 2026

    @V3RON
    ContributorAuthor

    Delivery run

    Merged: #1290 (#1239)
    Parked: none
    Waiting: none
    Decided: none

    Written by an agent.

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

    feature:planned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions