Skip to content

Commit 29b4909

Browse files
authoredNov 13, 2024··
[CI] Select Xcode and Simulator version based available version (#1659)
* [CI] Select Xcode and Simulator version based on OS version * Check if Xcode 16.1 exists instead of OS version check
1 parent 1a40e1e commit 29b4909

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed
 

‎scripts/test.sh

+10-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@
2020

2121
set -euo pipefail
2222

23+
if [ -d "/Applications/Xcode_16.1.app" ]; then
24+
xcode_version="16.1"
25+
iphone_version="16"
26+
else
27+
xcode_version="15.3"
28+
iphone_version="15"
29+
fi
30+
2331
# Set default parameters
2432
if [[ -z "${SPM:-}" ]]; then
2533
SPM=false
@@ -31,7 +39,7 @@ if [[ -z "${SPM:-}" ]]; then
3139
fi
3240
if [[ -z "${OS:-}" ]]; then
3341
OS=iOS
34-
DEVICE="iPhone 16"
42+
DEVICE="iPhone ${iphone_version}"
3543
echo "Defaulting to OS=$OS"
3644
echo "Defaulting to DEVICE=$DEVICE"
3745
fi
@@ -123,6 +131,6 @@ function xcb() {
123131
}
124132

125133
# Run xcodebuild
126-
sudo xcode-select -s /Applications/Xcode_16.1.app/Contents/Developer
134+
sudo xcode-select -s "/Applications/Xcode_${xcode_version}.app/Contents/Developer"
127135
xcb "${flags[@]}"
128136
echo "$message"

0 commit comments

Comments
 (0)
Please sign in to comment.