how to update version xcodebuild from command line code example
Example: update xcode command line
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install