Let a script hold a device claim while it runs simctl install or simctl launch itself
維護者通常 1 天內回覆
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 38/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- ios, typescript
- 領域
- cli, mobile-dev
研究方向
Start by reading the CLI implementations of install, boot and shutdown to understand how they take and release transient-exclusive claims, then compare that with the open/close session lifecycle. Decide which of the three proposed approaches best fits the stated requirement; done means a script can hold a claim while its simulator mutation runs, and the claim is released when that work ends without the unwanted session side effects.
由索引模型根據 Issue 內容生成。
描述
Seen in 0.21.15, macOS, iOS simulators.
Problem
Our dev scripts install and relaunch a dev client on an iOS simulator with xcrun simctl install and xcrun simctl launch --terminate-running-process. Before each call, they read the claim file in ~/.agent-device/device-claims/ and refuse when another session holds the device.
Between that check and the simctl call, an agent-device client (an e2e run, or an IDE device panel) can take the claim. The install or relaunch then interrupts that session. The window is short, but a check that only our scripts honor cannot close it. The claim must come from agent-device.
What exists in 0.21.15, and why it does not fit
device status|releaseonly inspects or releases claims. No command takes one.install,bootandshutdowntake atransient-exclusiveclaim, but only for their own work. agent-device cannot run oursimctlcommand under that claim.open --session S --platform ios --udid Uwith no app holds a session claim untilclose --session S. As a reservation, it has these side effects:- it starts a daemon in the state dir;
keepHotcan startxcodebuild build-for-testingfor the runner in the background;- on a simulator that is not booted, it boots it and runs
open -a Simulator; - if the script crashes before
close, the claim stays held while the daemon lives.
takeoverneeds a remote lease, so it does not apply to a local simulator.
Proposal (any one is enough)
agent-device exec --platform ios --udid U -- <command...>: take atransient-exclusiveclaim, run the child, and release the claim when the child exits. The claim owner is the exec process, so a crash of the child or of agent-device frees the claim.agent-device device claim --udid Uanddevice release --udid U --session S: take a claim whose owner is the calling process (or one with a TTL or heartbeat). No daemon, no boot, no runner prewarm, no session record.open --claim-only: the currentopenwith no app, but without the boot,open -a Simulatorand runner prewarm.
Option 1 fits our use best. The claim lasts exactly as long as the mutation, and nothing leaks.
Current workaround
We read the claim file right before each simctl call. That narrows the window but does not close it.
Related: #2161 (workspace-scoped device pinning).
- 主要語言
- TypeScript
- 星號
- 5.3k
- 分支
- 377
- 平均合併
- 14 小時 24 分鐘
- 30 天內合併 PR
- 675
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
callstack/agent-device 的其他 Issue
-
iOS alert wait: the last poll can get ~30 ms and turns "no alert" into a failed read可能已有人在做 @pcbeingused333 於 7 天前認領。 未關閉bug ready-for-agent
難度 2/5 1-3 小時 新手友好度 77/100
callstack/agent-device#4018 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
callstack/agent-device#1869 ·
維護者通常 1 天內回覆
-
bug
難度 4/5 3-5 天 新手友好度 48/100
callstack/agent-device#4322 · 1 則留言 ·
維護者通常 1 天內回覆
-
bug ready-for-agent
難度 3/5 1-2 天 新手友好度 55/100
callstack/agent-device#4321 · 1 則留言 ·
維護者通常 1 天內回覆
-
enhancement
難度 5/5 一週以上 新手友好度 20/100
callstack/agent-device#4318 · 1 則留言 ·
維護者通常 1 天內回覆
查看 callstack/agent-device 的全部 Issue
相似的 Issue
-
Waiting for: Product Owner
難度 2/5 1-3 小時 新手友好度 76/100
getsentry/sentry-javascript#26203 · 1 則留言 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 76/100
bytedance/flowgram.ai#1235 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
devswha/herdr-web-ui#3325 ·
-
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100