Skip to content

Instantly share code, notes, and snippets.

@scriptingosx
Created July 27, 2023 11:11
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scriptingosx/b280e733dc2a7dafc56fe115060f9787 to your computer and use it in GitHub Desktop.
Save scriptingosx/b280e733dc2a7dafc56fe115060f9787 to your computer and use it in GitHub Desktop.
Configure Xcode post installation script with SDK download for Xcode 14 and 15
#!/bin/sh
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
xcodePath="/Applications/Xcode.app"
if [ ! -e "$xcodePath" ]; then
echo "no app at $xcodePath, exiting..."
exit 1
fi
# select Xcode
xcode-select -s "$xcodePath"
# accept license
xcodebuild -license accept
# install additional components
xcodebuild -runFirstLaunch
# add everyone (every local account) to developer group
dseditgroup -o edit -a everyone -t group _developer
# enable dev tools security
DevToolsSecurity -enable
# download platform SDK
# all available platforms
# xcodebuild -downloadAllPlatforms
# update previously downloaded platforms
# xcodebuild -downloadAllPreviouslySelectedPlatforms
# download individual platforms (repeat for each)
# options are: watchOS, tvOS, and (Xcode 15+) iOS, and xrOS
xcodebuild -downloadPlatform iOS
xcodebuild -downloadPlatform watchOS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment