I tried
sudo rm -rf /Applications/Xcode*.app
sudo rm -rf /Library/Developer/CommandLineTools
sudo rm -rf /Library/Developer
rm -rf ~/Library/Developer
rm -rf ~/Library/Caches/com.apple.dt.Xcode
rm -rf ~/Library/Application\ Support/Xcode
rm -rf ~/Library/Application\ Support/com.apple.dt.Xcode
rm -rf ~/Library/Preferences/com.apple.dt.Xcode*
rm -rf ~/Library/Saved\ Application\ State/com.apple.dt.Xcode.savedState
sudo xcode-select --reset
And I manually deleted the CoreSimulators. I restarted, but it's still broken. Even installed older Xcode 26 and ran
XCODE_DESTINATION="/Applications"
XCODE_APP="Xcode.app"
sudo /usr/sbin/dseditgroup -o edit -a everyone -t group _developer
sudo xcode-select -s ${XCODE_DESTINATION}/${XCODE_APP}/Contents/Developer
sudo xcodebuild -license accept
sudo xcodebuild -runFirstLaunch
sudo DevToolsSecurity -enable
for PKG in $(/bin/ls ${XCODE_DESTINATION}/${XCODE_APP}/Contents/Resources/Packages/*.pkg); do
sudo /usr/sbin/installer -pkg "$PKG" -target /
done
echo "Checking Xcode CLI tools"
sudo xcode-select -s "${XCODE_DESTINATION}/${XCODE_APP}"
xcode-select -p &> /dev/null
if [ $? -ne 0 ]; then
echo "Xcode CLI tools not found. Installing them..."
touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress;
PROD=$(softwareupdate -l |
grep "\*.*Command Line" |
tail -n 1 | sed 's/^[^C]* //')
softwareupdate -i "$PROD" --verbose;
else
echo "Xcode CLI tools OK"
fi
I must be missing something still...