Xcode真机运行报错:Failed to prepare the device for development解决方法

一、遇到的问题

        运行Xcode然后打包APP,结果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     Version 14.2 (14C18)

        IOS          16.4.1(a)

        最近手机自动升级了版本,造成Xcode不兼容,需要处理一下。

三、增加Xcode系统支持

          

进入 iOSDeviceSupport  项目(或者Github

下载你需要支持的系统文件

然后再启动台的「其他」文件夹打开终端,输入

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

 然后新建一个文件夹,例如我是16.4,我就新建一个16.4文件夹

 之后将解压好的内容全部粘贴进去。

然后重启Xcode。

如果还不行,请重启手机。

猜你喜欢

转载自blog.csdn.net/saperliu/article/details/130690977