From 9e4dd743635e1ca431bcf4597e38d70af615de07 Mon Sep 17 00:00:00 2001 From: Fethi El Hassasna Date: Sat, 4 Jul 2026 16:32:35 -0400 Subject: [PATCH] Use generic simulator destination in CI to fix flaky device matching --- .github/workflows/carplay.yml | 7 +++---- .github/workflows/ios.yml | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/carplay.yml b/.github/workflows/carplay.yml index 92ccd3006..35ba84edb 100755 --- a/.github/workflows/carplay.yml +++ b/.github/workflows/carplay.yml @@ -31,11 +31,10 @@ jobs: - name: Build env: scheme: ${{ 'default' }} - platform: ${{ 'iOS Simulator' }} run: | - # xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959) - device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//"` + # Generic simulator destination: no dependency on which simulator + # runtimes the runner image ships (device-name matching is flaky) if [ $scheme = default ]; then scheme=$(cat default); fi if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi file_to_build=`echo $file_to_build | awk '{$1=$1;print}'` - xcodebuild build-for-testing -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,name=$device" + xcodebuild build-for-testing -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "generic/platform=iOS Simulator" diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index d2aabe990..ebbc227e4 100755 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -31,14 +31,13 @@ jobs: - name: Build env: scheme: ${{ 'default' }} - platform: ${{ 'iOS Simulator' }} run: | - # xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959) - device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//"` + # Generic simulator destination: no dependency on which simulator + # runtimes the runner image ships (device-name matching is flaky) if [ $scheme = default ]; then scheme=$(cat default); fi if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi file_to_build=`echo $file_to_build | awk '{$1=$1;print}'` - xcodebuild build-for-testing -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,name=$device" + xcodebuild build-for-testing -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "generic/platform=iOS Simulator" # Disable testing for now # - name: Test # env: