From 14514e0826618fb7a22164e420556a75192f9a98 Mon Sep 17 00:00:00 2001 From: Andrew Heard Date: Tue, 12 Nov 2024 20:52:12 -0500 Subject: [PATCH 1/2] [CI] Select Xcode and Simulator version based on OS version --- scripts/test.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/test.sh b/scripts/test.sh index cf2a3598a..156fad1af 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -20,6 +20,15 @@ set -euo pipefail +macos_version=$(sw_vers --productVersion) +if [[ "$macos_version" -ge 15 ]]; then + xcode_version="16.1" + iphone_version="16" +else + xcode_version="15.3" + iphone_version="15" +fi + # Set default parameters if [[ -z "${SPM:-}" ]]; then SPM=false @@ -31,7 +40,7 @@ if [[ -z "${SPM:-}" ]]; then fi if [[ -z "${OS:-}" ]]; then OS=iOS - DEVICE="iPhone 16" + DEVICE="iPhone ${iphone_version}" echo "Defaulting to OS=$OS" echo "Defaulting to DEVICE=$DEVICE" fi @@ -123,6 +132,6 @@ function xcb() { } # Run xcodebuild -sudo xcode-select -s /Applications/Xcode_16.1.app/Contents/Developer +sudo xcode-select -s "/Applications/Xcode_${xcode_version}.app/Contents/Developer" xcb "${flags[@]}" echo "$message" From bfeb90d553250becf2b58dcef298b500429abb57 Mon Sep 17 00:00:00 2001 From: Andrew Heard Date: Tue, 12 Nov 2024 21:06:52 -0500 Subject: [PATCH 2/2] Check if Xcode 16.1 exists instead of OS version check --- scripts/test.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/test.sh b/scripts/test.sh index 156fad1af..42cee7e5b 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -20,8 +20,7 @@ set -euo pipefail -macos_version=$(sw_vers --productVersion) -if [[ "$macos_version" -ge 15 ]]; then +if [ -d "/Applications/Xcode_16.1.app" ]; then xcode_version="16.1" iphone_version="16" else