Skip to content

fix(ios): rn-fast-runner self-builds on first use; gate agent-device install on Android#193

Merged
Lykhoyda merged 1 commit into
mainfrom
fix/ios-runner-self-build-gate-agent-device
May 31, 2026
Merged

fix(ios): rn-fast-runner self-builds on first use; gate agent-device install on Android#193
Lykhoyda merged 1 commit into
mainfrom
fix/ios-runner-self-build-gate-agent-device

Conversation

@Lykhoyda

Copy link
Copy Markdown
Owner

Why

D1219/PR #164 moved iOS device control onto the in-tree rn-fast-runner (XCTest rig) at the runtime dispatch layer, but the install layer was never updated — leaving it exactly backwards:

  • agent-device was force-installed every RN session (detect-rn-project.sh), even for iOS-only macOS users who never touch it (it's Android-only now).
  • The iOS runner auto-installed for nobody. scripts/rn-fast-runner/build/ is gitignored (artifacts don't ship), and startFastRunner() always spawned xcodebuild test-without-building, which requires a prior build-for-testing. On a fresh machine the .xctestrun never existed → first device_snapshot action=open failed with "did not become ready" (B161).

Surfaced by the maintainer: "we install agent-device, didn't we get rid of it?" + "RnFastRunner isn't installing automatically on another machine."

What

  • iOS runner self-builds on first use. New pure, unit-tested resolveRunnerXcodebuildArgs() + hasBuiltTestProduct(): cold machine → full xcodebuild test (build + test, ready timeout widened 30s → 360s); warm → fast test-without-building. Single chokepoint, so the cdp_repair_action bootstrap (D1220) inherits it.
  • agent-device install gated on a live Android target (adb devices, mirrors ensure-android-ready.sh).
  • /setup + /doctor offer the one-time pre-build to move the cold-build cost out of the first interaction (lazy fallback still guarantees correctness).
  • Docs corrected (rn-setup skill anti-pattern + table row, project CLAUDE.md), including an "expected simulator icons" note explaining RnFastRunner / RnFastRunnerUITests-Runner so the XCUITest host apps aren't mistaken for clutter or the legacy AgentDeviceRunner leak.

Tests / verification

  • TDD: RED (missing-export) → GREEN → refactored call site to the tested fn. New test/unit/runners/rn-fast-runner-build-args.test.js.
  • tsc clean · 1589/1589 cdp-bridge unit tests pass · bash -n on the hook · changeset present (satisfies the ci: require a changeset when shippable src changes (GH #189 post-mortem) #192 require-changeset guard).
  • Not exercised here (needs a real sim): the end-to-end cold xcodebuild test path — worth confirming live on the second machine.

Refs: B161, D1228 (workspace docs); D1219/PR #164, D1220.

🤖 Generated with Claude Code

…install on Android

D1219/PR #164 moved iOS device control onto the in-tree rn-fast-runner at the
runtime layer but never updated the install layer, leaving it inverted:
agent-device was force-installed every session (iOS no longer needs it) while
the iOS runner auto-installed for no one — build/ is gitignored and
startFastRunner() always spawned `xcodebuild test-without-building`, which
requires a manual pre-build fresh machines never ran (B161).

- startFastRunner() falls back to a full `xcodebuild test` (build + test) when
  no .xctestrun exists, so the runner self-builds on first use (ready timeout
  widened to 360s for the cold path); steady-state stays on
  test-without-building. Decision extracted to the unit-tested pure fn
  resolveRunnerXcodebuildArgs() + hasBuiltTestProduct().
- SessionStart hook gates the agent-device global install on a live `adb`
  device/emulator (mirrors ensure-android-ready.sh). iOS-only macOS users stop
  paying for an unused dependency.
- /setup + /doctor offer the one-time build-for-testing pre-build to move the
  cold-build cost out of the first interaction.
- Docs corrected (rn-setup skill, project CLAUDE.md), incl. an "expected
  simulator icons" note explaining RnFastRunner / RnFastRunnerUITests-Runner.

Refs B161, D1228 (workspace docs).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Lykhoyda Lykhoyda merged commit 2c82b18 into main May 31, 2026
7 checks passed
@Lykhoyda Lykhoyda deleted the fix/ios-runner-self-build-gate-agent-device branch May 31, 2026 13:43
@Lykhoyda Lykhoyda mentioned this pull request May 31, 2026
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.

1 participant