Skip to content

chore(ios): lease simulators from Simlock instead of the default set - #9

Closed
Dananz wants to merge 1 commit into
ivrix-upstream-sync-2026-09from
chore/simlock-simulators
Closed

Dananz wants to merge 1 commit into
ivrix-upstream-sync-2026-09from
chore/simlock-simulators

Conversation

@Dananz

@Dananz Dananz commented Nov 14, 2026

Copy link
Copy Markdown
Owner

What changed

The iOS simulator scripts now use a simulator leased from Simlock (T3 Code device_open on the "Simlock" host). They no longer create, boot or pick a simulator from Xcode's default device set.

  • New scripts/lib/ios-simlock.sh holds the shared helpers. It checks that a UDID is a booted Simlock simulator (read-only xcrun simctl --set listing), routes simctl through simlock simctl, picks the xcodebuild destination, prints the lease steps, and maps a lease to a UDID.
  • New scripts/simlock-udid.sh <device id> turns the T3 device id (the Simlock lease id) into the simulator UDID, through simlock --gateway status --json and simlock list.
  • ios/scripts/reload.sh: the simulator leg requires --simulator-id <simlock-udid> (or IOS_SIMULATOR_ID) and exits 2 with the lease steps before any build. --device-only still skips the simulator leg. On Xcode 27+ it builds with -DVTSimulatorSetLocation and id=<udid>. On older Xcode it builds generic/platform=iOS Simulator with ARCHS=$(uname -m). Install, terminate and launch go through simlock simctl, and there is no boot.
  • scripts/mobile-dev-launch.sh: requires a Simlock --simulator-id (or IOS_SIMULATOR_ID) after the --help and --check-auth-contract exits and before any Mac or ticket work. Terminate and launch go through simlock simctl, and SIMCTL_CHILD_* still reaches the app because simlock simctl inherits env and stdio.
  • scripts/lib/mobile-attach.sh: the seed (spawn defaults write) and get_app_container calls use simlock simctl for a Simlock UDID.
  • scripts/ios-sim-install.sh and scripts/dev-setup.sh take --simulator-id. scripts/mobile-stability-soak.sh requires Simlock --iphone-sim/--ipad-sim and no longer auto-detects booted simulators. ios/scripts/toast-debug.sh requires a Simlock --udid.
  • mobile-soak.py, irx-soak.py and listauth-gates.py use simlock simctl for a Simlock UDID. The soak's process matching also finds apps under Simlock's device set.
  • scripts/install-iphone-queue-agent.sh also installs lib/ios-simlock.sh, because the launcher now sources it.
  • Docs: ios/AGENTS.md has a new "Simulators come from Simlock" section and updated simulator-leg rules. Root CLAUDE.md points to it, and docs/irx-soak-runbook.md is updated.

GitHub Actions has no Simlock. With GITHUB_ACTIONS=true, the old behaviour stays: --simulator <name>, the per-tag cmux-dev-<slug> simulator, the boot, and plain xcrun simctl. So ios-streamed-validate.yml runs as before.

Verified

  • bash -n passes on every changed shell script, and the Python files parse.
  • node --test scripts/lib/mobile-attach.test.mjs: 47 pass, 2 fail, with and without GITHUB_ACTIONS=true. The 2 failures ("dogfood readiness writes a secret-free identity and latency receipt", "physical-device mint waits for asynchronous Iroh publication") fail the same way on the base commit. The launcher tests now run against a fake Simlock device set, and one new test checks that a launch without a Simlock UDID prints the lease steps and makes no simctl call.
  • tests/test_iphone_install_queue.sh and tests/test_mobile_readiness_receipt.sh pass. tests/test_mobile_stability_soak_attach_contract.py and tests/test_mobile_attach_prefers_iroh.py fail the same way on the base commit.
  • Stub runs with fake xcrun, simlock and xcodebuild and a fake device set:
    • reload.sh, mobile-dev-launch.sh, dev-setup.sh, ios-sim-install.sh, mobile-stability-soak.sh and toast-debug.sh exit 2 with the lease steps when no UDID is given. They refuse a default-set UDID and report a Simlock UDID that is not booted.
    • ios-sim-install.sh and toast-debug.sh call simlock simctl install and simlock simctl spawn for a booted one.
    • The destination helper gives -DVTSimulatorSetLocation on Xcode 27 and generic plus ARCHS on Xcode 26.
    • simlock-udid.sh reports a missing lease against the real gateway.
  • A separate review pass checked the diff. Its confirmed findings are fixed: soak resource-monitor matching, dev-setup.sh support, the older-Xcode arch, a silent exit in simlock-udid.sh, and doc accuracy.

Not run

  • No iOS build, install or launch on a real Simlock simulator. None was booted, and none was leased for this change.
  • The older-Xcode generic build path (the repo pins Xcode 26) has not been built.
  • GitHub Actions workflows were not run.

Known gaps, not converted

  • scripts/run-iroh-release-gate.sh, scripts/run-iroh-direct-transport-gate.sh, ios/scripts/appstore-shots.sh and ios/fastlane still create or erase their own default-set simulators. The release gates now stop at mobile-dev-launch.sh outside GitHub Actions.
  • ios/scripts/appstore-shots-real.sh, ios/scripts/capture-streamed.py, idb, axe and xcodebuildmcp reach only the default device set. The stability soak's UI checks fail where xcodebuildmcp is installed, and the soak needs two leases at once.
  • External callers of scripts/ios-sim-install.sh (cmuxterm-hq reload-cloud-ios.sh) must now pass --simulator-id outside GitHub Actions.

The iOS simulator scripts now take a Simlock UDID (--simulator-id,
IOS_SIMULATOR_ID, --iphone-sim/--ipad-sim, --udid), route every simctl call
for it through `simlock simctl`, and exit with the lease steps when none is
given, instead of creating, booting or picking a default-set simulator.
ios/scripts/reload.sh builds with -DVTSimulatorSetLocation on Xcode 27+, or
for a generic simulator on older Xcode, then installs with simlock simctl.

GitHub Actions has no Simlock, so GITHUB_ACTIONS=true keeps the old named
and per-tag simulators.

scripts/simlock-udid.sh maps a T3 device_open id (the lease id) to its UDID.
@Dananz

Dananz commented Nov 14, 2026

Copy link
Copy Markdown
Owner Author

Closed: Ivrix is out of scope for the Simlock change.

@Dananz Dananz closed this Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant