遇到的問題
運行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缺少 對應的ios版本庫
增加Xcode系統支持
下載你需要支持的系統文件 ,進入?iOSDeviceSupport項目(或者Github)
然后再啟動臺的「其他」文件夾打開終端,輸入
open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
然后新建一個文件夾,例如我是16.4,我就新建一個16.4文件夾
之后將解壓好的內容全部粘貼進去。
然后重啟Xcode。
如果還不行,請重啟手機。