From 7e015b273e009e7987bf3f38fac7e4fbc9cb33c9 Mon Sep 17 00:00:00 2001 From: Alex Bush Date: Sun, 12 Jul 2026 16:53:20 -0500 Subject: [PATCH] ci: resolve iOS simulator at runtime instead of pinning iPhone 16 The `build-and-test` job hardcoded `-destination 'platform=iOS Simulator, name=iPhone 16'`. When the `macos-latest` runner image rolls forward, that model is no longer preinstalled (current image ships iPhone 16e / 17 / 17 Pro / Air, etc.), so xcodebuild fails destination resolution with exit 70 before running a single test. Resolve an available iPhone simulator at runtime via `simctl` + `jq` and pass it by `id`. A generic destination (`generic/platform=iOS Simulator`) is not an option here because the job runs `test`, which requires a bootable device. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01J9mruKG6RSYg6SfPaq6MPG --- .github/workflows/iOS.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/iOS.yml b/.github/workflows/iOS.yml index dcbfd1e..0b9e585 100644 --- a/.github/workflows/iOS.yml +++ b/.github/workflows/iOS.yml @@ -28,11 +28,16 @@ jobs: - name: Run tests with coverage working-directory: ./Example run: | + # Resolve an available iPhone simulator at runtime instead of pinning a + # model name, which rots whenever the macos-latest runner image updates. + DEVICE_ID=$(xcrun simctl list devices available --json \ + | jq -r '[.devices[][] | select(.name | test("iPhone"))] | first | .udid') + echo "Using simulator: $DEVICE_ID" xcodebuild \ -workspace RIBs.xcworkspace \ -scheme RIBs-Example \ -sdk iphonesimulator \ - -destination 'platform=iOS Simulator,name=iPhone 16' \ + -destination "platform=iOS Simulator,id=$DEVICE_ID" \ -enableCodeCoverage YES \ clean test