Repository navigation
Description
What happened
On iOS, every simulator Simlock leases is a simctl clone of the kind's seed, and every copy keeps writing into that seed after it boots.
A simulator that has booted stores absolute paths to its own device folder and log folder: symbolic links, plists, JSON, SQLite rows. The seed boots once in the sources set (#makeSeed: create, boot, bootstatus, listapps, shutdown), so its stored paths name <simlock home>/devices/ios-sources/<seed udid>/… and ~/Library/Logs/CoreSimulator/<seed udid>. simctl clone copies those bytes, and provision changes only the LaunchServices database (#dropLaunchServicesDatabase) before the copy's first boot. So a booted copy's daemons follow the seed's paths and write into the seed.
Seen on one host, read without changing anything:
- The seed of
iPhone 18 Pro Max/ iOS 27.0 was created at 16:28:18 and shut down at 16:28:52 (itsdevice.plistis from then,state1). Simlock never boots a seed again. - 18 files in the seed are newer than its
device.plist, written at 16:30, 16:39, 17:29, 17:37 and later the same day: three files (about 3.8 MB in all) at each of six times, all underdata/Library/Application Support/PRBPosterExtensionDataStore/…/com.apple.MercuryPoster/…/RuntimeSnapshot*-home.*. That is SpringBoard's home-screen poster snapshot, which a booting simulator writes into its own data folder, one set per lease boot. - The seed has 3 symbolic links whose targets name its own UDID, and 3 text files that contain it.
- A baseline saved from a leased simulator names the seed too: its source's 3 link targets name the seed's UDID, not its own. So copies of that baseline also write into the seed.
The seed grows by one poster snapshot per lease, and every lease of the kind reads and writes some of the same state. Another tool that copied simulators the same way found, before it rewrote the paths, that its source grew by 11 GB of these snapshots and that its copies shared the source's Photos, Shortcuts and CloudKit state.
What you expected
A lease's simulator reads and writes only its own folders, and a seed (or a baseline's source) stays as it was made.
A possible fix: before a copy's first boot, rewrite the copy's stored paths to name its own folders. When the source and the copy live in the same parent folder, replacing the source's UDID with the copy's is enough and keeps every file's length; SQLite write-ahead logs need their frame checksums sealed again afterwards. Here the seed lives in the sources set and the copy in the device set, so the folders differ in more than the UDID. That needs either rewriting the whole folder path (lengths change, which breaks in-place edits of SQLite pages and binary plists), or making the seed in the folder copies live in.
How to reproduce
drivers.ios.deviceSet: "default", start the daemon.simlock lease --platform ios --device "iPhone 17" --detach, wait for the grant, thensimlock release <lease id>. Repeat a few times.- Find the seed:
sqlite3 -readonly <simlock home>/state.db "select udid, created_at from ios_source_data where kind = 'seed'". find <simlock home>/devices/ios-sources/<seed udid> -newer <simlock home>/devices/ios-sources/<seed udid>/device.plist -type flists files written after the seed was shut down, one set ofRuntimeSnapshot*files per lease.find <simlock home>/devices/ios-sources/<seed udid> -type l -exec readlink {} \;shows links that name the seed's own UDID.
It happens on every lease.
Environment
- Simlock 0.7.0 with the iOS: simctl clone and create are cut off at a fixed 30 s, and under deviceSet "default" each cut-off clone leaves a simulator nothing can delete #1546 fix (built from source), worker mode
- iOS simulators, iOS 27.0 runtime, slim mode
- macOS 27.2.1, Xcode 27.2, Apple silicon
drivers.ios.deviceSet: "default"
Logs and evidence
seed created 16:28:18
seed device.plist 16:28:52 (state 1)
files newer than device.plist: 18
16:30:17 RuntimeSnapshot-<hash>-home.atx 3786024 bytes (+ 2 plists)
16:39:53 RuntimeSnapshot-<hash>-home.atx 3786024 bytes (+ 2 plists)
17:29:14 RuntimeSnapshot-<hash>-home.atx 3786024 bytes (+ 2 plists)
17:37:27 RuntimeSnapshot-<hash>-home.atx 3786024 bytes (+ 2 plists)
… two more sets
link targets in the seed naming its own UDID: 3
link targets in a saved baseline's source naming the seed's UDID: 3
Activity
V3RON commentedon Nov 15, 2026
Reproduction
Confirmed. A decision, not a fix: the code follows ADR 0061's Copy step, which is incomplete. Recommend a spec session and an ADR amending ADR 0061.
src/drivers/ios/index.test.ts, "a provision leaves no link or file in the copy that names the seed's folders" (branchbug/1548-repro). The expected values are a proposal: every stored path in the copy names the copy's own folders.Read-only, one booted simulator on this Mac names its own UDID in:
Root cause
Decision.
provision(src/drivers/ios/index.ts:935) runssimctl clonefrom the sources set into the device set. Before the first boot it changes only the LaunchServices database (index.ts:948), as the Copy row of ADR 0061 §2 says.saveSource(index.ts:859) does the same. ADR 0061 §1 keeps seeds in a separate set, so the seed's folder and the copy's folder differ by more than the UDID. A UDID swap cannot fix it. Any fix changes the Copy step.Simplest fix
The ADR's Copy step gains one rule. Before the first boot of every clone, rewrite the source's device folder and log folder to the copy's in:
plutil)The Filesystem port needs
readlinkandsymlink.Alternatives rejected
defaultthe seed would show in Xcode's set (ADR 0061 §1, ADR 0048).Risk
Fast track
Written by an agent.
V3RON commentedon Nov 15, 2026
Being specified in #1561. This issue stays open until that feature ships.
Written by an agent.
docs(adr): 0076 an iOS clone names only its own folders before its fi…
github-actions commentedon Nov 16, 2026
Shipped as #1561.