You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
o3de/scripts/build/build_node/Platform/Mac/install-xcode.sh

47 lines
1.4 KiB
Bash

#!/bin/bash
set -euo pipefail
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
XCODE_VER="11.4"
S3_BUCKET=$1
echo "Installing Xcode ${XCODE_VER}"
aws s3 cp ${S3_BUCKET}/Xcode$XCODE_VER.xip /tmp/
cd /Applications
if sudo xip -x /tmp/Xcode$XCODE_VER.xip ; then
sudo xcodebuild -license accept
rm /tmp/Xcode${XCODE_VER}.xip
else
echo "Installation failed!"
exit 1
fi
echo "Installing Xcode Command line tools ${XCODE_VER}"
aws s3 cp ${S3_BUCKET}/Command_Line_Tools_for_${XCODE_VER}.dmg /tmp/
sudo hdiutil attach /tmp/Command_Line_Tools_for_${XCODE_VER}.dmg
if sudo installer -pkg /Volumes/Command\ Line\ Developer\ Tools/Command\ Line\ Tools.pkg -target / ; then
sudo hdiutil detach /Volumes/Command\ Line\ Developer\ Tools/
rm /tmp/Command_Line_Tools_for_${XCODE_VER}.dmg
else
echo "Installation failed!"
sudo hdiutil detach /Volumes/Command\ Line\ Developer\ Tools/
exit 1
fi
echo "Installing XCode iOS packages"
sudo installer -pkg /Applications/Xcode.app/Contents/Resources/Packages/MobileDevice.pkg -target /
sudo installer -pkg /Applications/Xcode.app/Contents/Resources/Packages/MobileDeviceDevelopment.pkg -target /
echo "Enabling developer mode"
sudo /usr/sbin/DevToolsSecurity --enable
echo "Installing cmake"
brew install cmake