install-xcode.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/bash
  2. set -euo pipefail
  3. # Copyright (c) Contributors to the Open 3D Engine Project.
  4. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. #
  6. # SPDX-License-Identifier: Apache-2.0 OR MIT
  7. #
  8. XCODE_VER="11.4"
  9. S3_BUCKET=$1
  10. echo "Installing Xcode ${XCODE_VER}"
  11. aws s3 cp ${S3_BUCKET}/Xcode$XCODE_VER.xip /tmp/
  12. cd /Applications
  13. if sudo xip -x /tmp/Xcode$XCODE_VER.xip ; then
  14. sudo xcodebuild -license accept
  15. rm /tmp/Xcode${XCODE_VER}.xip
  16. else
  17. echo "Installation failed!"
  18. exit 1
  19. fi
  20. echo "Installing Xcode Command line tools ${XCODE_VER}"
  21. aws s3 cp ${S3_BUCKET}/Command_Line_Tools_for_${XCODE_VER}.dmg /tmp/
  22. sudo hdiutil attach /tmp/Command_Line_Tools_for_${XCODE_VER}.dmg
  23. if sudo installer -pkg /Volumes/Command\ Line\ Developer\ Tools/Command\ Line\ Tools.pkg -target / ; then
  24. sudo hdiutil detach /Volumes/Command\ Line\ Developer\ Tools/
  25. rm /tmp/Command_Line_Tools_for_${XCODE_VER}.dmg
  26. else
  27. echo "Installation failed!"
  28. sudo hdiutil detach /Volumes/Command\ Line\ Developer\ Tools/
  29. exit 1
  30. fi
  31. echo "Installing XCode iOS packages"
  32. sudo installer -pkg /Applications/Xcode.app/Contents/Resources/Packages/MobileDevice.pkg -target /
  33. sudo installer -pkg /Applications/Xcode.app/Contents/Resources/Packages/MobileDeviceDevelopment.pkg -target /
  34. echo "Enabling developer mode"
  35. sudo /usr/sbin/DevToolsSecurity --enable
  36. echo "Installing cmake"
  37. brew install cmake@3.22.1