You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reduce Apple runner cold-build and first-use work while keeping cache invalidation reliable.
Shipped changes:
Area
Before
After
Runtime runner Swift surface
Runtime code and Swift unit-test helpers compiled together
Unit-test-only Swift is behind AGENT_DEVICE_RUNNER_UNIT_TESTS
Asset catalog
Tiny branding assets still ran actool during cold runner builds
Assets.xcassets and bundled branding images removed
Runner cache key
Invalidated on package version bumps
Reused across package version bumps; still keyed by toolchain, SDK, source fingerprint, platform, and build flags
Maintainer/CI script destination
generic/platform=iOS Simulator, which can build arm64 + x86_64
Concrete available simulator when possible, with 3s fallback to generic
Swift unit coverage
Coupled to build:all
Separate CI compile job for the guarded Swift unit-test surface
Measurements
Measured on Xcode 26.2 with fresh DerivedData per run.
Scenario
Runs
Before median / mean
After median / mean
Delta
User runner xcodebuild build-for-testing, iPhone 17 Pro Max simulator
5 before + 5 after
8.06s / 7.82s
7.76s / 7.75s
-3.7% median
First use: open settings then first snapshot -i, no runner cache
1 before + 1 after
31.5s
21.4s
-32% wall time
pnpm build:xcuitest iOS script destination
5 before + 5 after
8.210s / 8.042s
5.767s / 5.825s
-29.8% median
Notes:
The user runner build-only win is modest because Swift frontend work and Xcode warm caches dominate after the first run, but the first-use CLI path is materially faster.
The script destination win applies to maintainer/CI build:xcuitest; runtime/user builds already used concrete simulator destinations.
Package dry run stayed small: 161 files, 568 KB packed / 1.97 MB unpacked, with no asset catalog or branding images.
Rejected Experiments
I also tested wholemodule + -num-threads, debug info off / Swift -gnone, explicit modules off, testability off, incremental off, lazy recording compilation, and related combinations. None met the shipping bar for runtime builds: either the median win was noise-level, wall time got worse, or the change added complexity/semantic risk.
Validation
pnpm check:quick: passed
pnpm exec vitest run src/platforms/ios/__tests__/runner-client.test.ts src/platforms/ios/__tests__/runner-xctestrun.test.ts src/platforms/ios/__tests__/runner-icon.test.ts: 79 tests passed
Reviewed the latest head, including the new concrete-simulator destination commit.
I do not see a blocker. The default iOS/tvOS script path now prefers an available concrete simulator id, but keeps the generic simulator fallback when simctl lookup fails. Cache metadata still normalizes the destination back to the simulator family, so choosing a specific UDID should not churn runner cache keys. The unit-test Swift flag is now explicitly represented in both the shell build path and metadata comparison, so runtime and unit-test runner variants stay separated. Current CI is green, including Swift Runner Unit Compile, typecheck, unit, integration, smoke, and iOS runner compatibility.
Residual risk: this is still Apple runner build/cache behavior, so I would treat the PR body’s local Xcode measurements and first-use validation as the device-facing evidence rather than relying on fixture tests alone. With that evidence plus green CI, this is ready for maintainer merge judgment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ready-for-humanValid work that needs human implementation, judgment, or maintainer merge
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reduce Apple runner cold-build and first-use work while keeping cache invalidation reliable.
Shipped changes:
AGENT_DEVICE_RUNNER_UNIT_TESTSactoolduring cold runner buildsAssets.xcassetsand bundled branding images removedgeneric/platform=iOS Simulator, which can build arm64 + x86_64build:allMeasurements
Measured on Xcode 26.2 with fresh DerivedData per run.
xcodebuild build-for-testing, iPhone 17 Pro Max simulatoropen settingsthen firstsnapshot -i, no runner cachepnpm build:xcuitestiOS script destinationNotes:
build:xcuitest; runtime/user builds already used concrete simulator destinations.Rejected Experiments
I also tested wholemodule +
-num-threads, debug info off / Swift-gnone, explicit modules off, testability off, incremental off, lazy recording compilation, and related combinations. None met the shipping bar for runtime builds: either the median win was noise-level, wall time got worse, or the change added complexity/semantic risk.Validation
pnpm check:quick: passedpnpm exec vitest run src/platforms/ios/__tests__/runner-client.test.ts src/platforms/ios/__tests__/runner-xctestrun.test.ts src/platforms/ios/__tests__/runner-icon.test.ts: 79 tests passedpnpm build:xcuitest: passed for iOS and macOSnpm pack --dry-run --ignore-scripts --json --cache /private/tmp/agent-device-npm-cache: verified package contents and asset removalAGENT_DEVICE_XCUITEST_INCLUDE_UNIT_TESTS=1 ... pnpm build:xcuitest:macos: passed earlier and showed-D AGENT_DEVICE_RUNNER_UNIT_TESTSLatest pushed SHA:
5cce08d8d.