I'm using the default toolchain shipped with Xcode 13.1 on macOS 12 (Monterey).
$ sudo xcode-select -r
$ sudo xcode-select -p
/Applications/Xcode.app/Contents/Developer
But I find there are two SDK directories under /Library/Developer/CommandLineTools/SDKs:
$ pwd
/Library/Developer/CommandLineTools/SDKs
$ ls -1
MacOSX10.14.sdk
MacOSX10.15.sdk
I wonder how were they installed?
I upgraded my macOS (and hence Xcode) several times in the past. Were these SDKs installed during those upgrades? But since xcode was upgraded also, shouldn't it contain the up-to-date SDK under its /Applications/Xcode.app/Contents/Developer/Toolchains directory? Why is it necessary to install a separate copy unnder /Library/Developer/CommandLineTools/SDKs?
Also, are SDK and toolchain the same thing? I thought they were, but I'm not sure now. I googled about this but found nothing helpful. I find an apple doc explaining one can view available toolchains in Xcode by selecting Preferences -> Components in menu. I see nothing when using that approach, which seems to suggest MacOSX10.14.sdk and MacOSX10.15.sdk are not considered (valid?) toolchains on my system?
Or are SDKs under /Library/Developer/CommandLineTools/SDKs for macOS development only and the toolchains in Xcode contains more for iOS, iPad, etc? But if so, why isn't there MacOSX11.0.sdk and MacOSX12.0.sdk under /Library/Developer/CommandLineTools/SDKs?
I'm completely at lost. Thanks for any explanation.