diff --git a/scripts/test.sh b/scripts/test.sh index cf2a3598a..42cee7e5b 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -20,6 +20,14 @@ set -euo pipefail +if [ -d "/Applications/Xcode_16.1.app" ]; 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 +39,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 +131,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"