Skip to content

Commit 696d900

Browse files
committed
check xcode version
1 parent 0281859 commit 696d900

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

install.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ echo -e "\033[34m### [1/6] Checking System Requirements\033[0m"
193193
printf '\033[34m%.0s=\033[0m' {1..75} && echo
194194
# ------------------------------------------------------------------------------
195195
echo -e "Checking System Requirements..."
196-
# Check XCode installation"
196+
# Check XCode installation
197197
if [ ! -e "/Applications/Xcode.app/Contents/Developer" ]; then
198198
echo -e "\033[31m❌ Error: Xcode is not installed. Please install Xcode through the App Store."
199199
echo -e "\033[31m You can download it from: https://apps.apple.com/app/xcode/id497799835\033[0m"
@@ -202,6 +202,17 @@ else
202202
echo -e "\033[36m> Xcode installation confirmed\033[0m"
203203
fi
204204

205+
# Check Xcode version
206+
XCODE_VERSION=$(xcodebuild -version | grep '^Xcode\s' | sed -E 's/^Xcode[[:space:]]+([0-9\.]+)/\1/')
207+
if [ "$XCODE_VERSION" != "16.2" ]; then
208+
echo -e "\033[31m❌ Error: Xcode version $XCODE_VERSION is installed. This script requires Xcode version 16.2.\033[0m"
209+
echo -e "\033[33m💡 Please follow the guide to downgrade Xcode to version 16.2:\033[0m"
210+
echo -e "\033[34m https://www.antonseagull.com/post/how-to-downgrade-xcode\033[0m"
211+
exit 1
212+
else
213+
echo -e "\033[36m> Xcode version 16.2 confirmed\033[0m"
214+
fi
215+
205216
# Check if the Xcode path is correct
206217
if [ "$(xcode-select -p)" != "/Applications/Xcode.app/Contents/Developer" ]; then
207218
sudo xcode-select -s "/Applications/Xcode.app/Contents/Developer"

0 commit comments

Comments
 (0)