-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall-xcode
More file actions
executable file
·26 lines (26 loc) · 975 Bytes
/
install-xcode
File metadata and controls
executable file
·26 lines (26 loc) · 975 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bash
source "$HOME/.bash_functions/strict.bash"
#TODO check osascript has Accessibility access (Security & Privacy -> Privacy)
#TODO additional prompt appears when running on battery power
#TODO wait for install to complete
xcode-select --install
#TODO remove sleep
sleep 1
osascript <<-EOM
tell application "System Events"
tell process "Install Command Line Developer Tools"
keystroke return
click button "Agree" of window "License Agreement"
repeat until exists window "Software License Agreement" of process "Install Command Line Developer Tools"
delay 1
end repeat
click button "Agree" of window "Software License Agreement"
repeat until application "Install Command Line Developer Tools" is not running
delay 1
end repeat
end tell
end tell
EOM
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -license accept
sudo xcodebuild -runFirstLaunch