跪拜 Guibai
← All articles
iOS

macOS 27 Xcode Traps: Phantom 'Not Paired' Error and Simulator Crash from App Translocation

By 90后晨仔 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

These two pitfalls waste hours because the visible error messages send developers toward re-pairing devices or reinstalling Xcode, when the actual fixes are a DDI source update and a quarantine attribute removal. On macOS 27, knowing these root causes turns a confusing failure into a five-minute repair.

Summary

On macOS 27, developers can run into two Xcode errors that point in the wrong direction. A real-device message saying the device must be paired persists even when pairing is fine, because the system's CoreDevice framework version 651.13.5 doesn't match the old DDI (CoreDevice-518.33) installed on the machine. The fix is to extract new DDI files from Xcode 27.1's XcodeSystemResources.pkg and run devicectl manage ddis update with flags that exclude the old sources.

Separately, the iOS Simulator crashes on launch with "Simulator cannot be opened" even after reinstalling Xcode. The crash log reveals AppTranslocation in the process path, a Gatekeeper mechanism that mounts quarantined apps to random read-only paths. Because Simulator.app relies on relative paths to find SimulatorKit.framework inside Xcode, the relocation breaks dyld lookup. Removing the com.apple.quarantine attribute on the top-level Xcode.app and Simulator.app fixes it.

The article also notes follow-up traps: cached preparation errors require quitting Xcode, and if the SDK doesn't support the device's iOS version, use the newer Xcode. For the simulator, a further issue is arm64-only runtimes with old fat libraries, solved by real-device debugging or adding arm64-simulator slices.

Takeaways
— A real-device 'must be paired' error on macOS 27 can occur even when pairing is intact; it results from a CoreDevice version (651.13.5) mismatching an old DDI (518.33).
— To confirm a DDI mismatch, run `xcrun devicectl list preferredDDI` and check for `contentIsCompatible: false` and `isUsable: false`.
— The fix is to expand Xcode 27.1's XcodeSystemResources.pkg, then run `xcrun devicectl manage ddis update --source-dir <new DDI path> --clean --no-include-coredevice --no-include-xcode --timeout 300`.
— A simulator crash with 'Simulator cannot be opened' is typically caused by App Translocation, not a broken Xcode install; the crash log shows `procPath` containing `AppTranslocation`.
— Check for quarantine attributes with `xattr -p com.apple.quarantine` on both `/Applications/Xcode.app` and the Simulator bundle; a `00c1` value confirms it.
— Remove the quarantine attributes from those top-level paths only, using `xattr -d com.apple.quarantine`; avoid recursively clearing the entire Xcode initially.
— If the simulator opens but an app fails to link, the likely cause is missing arm64-simulator slices in old fat libraries; use a real device or a Universal runtime with Rosetta.
Conclusions

Both failures trace to macOS-level state being out of sync with Xcode's expectations, while the error messages stay at a high level and never mention the real component versions.

App Translocation is a general hazard for any nested app that relies on relative path lookups to external frameworks, not just Simulator.app; clearing the quarantine attribute before first launch avoids it.

Running multiple Xcode versions on one machine invites DDI drift because system directories like /Library/Developer/DeveloperDiskImages are shared, so one Xcode's CoreDevice can end up paired with another's older DDI.

Concepts & terms
DDI
Developer Disk Image: a disk image that Xcode mounts on a physical iOS device to enable debugging services. It must match the installed CoreDevice framework version.
CoreDevice
The macOS framework that manages communication between a Mac and physical iOS devices; it includes tools like devicectl and controls device pairing and DDI installation.
App Translocation
A Gatekeeper security feature that runs quarantined apps from a randomized read-only path, which can break apps that rely on relative paths to resources outside their own bundle.
devicectl
A command-line tool in Xcode for managing devices and device services; used here to list and update DDIs.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗