Skip to content

[build-tools] Move iOS Simulator startup into its own file - #4752

Open
gwdp wants to merge 3 commits into
gwdp/prepared-simulator-adoption-20261022from
gwdp/cold-ios-session-20261026
Open

gwdp wants to merge 3 commits into
gwdp/prepared-simulator-adoption-20261022from
gwdp/cold-ios-session-20261026

Conversation

@gwdp

@gwdp gwdp commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Why

Cold and warm sessions need the same preview, app startup and cleanup steps.

How

Move cold iOS Simulator session startup into coldIosSession.ts behind the session host's shared preview, app-start and cleanup contract. #4724 supplies the warm implementation. Android keeps its existing startup.

The cold path waits for warm cleanup (#4721) before starting serve-sim. Requires the serve-sim release with port-based adoption.

How the session host and server coordinate
  • Session host: owns the shared preview, app installation and launch, recording completion and session teardown.
  • Cold server (coldIosSession.ts): supplies the port and startup handle, waits for warm cleanup, then starts a fresh serve-sim. It also supplies Simulator-specific setup such as the apsd attempt.
  • Warm server ([build-tools] Claim the warm Simulator and adopt its serve-sim #4724): implements the same contract with the claimed server. It handles adoption and tool preparation before returning control to the host.

The host can use either server without duplicating app and preview handling. Preview opening still overlaps startup. Opening and retirement waits are bounded, late listeners close themselves, and unconfirmed warm tunnel retirement prevents cold fallback. The cleanup wait belongs immediately before cold serve-sim startup because that process boots the Simulator; unrelated session preparation can proceed earlier. Startup rollback attempts server stop and screenshot cleanup; combined startup and cleanup failures retain both causes. Both supported host commands use --require-token. Android keeps its existing startup implementation.

Test Plan

  • Local focused tests, build-tools typecheck, scoped lint and formatting pass. CI passes on this head; Devin analysis passed.

  • No fresh native run for this review round.

  • Earlier verified local launch E2E: Universe-generated steps through build-tools download/install/start to a pinned serve-sim build on a real iOS Simulator; checked one app start, launch arguments and deep link. It used loopback tunnel/reporting adapters and was not rerun for this head. This was local validation, not hosted EAS/API-to-worker acceptance.

Authorship and LLM use

Gabe reviewed the preceding changes. Codex and Claude Code wrote the code and tests. This review round and the updated base still need human review.

Rollback

Revert #4724 and its dependent layers first.

— Codex

@gwdp
gwdp added this pull request to stack #4753 October 26, 2026 05:42
@gwdp

This comment has been minimized.

@devin-ai-integration

This comment has been minimized.

devin-ai-integration[bot]

This comment was marked as resolved.

@gwdp gwdp changed the title [build-tools] Separate cold iOS Simulator startup [build-tools] Move iOS Simulator startup into its own file Oct 26, 2026
@codecov

This comment has been minimized.

@gwdp

This comment has been minimized.

@devin-ai-integration

This comment has been minimized.

devin-ai-integration[bot]

This comment was marked as outdated.

@gwdp

This comment has been minimized.

@devin-ai-integration

This comment has been minimized.

@gwdp
gwdp force-pushed the gwdp/cold-ios-session-20261026 branch from e26e93e to fe3e508 Compare October 26, 2026 07:19
@gwdp
gwdp force-pushed the gwdp/cold-ios-session-20261026 branch 2 times, most recently from 5292ee4 to 904e25e Compare October 26, 2026 23:38
@gwdp
gwdp force-pushed the gwdp/cold-ios-session-20261026 branch from 904e25e to c28c49b Compare October 26, 2026 23:46
@gwdp

This comment has been minimized.

@devin-ai-integration

This comment has been minimized.

@gwdp
gwdp removed this pull request from stack #4753 October 27, 2026 01:35
@gwdp
gwdp added this pull request to stack #4765 October 27, 2026 01:36
@gwdp
gwdp removed this pull request from stack #4765 October 27, 2026 06:32
@gwdp
gwdp added this pull request to stack #4767 October 27, 2026 06:32
@gwdp
gwdp marked this pull request as ready for review October 29, 2026 02:15
@gwdp
gwdp requested a review from szdziedzic October 29, 2026 02:15
@gwdp
gwdp force-pushed the gwdp/cold-ios-session-20261026 branch 2 times, most recently from f726897 to d0b4157 Compare October 29, 2026 05:13
@gwdp
gwdp force-pushed the gwdp/cold-ios-session-20261026 branch from d0b4157 to 98a56f8 Compare October 29, 2026 06:22
@gwdp

gwdp commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Codex rebased this PR onto main 6f0f90bd9 and restacked its dependencies. Retained main's preview-device policy and adapted four existing test fixtures to the extracted host options.

Current head: c8ca33ab0e8daf3647ff5dbfaf1290773fad491f. Stack-level local checks: 496 focused build-tools tests and 59 worker tests passed on the rebased main stack; 154 artifact-drain/host tests passed on #4750. Build-tools, worker and launcher typechecks, scoped lint and formatting pass. CI passes on this exact head, including Node 22 and Node 24; prior human reviews apply to the earlier heads. Draft states and human review requests are preserved.

Earlier contribution and validation

Codex rebased this layer on the current-boot cleanup guard and updated its real cleanup fixture. The cold host still waits immediately before spawning serve-sim. Preview overlap, bounded retirement and cleanup error handling are retained. Fourteen cleanup/cold-start tests pass. The earlier memfs report remains resolved.

Current head: ce93127. Local typecheck, scoped lint and formatting pass. Devin analysis passed on this exact head; CI passes on this head. Gabe reviewed the preceding changes; this round and the updated base still need human review.

— Codex

@gwdp
gwdp force-pushed the gwdp/cold-ios-session-20261026 branch from 98a56f8 to a1800b9 Compare October 29, 2026 19:06
@gwdp

This comment has been minimized.

@devin-ai-integration

This comment has been minimized.

devin-ai-integration[bot]

This comment was marked as outdated.

@gwdp
gwdp requested a review from szdziedzic October 29, 2026 21:47
@gwdp
gwdp force-pushed the gwdp/cold-ios-session-20261026 branch from a1800b9 to ce93127 Compare October 29, 2026 22:44
@gwdp

This comment has been minimized.

@devin-ai-integration

This comment has been minimized.

@gwdp
gwdp removed this pull request from stack #4767 October 30, 2026 06:55
@gwdp
gwdp added this pull request to stack #4792 October 30, 2026 06:55
@gwdp
gwdp force-pushed the gwdp/cold-ios-session-20261026 branch from ce93127 to c8ca33a Compare October 30, 2026 17:01
@github-actions

Copy link
Copy Markdown

✅ Thank you for adding a changeset!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants