I tried it and it can be updated successfully from System Preferences. But I want to update by command, I tried on macOS Big Sur or macOS Monterey and it seems that the softwareupdate command does not work for update Mac's version.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: