xxxxxxxxxx
tell application "App Store"
activate
delay 1 -- Wait for the App Store to launch
tell application "System Events"
tell process "App Store"
click menu item "Updates" of menu "Store" of menu bar 1
delay 1 -- Wait for the Updates tab to load
repeat until button "Update" of group 1 of UI element 1 of scroll area 1 of window 1 exists
delay 1 -- Wait until updates are visible
end repeat
click button "Update" of group 1 of UI element 1 of scroll area 1 of window 1
end tell
end tell
end tell
xxxxxxxxxx
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install