iOS copy: simctl create and one clone of the source's data
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 18/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- mobile-dev, testing-qa
Research direction
Start with the iOS driver seam in src/drivers/ios/test-index.ts and the filesystem port in src/ports/filesystem.ts; read the referenced port and iOS driver manuals and ADRs first. Implement and verify behaviors B7–B10 across the listed adapters, fakes, driver tests, and slow lane tests. Done means all specified unit cases pass, both real simulator scenarios show the fast-copy log without fallback, and the baseline slow lane passes.
Written by the indexing model from the issue text.
Description
Part of #2070.
Scope
After this PR the copy of an iOS lease is made by simctl create and one clone of the source's data folder, not by simctl clone, so the copy step takes a few seconds less. Where the clone cannot be made, the copy is made as before and the daemon log says so once.
If this goes wrong, an iOS lease fails at the copy, or a simulator with no lease is left in the device set.
Technical spec
Commit 4d3c176fb.
Rows
- Behaviours: B7, B8, B9, B10
- Stored state: S4, S5
- Interfaces: I2, I3, I4
- Existing code: X1, X6, X9, X10, X11, X14, X16, X19, X15
Facts
| # | Fact | Source |
|---|---|---|
| F1 | The in-memory filesystem's copyTree rejects when the target exists. |
src/ports/filesystem.ts:580 |
| F2 | NodeFilesystem runs cp for copyTree through its process runner and kills it at the limit; I2's adapter is modelled on it. |
src/ports/filesystem.ts:226 to :256 |
| F3 | The ports manual asks for a bound on every wait an adapter makes and for a fake beside every adapter. | src/ports/AGENTS.md:15 |
| F4 | A lease's grant holds the simulator's UDID in device.driverDeviceId and the device set in environment.SIMLOCK_IOS_DEVICE_SET. On a worker in Xcode's own set the grant's environment is empty, and the set's folder is ~/Library/Developer/CoreSimulator/Devices. |
e2e/slow-baseline.test.ts:48 to :53; src/drivers/ios/index.ts:607 |
| F5 | A slow-lane test reads a debug line of the driver from the daemon log file (env.logPath). |
e2e/slow-ios-source-isolation.test.ts:120 to :130 |
| F6 | The iOS driver's manual is 7,991 characters and a repository test caps a manual at 8,000, so a line added to it needs another one shortened. | wc -c src/drivers/ios/AGENTS.md printed 7991; src/docs-manuals.repo.test.ts:10 |
| F7 | #2045 and PR #2063 each add a verb to the Filesystem port and to the same two fakes (X16). Whichever lands after another adds its lines beside the other's. |
#2045 Modules touched; gh pr view 2063 --json files lists src/ports/filesystem.ts and src/auth/admin-secret.test.ts |
Modules touched
ports: filesystem.ts (the interface, NodeFilesystem, MemoryFilesystem), filesystem.test.ts, AGENTS.md. drivers/ios: seeds.ts, source-data.ts (ReadySeed), index.ts or simctl.ts (only Simctl holds ios.simulator.createTimeoutMs today, src/drivers/ios/simctl.ts:23, and Seeds needs it for I2), testing.ts, test-index.ts (plantSeedClone), the thirteen test files of X19, AGENTS.md. auth: admin-secret.test.ts (X16). e2e: e2e/slow-ios-app-database.test.ts, the file #2077 adds. Searches: rg -n "copyTree" src, rg -n "Filesystem = \{" src, rg -n '"clone"' src/drivers/ios, rg -n "ReadySeed" src/drivers/ios.
Rules in play
- ADR 0104 §3 (Accepted — not yet implemented): the parent's rows hold the shapes.
- ADR 0061 §2, as narrowed by ADR 0104: the copy still gets both marks, the overrides and the swap in today's order;
copyTreestays as it is for Android. - ADR 0076 §3: a copy whose step fails is deleted.
src/ports/AGENTS.md: a new call to a program is a port verb with a Node adapter and a fake, and its wait is bounded bytimeoutMs.- Safety rules 1 and 8: the driver deletes only the simulator whose UDID its own
simctl createprinted. - Documentation rule 7: the manuals of ports and of the iOS driver say what the code cannot: the perl call and the fallback.
Tests
Seam: the iOS driver built by createDriver (src/drivers/ios/test-index.ts:217), modelled on src/drivers/ios/index-seed-provision.test.ts; I2's adapter in src/ports/filesystem.test.ts with a scripted process runner.
- B7: Core provisions a copy. The driver runs I4 with the source's device type and runtime, removes the new simulator's
datafolder, clones the source'sdatain its place with I2, then goes on as today: marks, overrides, B1 or B2, swap. Nosimctl cloneruns. The debug log sayscopied <udid> in <ms> ms by fast copy.: a seed; a baseline (the baseline row's device type and runtime, not the request's); a settle's copy; the source's seed turn is held from I4 to the end of I2 - B8: The new simulator's
datafolder is not there yet when I4 returns and appears a moment later, so I2 is refused. Seen on 2026-12-02: 2 of 5 clones failed with[Errno 17] clonefile failedthough the folder was absent whensimctl createreturned. After I2 rejects, the driver looks atdata: when it exists, it is removed and I2 runs again, three I2 calls at most; when it does not exist, the failure is B9 at once.:datathere when I4 returns: removed, one I2;dataabsent when I4 returns and there at the first I2: one retry; I2 rejects anddatais absent: B9, no retry; refused three times withdatathere each time: B9 - B9: The fast copy fails. The created simulator is deleted with
simctl delete, the copy is made withsimctl cloneas today, and the provision succeeds. The log gets one warn line:fast copy failed (<reason>); copying with simctl clone until the daemon restarts, where<reason>is I2's error message. Later provisions of this driver runsimctl cloneand no I4. The debug log sayscopied <udid> in <ms> ms by simctl clone.: I2 rejects once it was refused three times; I2 rejects with a time limit; I2 rejects because perl cannot start; the delete of the created simulator fails too: logged with its UDID, the provision still succeeds; a second provision after a failure:clone, nocreate - B10: I4 itself fails or passes its limit. The provision throws as a failed
simctl clonedoes today, and a UDID printed late is deleted.: I4 exits non-zero; I4 prints no UDID; I4 passesios.simulator.createTimeoutMs
Done when
- Every unit case of B7 to B10 passes.
src/ports/filesystem.test.tsproves I2's adapter: the command and arguments of I3 word for word, each error message of I2, and the rejection off macOS.- Slow lane (real simulator):
e2e/slow-ios-app-database.test.tsleases an iPhone and finds in the daemon log, at debug level,copied <udid> in <ms> ms by fast copyfor the lease's UDID and no B9 line;simctl listappsand an app install work on that lease. - Slow lane (real simulator):
e2e/slow-ios-app-database.test.tsfinds the samefast copyline for a lease on a worker set up withdrivers: { ios: { deviceSet: "default" } }. - Slow lane (real simulator):
e2e/slow-baseline.test.tspasses with the copy made this way. - The PR description holds the copy times the slow-lane run printed.
Out of scope
Making a seed, a settle and a baseline save still use simctl clone. Setting the group and folder times of a cloned folder back. A compiled helper for the clone.
Depends on
- #2077 because:
#cloneCopyinsrc/drivers/ios/seeds.ts
Written by an agent.
- Dominant language
- TypeScript
- Stars
- 730
- Forks
- 44
- Avg merge
- 15h 28m
- Merged PRs (30d)
- 387
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from callstackincubator/simlock
-
bug:new
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
callstackincubator/simlock#2088 ·
Maintainers usually reply within 1 day
-
bug:new
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
callstackincubator/simlock#2080 · 1 comment ·
Maintainers usually reply within 1 day
-
task:ready
Difficulty 4/5 3-5 days Newbie friendliness 52/100
callstackincubator/simlock#2079 ·
Maintainers usually reply within 1 day
-
iOS copy: keep the app database at the copy's own UDIDPossibly taken @V3RON claimed this today. Openplatform:ios task:ready
callstackincubator/simlock#2077 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
feature:planned
Difficulty 4/5 3-5 days Newbie friendliness 52/100
callstackincubator/simlock#2075 · 5 comments ·
Maintainers usually reply within 1 day
All issues in callstackincubator/simlock
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
melgarafael/DeskcommCRM#5614 · 1 comment ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 76/100
slackapi/slack-health-score#253 ·
Maintainers usually reply within 1 day
-
feature needs triage site
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
owid/owid-grapher#8019 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
simstudioai/sim#10710 ·
Maintainers usually reply within 1 day
-
via-triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day