解决方法
- 删除目录:
rm -rf /Users/gechunxi/Library/Developer/Xcode/iOS\ DeviceSupport
提示:这个目录存放的是 Xcode 为不同 iOS 版本准备的本地 DeviceSupport/符号缓存,不是你的工程源码。删除后会在下次连接设备时由 Xcode 自动重新生成,因此可安全清理(代价是首次重新连接会多等一会儿)。
- 卸载并重装 Xcode
- 执行:
sudo installer -pkg /Applications/Xcode.app/Contents/Resources/Packages/XcodeSystemResources.pkg -target /
- 重新连接真机并运行,恢复正常。
参考链接
SOLVED: Previous preparation error: The developer disk image could not be mounted on this device.