Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

platform-ios: wait for the simulator to settle after boot before launching the app

未关闭
#189 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
52/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
react-native, typescript

调研方向

从 packages/platform-ios/src/instance.ts 中的 prepareSimulator 开始,然后阅读 packages/platform-ios/src/xcrun/simctl.ts 中的 waitForBoot 以及 startup-strategy.ts 中的主机阈值。在选择有界的响应性或基于负载的稳定行为之前,比较 booted 和已经 Booting 的路径。完成的标准是,受限主机在启动后安全等待,等待时间有上限,并且其持续时间会出现在诊断信息中,同时不会无限期延迟启动。

由索引模型根据 Issue 内容生成。

描述

enhancement

Context

Harness runs unreliably on small CI hosts (e.g. GitHub macos-latest: 3 vCPU / 7 GB); a common symptom is the app failing to connect to the bridge shortly after simulator boot.

prepareSimulator in packages/platform-ios/src/instance.ts boots the simulator and waits with xcrun simctl bootstatus <udid> -b (packages/platform-ios/src/xcrun/simctl.ts waitForBoot). bootstatus -b returns as soon as the device reports Booted, but SpringBoard and the first-boot daemons keep consuming CPU for a while afterwards. On a 3-core host the app is then installed and launched into a simulator that is still busy, which stretches JS evaluation and can push startup past bundleStartTimeout / readyTimeout.

Proposal

Add a bounded "settle" step after waitForBoot, applied on constrained hosts (reuse the host-capability thresholds from startup-strategy.ts):

  • Poll a direct responsiveness probe, e.g. xcrun simctl spawn <udid> launchctl list, and proceed once two consecutive calls complete under ~300 ms; and/or
  • wait until os.loadavg()[0] drops below cores × 1.5;
  • cap the wait (e.g. 45 s) so a persistently busy host does not stall startup, and record the settle duration in diagnostics.

This should apply both when Harness booted the simulator and when it found one already Booting.

Files

  • packages/platform-ios/src/instance.ts (prepareSimulator)
  • packages/platform-ios/src/xcrun/simctl.ts (waitForBoot)
  • packages/platform-ios/src/startup-strategy.ts

Part of a broader effort to make Harness reliable on constrained CI runners.

主要语言
TypeScript
星标
330
派生
17
平均合并
23 小时 53 分钟
30 天内合并 PR
1

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

callstackincubator/react-native-harness 的其他 Issue

查看 callstackincubator/react-native-harness 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。