解决“The run destination iPhone is not valid for Running the scheme ‘Runner’.”错误

Xcode在真机上调试时,遇到这个错误。

Failed to prepare the device for development. This operation can fail if the version of the OS on the device is incompatible with the installed version of Xcode. You may also need to restart your Mac and device in order to correctly detect compatibility.

这是由于Xcode不支持当前设备的操作系统版本,应当更新Xcode至最新版本。在系统终端中运行以下代码来查看当前支持的版本:

open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport

如果不愿意更新Xcode的话,可以直接下载相关版本文件,解压至上面的目录中:https://github.com/JinjunHan/iOSDeviceSupport/tree/master/iOSDeviceSupport

然后重启Xcode。

留下评论

您的电子邮箱地址不会被公开。 必填项已用 * 标注