解决真机调试Failed to prepare device for development.报错,Xcode 不能安装APP

  • 发表于
  • IOS

错误信息

Failed to prepare 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.

不能装APP,说版本不对。

解决

  1. Check /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/ for directory name 15.4 (your iOS version).
  2. If the directory is missing download support files for 15.4 (your iOS version) from github.com/filsv/iPhon… and place it in the above path.
  3. Restart Xcode.

检查/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/ 这里面是不是有IOS对应版本的文件夹, 如果没有,下载装进去!

下载地址:github.com/filsv/iPhon… 

或者地址(这个更全面):https://github.com/iGhibli/iOS-DeviceSupport/

重启Xcode,解决了!

还是无法解决?

如果你是IOS 16或更高系统,看这里《IOS 16下必须开启开发者模式才能真机

这个其实和免升级Xcode 解决 “Unsupported OS version”是相同的解决方法。