CI: resolve or create the iOS Simulator instead of hard-coding iPhone 17 (#96) #27
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
backmeupplz/absplus!27
Loading…
Reference in a new issue
No description provided.
Delete branch "ci/96-ios-simulator-fallback"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes agentboard #96 (https://agentboard.icefish-betta.ts.net/#96).
Problem
Some
macos-26runners fail iOS jobs about 2 minutes in, before any test runs, withUnable to find a device matching the provided destination specifier.CI on this PR showed what actually happens on such a runner (job 115074102662). Every stock runtime and device is present, and
simctlboots the stock iPhone 17 (iOS 26.5) without trouble. But xcodebuild's device discovery lists no simulators within the default destination timeout, even after a CoreSimulatorService restart. Locally,-destination-timeout Nmakes xcodebuild wait N seconds and then fail with exactly this error (exit 70). The original failures came about 60 s in, which fits slow discovery hitting the timeout.Change
Resolve iOS Simulatorstep runsios/ci_simulator.py. The script:xcrun simctl list -jfor up to 3 minutes and restarts a stuck CoreSimulatorService once. If no usable iOS runtime ever appears, it runsxcodebuild -downloadPlatform iOSonce, streamed to the log.project.pbxproj, currently 26.1) and the active iphonesimulator SDK. The upper bound matches the oldOS=latest.xcrun simctl create. If the runtime doesn't support the iPhone 17, it uses a device type with the same screen size (1206×2622 @3x, read from the device type'scapabilities.plist, e.g. iPhone 17 Pro or 16 Pro), so the geometry assertions still hold. It never uses a different screen size and fails with::error::instead.simctl bootstatus -b, capped at 300 s). If the create or boot fails, it restarts CoreSimulatorService and resolves again once.::notice::.build-for-testingruns againstgeneric/platform=iOS Simulator(ARCHS=arm64, no device discovery). Thentest-without-buildingruns onid=$SIMULATOR_IDwith-destination-timeout 300, so xcodebuild looks for the already-booted device minutes later and waits for it instead of failing at the default timeout. Both steps write result bundles, and both are uploaded on failure.Tests
python3 -m unittest ios/ci_simulator_test.py: 9 selection tests covering reuse, creation, unavailable devices and runtimes, the SDK and deployment-target bounds, other platforms, the same-screen fallback and refusing a different screen size. They also run in CI before resolving.ABS+ CI iPhone 17and printed its UDID. Then a generic arm64build-for-testingfollowed bytest-without-buildingon that UDID ranUITests/Accessibilitywith 3 tests and 0 failures. I deleted the simulator afterwards.::error::and exit 1.b44ccc2, two healthy runners reused the stock iPhone 17 on iOS 26.5, and xcodebuild then found the pre-booted device in under a second.-destination-timeout 300, applied after the build, is enough on a runner whose discovery is slow. The download fallback also isn't exercised live.