Repository navigation
Closed
Labels
Description
What happened
Switching drivers.ios.deviceSet between simlock and default gets stuck, and following the error's own advice makes it worse.
- After leasing on
deviceSet: defaultand switching back tosimlock, iOS is refused (doctor reasondevice-set-changed): "Refusing the ios device set: Simlock's sources set at ~/.simlock/devices/ios-sources still holds 1 simulator(s) (D2A158F3-…). Set drivers.ios.deviceSet back to default, runsimlock nuke --delete-devicesandsimlock doctor --purge-orphans, then switch again…". Onsimlock,nuke --delete-devices,doctor --purge-orphans --yes,doctor --fixandcleanupdo nothing for it, because the iOS driver does not start. - Deleting that seed by hand with
xcrun simctl --set … delete(which the refusal also suggests) breaks iOS leases:PROVISION_FAILED,simctl clone D2A158F3… Invalid device.nukelogs "nuke could not delete a seed … Invalid device", and doctor keeps listing the seed. Only deleting itsios_source_datarow fromstate.dbby hand fixed it.
What you expected
The refusal says the steps that work: set default again, run nuke and purge there, then switch. A seed already gone from simctl counts as deleted, so nuke drops its record and iOS works again.
How to reproduce
simlock config set ios.simulator.headless false,simlock config set drivers.ios.deviceSet default, restart, lease and release an iOS device.simlock config set drivers.ios.deviceSet simlock(andheadless true), restart: iOS refused as above.- Delete the named seed with
xcrun simctl --set ~/.simlock/devices/ios-sources delete <udid>, restart, lease iOS:PROVISION_FAILED.
Environment
Simlock 0.5.0 package at main 14a3f826b, macOS 27.0.1 arm64, Xcode 27.1, Android emulator 37.2.13. Found in the 0.6 release E2E run on 2026-11-05. iOS only.
Logs and evidence
From a read of the code:
- Under
simlock,IosSimctlDriver.create(src/drivers/ios/index.ts:391) callsrefuseDefaultSourcesLeftovers(src/drivers/ios/device-set-leftovers.ts:35-49) and throws, so no iOS driver exists. Nuke (src/core/nuke-service.ts:134-160) and doctor only reach drivers that started. destroySource(src/drivers/ios/index.ts:856-871) runssimctl deletethrough#deleteSeedSimulator(index.ts:1117-1120). For a missing UDID it throws "Invalid device", which skipsdeleteRow(index.ts:870). The row staysreadyandreadyRows(src/drivers/ios/source-data.ts:112) picks it as the seed to clone.- The refusal messages (
device-set-leftovers.ts:30,46) tell users to delete seeds withsimctl deleteby hand. - The same refusal for the
simlock→defaultdirection (seeds indevices/ios/sources) works as documented withnuke --delete-devices, but a seed there does not show insimlock simctl list devices.
Written by an agent.
Activity
V3RON commentedon Nov 5, 2026
Written by an agent.
V3RON commentedon Nov 5, 2026
Reproduction
Defect, confirmed: a seed row whose simulator simctl no longer knows is never deleted, so nuke keeps it and provision keeps cloning it. The refusal's main steps (set
default, nuke, purge, switch) work; only its hand-delete step leads here.src/drivers/ios/index.test.ts, new casedestroySource drops the row of a seed simctl no longer knows (Invalid device)onbug/1296-repro. Exit code and stderr are real simctl output for an unknown UDID, recorded against an empty scratch set.Root cause
src/drivers/ios/index.ts:1119:#deleteSeedSimulatortreats every non-zerosimctl deleteas a failure, sodestroySource(index.ts:869-870) throws beforedeleteRow. The row staysready.findReadySeed(source-data.ts:109) then returns it on every provision, andsimctl clonefails withInvalid device(thePROVISION_FAILEDin the issue).findReadySeedignoresset_pathtoo, so a row left from the otherdeviceSetis cloned with the wrong--set.Simplest fix
In
#deleteSeedSimulator, treat exit 148 with stderrInvalid device:as already deleted, so the row is dropped. Thennuke --delete-devicesclears the row under either set. A sketch passes the whole file.Alternatives rejected
simctlwhen<sources set>/<udid>is missing: breaks the existing "busy" case, which plants no folder, and adds a second notion of "gone".findReadySeedbyset_path: the leftover row then stays forever.Risk
provision(anInvalid devicefrom clone drops the row and makes a new seed) is a separate decision.device-set-leftovers.ts:27,45,67) should say to run nuke after a hand delete.#destroySeed(stale seed) andsaveSourcecleanup share the changed path; check both.Written by an agent.
fix(ios): match an unknown seed by its Invalid device message alone (#…
fix(ios): drop the false nuke-again sentence from the own-set and Xco…
V3RON commentedon Nov 5, 2026
Delivery run
Merged: #1303 (#1296)
Parked: none
Waiting: none
Decided: none
Written by an agent.
fix(ios): a seed simctl no longer knows counts as deleted (callstacki…