Will the three commands
sudo rm -fr /Applications/Xcode.app/
sudo rm -fr /Library/Developer/
rm -fr ~/Library/Developer/
completely and safely discard the development environment on macOS for a once-a-decade start-from-fresh-during-major-release upgrade of macOS?
Rather than delete, I renamed the folders in question. The folders have been refilled just fine during update to Big Sur, but renaming, and hence presumably also deleting, is problematic. I am now in an infinite loop of getting the messages "An update is available for your Mac", "Command Line Tools for Xcode 12.4". Yet after clicking "Update Now" and waiting for its completion, the message returns, and another update proceeds, downloading seemingly from scratch.
/usr/bin/git --version says
xcodebuild: error: SDK "macosx10.15" cannot be located.,
git: error: .. failed, and
xcode-select: Failed to locate 'git', requesting installation of command line developer tools., running sudo /usr/bin/git --version runs fine (and reports
git version 2.24.3 (Apple Git-128)).
The problem then appears to be that after renaming (and even now that I've restored the renaming) the license agreement is marked as not signed, but
git doesn't say so.
(Re-)Agreeing to the license agreement from the Terminal by running
sudo xcodebuild -license does not help.
/usr/bin/git still says
"macosx10.15" cannot be located. and
xcode-select: Failed to locate 'git'.
And agreeing under the
sudo identity is indeed necessary. Attempting
xcodebuild -license gives
Agreeing to the Xcode/iOS license requires admin privileges, please run “sudo xcodebuild -license” and then retry this command.