iOS copy: simctl create and one clone of the source's data
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 18/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- mobile-dev, testing-qa
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- TypeScript
- 星标
- 730
- 派生
- 44
- 平均合并
- 15 小时 28 分钟
- 30 天内合并 PR
- 387
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
callstackincubator/simlock 的其他 Issue
-
bug:new
难度 2/5 1-3 小时 新手友好度 73/100
callstackincubator/simlock#2088 ·
维护者通常 1 天内回复
-
bug:new
难度 2/5 1-3 小时 新手友好度 64/100
callstackincubator/simlock#2080 · 1 条评论 ·
维护者通常 1 天内回复
-
task:ready
难度 4/5 3-5 天 新手友好度 52/100
callstackincubator/simlock#2079 ·
维护者通常 1 天内回复
-
iOS copy: keep the app database at the copy's own UDID可能已有人在做 @V3RON 今天认领。 未关闭platform:ios task:ready
callstackincubator/simlock#2077 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
feature:planned
难度 4/5 3-5 天 新手友好度 52/100
callstackincubator/simlock#2075 · 5 条评论 ·
维护者通常 1 天内回复
查看 callstackincubator/simlock 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
simstudioai/sim#10710 ·
维护者通常 1 天内回复
-
Make the HTTP server's keep-alive and headers timeouts configurable可能已有人在做 @mattgodbolt 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
compiler-explorer/compiler-explorer#9902 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复