Skip to content

Commit 83747b1

Browse files
alexvbushclaude
andauthored
ci: resolve iOS simulator at runtime instead of pinning iPhone 16 (#54)
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. Claude-Session: https://claude.ai/code/session_01J9mruKG6RSYg6SfPaq6MPG Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent c2e5f5f commit 83747b1

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/iOS.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,16 @@ jobs:
2828
- name: Run tests with coverage
2929
working-directory: ./Example
3030
run: |
31+
# Resolve an available iPhone simulator at runtime instead of pinning a
32+
# model name, which rots whenever the macos-latest runner image updates.
33+
DEVICE_ID=$(xcrun simctl list devices available --json \
34+
| jq -r '[.devices[][] | select(.name | test("iPhone"))] | first | .udid')
35+
echo "Using simulator: $DEVICE_ID"
3136
xcodebuild \
3237
-workspace RIBs.xcworkspace \
3338
-scheme RIBs-Example \
3439
-sdk iphonesimulator \
35-
-destination 'platform=iOS Simulator,name=iPhone 16' \
40+
-destination "platform=iOS Simulator,id=$DEVICE_ID" \
3641
-enableCodeCoverage YES \
3742
clean test
3843

0 commit comments

Comments
 (0)