【Background】
Unable to install Xcode directly
Error message: Xcode cannot be installed on "Macintosh HD" because macOS v13 or later is required.
[Solution 1] Upgrade mac os
But I upgraded to the latest version and still can't meet the minimum version requirements for installing Xcode
[Solution 2] Install a lower version of Xcode
1. Find the appropriate Xcode version
Find the Xcode version that supports the current mac os system in "Version History"
I correspond to 12.5.1
2. Download Xcode
Visit Apple's official download address: https://developer.apple.com/download/more/ , after logging in to your mac account, search for the Xcode version number, and find the corresponding Xcode download and install
3. Install Xcode
After the download is complete, double-click to install, and the installation will be successful after the decompression is complete.