Skip to content

Commit

Permalink
[CI] Select Xcode and Simulator version based available version (#1659)
Browse files Browse the repository at this point in the history
* [CI] Select Xcode and Simulator version based on OS version

* Check if Xcode 16.1 exists instead of OS version check
  • Loading branch information
andrewheard authored Nov 13, 2024
1 parent 1a40e1e commit 29b4909
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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"

0 comments on commit 29b4909

Please sign in to comment.