在macOS 10.13上安装Xcode 9.2报错,求解决方法及安装技巧
Fixing Xcode 9.2 Installation Issues on macOS 10.13
Hey there, let's work through this Xcode 9.2 problem you're facing on macOS 10.13. Even though 10.13 is newer than the stated 10.12.6 requirement, installation glitches happen all the time—here's how to troubleshoot and work around them:
First, Fix the Installation Error
Start with these standard troubleshooting steps to resolve the initial install failure:
- Verify your installation package: Corrupted downloads are a common culprit. Redownload Xcode 9.2 from Apple's official developer resources (make sure you're grabbing the correct version for your system). If you want to be thorough, cross-check the file's SHA256 hash against the one listed on the download page to confirm it's intact.
- Clean up old Xcode caches: Leftover files can interfere with new installs. Open Terminal and run these commands (enter your admin password when prompted):
Restart your Mac after running these, then try installing again.sudo rm -rf /Library/Developer/Xcode/ rm -rf ~/Library/Caches/com.apple.dt.Xcode/ - Run Disk First Aid: Corrupted system files might block the install. Open Disk Utility, select your main system drive, click the "First Aid" button, and let it scan and repair any issues.
- Allow unidentified developer apps: macOS might block older Xcode versions by default. Go to System Preferences > Security & Privacy > General. If you see a message saying "Xcode was blocked from opening because it is not from an identified developer," click "Allow Anyway" and try launching the installer again.
If Xcode 9.2 Still Won't Run on macOS 10.13
If the install completes but the app won't launch, or the error persists, try these workarounds to get it running:
- Bypass system version checks: Xcode's Info.plist file enforces a minimum system version, but we can tweak this to accommodate macOS 10.13. Here's how:
- Find the Xcode.app in your Applications folder, right-click it, and select "Show Package Contents."
- Navigate to
Contents/Info.plistand open it with a text editor (or a plist editor like PlistEdit Pro for easier editing). - Locate the key
LSMinimumSystemVersion—it should be set to10.12.6. Change this value to10.13(or even10.12if you want to be extra safe). - Save the file, then try launching Xcode again. Pro tip: Make a backup of the original Info.plist before editing, just in case.
- Use the Command Line Tools instead: If you don't need the full Xcode GUI (e.g., you're just compiling code via Terminal), download the standalone Xcode 9.2 Command Line Tools from Apple's developer site. After installing, run
xcode-select --switch /Library/Developer/CommandLineToolsto set it as your active toolchain. - Use a dedicated environment: If all else fails, set up a macOS 10.12.6 virtual machine (using tools like Parallels or VirtualBox) or install 10.12.6 on an external drive. This lets you run Xcode 9.2 in its native supported environment without modifying your main system.
内容的提问来源于stack exchange,提问作者Amir Tvs
相关产品推荐
相关产品推荐

