求助:Xcode 9.2及High Sierra下执行Product→Profile或⌘I时崩溃
Hey there, let’s dig into those Xcode crashing issues you’re dealing with—nothing’s more frustrating than hitting a wall when you’re trying to profile your app. Here’s a breakdown of targeted fixes for both your scenarios, starting with the most reliable go-to solutions:
First, Try These Universal Fixes
These work for almost any Xcode instability, so start here before moving to scenario-specific steps:
- Clear Derived Data: Corrupted build artifacts are the #1 culprit for weird Xcode crashes. Open Xcode, go to
Xcode > Preferences > Locations, click the arrow next to Derived Data to open the folder, then delete the entire folder for your project (or all folders if you want a full reset). Restart Xcode afterward. - Reset Xcode Preferences: Glitchy preferences can cause unexpected crashes. Quit Xcode, then run this in Terminal:
Restart your Mac, then launch Xcode again—it’ll rebuild fresh preferences.defaults delete com.apple.dt.Xcode - Update Xcode (if feasible): Xcode 9.2 is quite outdated. If your High Sierra system supports it, updating to a newer compatible version (like Xcode 10.3, which works with High Sierra) might squash the underlying bugs. Just double-check your project’s compatibility first.
Fixes for Xcode 9.2 Crashing on Product → Profile
If the universal steps don’t help, try these targeted fixes:
- Test with a Fresh Project: Open a brand new, empty iOS/macOS project and try accessing Product → Profile. If it doesn’t crash, your original project has corrupted files. Try re-importing your source files into a new Xcode project, or audit your build phases/run scripts for broken configurations.
- Remove Third-Party Plugins: Old Xcode plugins (like those from Alcatraz) often clash with older Xcode versions. Quit Xcode, then delete any plugins in this folder:
Restart Xcode and test again.~/Library/Application Support/Developer/Shared/Xcode/Plug-ins
Fixes for macOS High Sierra + Xcode Crashing on Profile/⌘I
High Sierra’s security and system changes can cause unique conflicts—try these:
- Check System Integrity Protection (SIP): Disabled SIP can break Xcode’s profiling tools. Run this in Terminal to check status:
If it says "disabled", enable it by restarting your Mac in Recovery Mode (hold ⌘R on startup), open Terminal, runcsrutil statuscsrutil enable, then restart normally. - Reinstall Command Line Tools: Outdated or corrupted tools can mess with profiling workflows. Run this in Terminal:
Follow the prompts to install, then restart Xcode.xcode-select --install - Update High Sierra: Make sure you’re running macOS High Sierra 10.13.6 (the final update for this OS). Apple released stability patches that fix compatibility issues with Xcode.
If none of these resolve the crash, grab a crash log for more clues: when Xcode crashes, open Console.app, navigate to User Reports, find the latest Xcode crash log, and look for the Thread 0 Crashed section—this will show specific error messages that can pinpoint the root cause (like a corrupted framework or incompatible extension).
内容的提问来源于stack exchange,提问作者Bob Bobster

