如何无需Xcode删除Derived Data及Xcode 9.2升9.3故障解决
Hey there, let's work through your Xcode problems step by step!
You've got a few straightforward options here:
Option 1: Use Finder
- Open Finder, hold down the Option key, then click the
Gomenu in the top bar. - Select
Libraryfrom the dropdown (this only shows up when holding Option). - Navigate to
Developer > Xcode > DerivedData. - You can either delete the entire
DerivedDatafolder or just the subfolders inside it (each subfolder corresponds to a project's build data).
Option 2: Use Terminal
Open Terminal and run this command to wipe all Derived Data at once:
rm -rf ~/Library/Developer/Xcode/DerivedData/*
Note:
rm -rfis a powerful command—double-check the path before hitting enter to avoid deleting unintended files.
Let's break this down into parts to tackle each problem:
First: Fix App Store Update Error
Even with enough storage, App Store cache glitches often cause this. Try these steps:
- Open Terminal and run these commands to reset App Store processes:
killall -HUP StoreKitAgent killall AppStore - Quit the App Store completely, then reopen it and try the update again. If this still fails, we'll focus on the clean install route.
Next: Fix XIP File Won't Unzip
If the official XIP won't extract, here's what to do:
- Verify file integrity:
Run this command in Terminal to get the file's SHA256 hash (replace the path with your XIP file's location):
Compare this hash to the official SHA256 value listed on Apple's Xcode download page. If they don't match, the file is corrupted—re-download it.shasum -a 256 /Users/YourUsername/Downloads/Xcode_9.3.xip - Extract via Terminal:
If the file is intact, use Terminal to extract it (this often bypasses Finder-related issues):
If you get a permission error, try addingxip -x /Users/YourUsername/Downloads/Xcode_9.3.xipsudobefore the command (you'll need to enter your admin password):sudo xip -x /Users/YourUsername/Downloads/Xcode_9.3.xip
Finally: Remove All Xcode Residual Files
CleanMyMac3 spotted leftovers, but you can also manually delete these key folders to ensure a clean slate:
- Delete simulator data:
~/Library/Developer/CoreSimulator - Delete Xcode app support files:
~/Library/Application Support/com.apple.dt.Xcode - Delete Xcode cache:
~/Library/Caches/com.apple.dt.Xcode - Delete device logs:
~/Library/Logs/CoreSimulator
After deleting these, restart your Mac to clear any lingering processes. Then try re-extracting the XIP file or downloading Xcode from the App Store again.
内容的提问来源于stack exchange,提问作者Agung

