From 1cc4796b15169d36abedc55d83eb802533eaf53a Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Mon, 26 Jan 2026 11:28:32 +0100 Subject: [PATCH 1/3] chore(ci): Fix flaky iOS native tests by removing OS=latest The OS=latest parameter in xcodebuild destination is unreliable on GitHub's macos-15 runners due to frequent simulator runtime deprecations. By omitting the OS version, xcodebuild automatically selects any available iPhone 16 simulator, making the tests more stable across runner image updates. Co-Authored-By: Claude Sonnet 4.5 --- .github/workflows/native-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/native-tests.yml b/.github/workflows/native-tests.yml index 62cd9c88de..b99efebb4a 100644 --- a/.github/workflows/native-tests.yml +++ b/.github/workflows/native-tests.yml @@ -54,7 +54,7 @@ jobs: env: SCHEME: RNSentryCocoaTester CONFIGURATION: Release - DESTINATION: 'platform=iOS Simulator,OS=latest,name=iPhone 16' + DESTINATION: 'platform=iOS Simulator,name=iPhone 16' run: | env NSUnbufferedIO=YES \ xcodebuild -workspace *.xcworkspace \ From c123a724de76e0d7ff11358adf32874fc3e7b461 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Mon, 26 Jan 2026 11:48:18 +0100 Subject: [PATCH 2/3] chore(ci): Dynamically select available iPhone simulator for tests Instead of hardcoding device name and OS version, dynamically find the first available iPhone simulator using xcrun simctl. This prevents failures when specific device/OS combinations aren't available on CI runners. Also adds a debug step to list available simulators for troubleshooting. Co-Authored-By: Claude Sonnet 4.5 --- .github/workflows/native-tests.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/native-tests.yml b/.github/workflows/native-tests.yml index b99efebb4a..ec0364f68f 100644 --- a/.github/workflows/native-tests.yml +++ b/.github/workflows/native-tests.yml @@ -49,17 +49,27 @@ jobs: working-directory: packages/core/RNSentryCocoaTester run: pod install + - name: List Available Simulators + run: xcrun simctl list devices available iPhone + - name: Run iOS Tests working-directory: packages/core/RNSentryCocoaTester env: SCHEME: RNSentryCocoaTester CONFIGURATION: Release - DESTINATION: 'platform=iOS Simulator,name=iPhone 16' run: | + # Find first available iPhone simulator + DEVICE_ID=$(xcrun simctl list devices available iPhone -j | jq -r '.devices | to_entries[].value[] | select(.isAvailable == true) | .udid' | head -1) + if [ -z "$DEVICE_ID" ]; then + echo "No iPhone simulators available" + exit 1 + fi + echo "Using simulator: $DEVICE_ID" + env NSUnbufferedIO=YES \ xcodebuild -workspace *.xcworkspace \ -scheme $SCHEME -configuration $CONFIGURATION \ - -destination "$DESTINATION" \ + -destination "id=$DEVICE_ID" \ -quiet \ test From a253400928cc3d242e489e44f14c9b44a6cd048a Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Mon, 26 Jan 2026 14:35:42 +0100 Subject: [PATCH 3/3] chore(ci): Select iPhone simulator from latest iOS runtime Improves device selection to explicitly choose from the latest available iOS runtime, preventing tests from running on older iOS versions. Co-Authored-By: Claude Sonnet 4.5 --- .github/workflows/native-tests.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/native-tests.yml b/.github/workflows/native-tests.yml index ec0364f68f..3cbe18e12f 100644 --- a/.github/workflows/native-tests.yml +++ b/.github/workflows/native-tests.yml @@ -58,8 +58,17 @@ jobs: SCHEME: RNSentryCocoaTester CONFIGURATION: Release run: | - # Find first available iPhone simulator - DEVICE_ID=$(xcrun simctl list devices available iPhone -j | jq -r '.devices | to_entries[].value[] | select(.isAvailable == true) | .udid' | head -1) + # Find first available iPhone simulator from latest iOS runtime + DEVICE_ID=$(xcrun simctl list devices available iPhone -j | jq -r ' + .devices | + to_entries | + map(select(.key | startswith("com.apple.CoreSimulator.SimRuntime.iOS-"))) | + sort_by(.key) | + reverse | + .[0].value[] | + select(.isAvailable == true) | + .udid + ' | head -1) if [ -z "$DEVICE_ID" ]; then echo "No iPhone simulators available" exit 1