筆記: 舊版 Xcode 無法裝 app 到新版 iOS 的問題

2019092222:09

例如 Xcode 10.x 就無法將軟體裝到 iOS 13 進行測試/除錯

會出現類似警告訊息:
This iPhone XS Max is running iOS 13.0 (17A5492t), which may not be supported by this version of Xcode.

 

解決方式:
安裝最新的 Xcode
再從新版本的 Xcode 複製 Device Support 檔案 到 舊Xcode 中


開終端機
查看 Xcode 10.3 有哪些 Device Support

$ ls -l /Applications/Xcode10.3.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/
total 0
drwxrwxr-x  4 fire  admin  128  7 11 23:27 10.0
drwxrwxr-x  4 fire  admin  128  7 11 23:27 10.1
drwxrwxr-x  4 fire  admin  128  7 11 23:27 10.2
drwxrwxr-x  4 fire  admin  128  7 11 23:27 10.3
drwxrwxr-x  4 fire  admin  128  7 11 23:27 11.0
drwxrwxr-x  4 fire  admin  128  7 11 23:27 11.1
drwxrwxr-x  4 fire  admin  128  7 11 23:27 11.2
drwxrwxr-x  4 fire  admin  128  7 11 23:27 11.3
drwxrwxr-x  4 fire  admin  128  7 11 23:27 11.4
drwxrwxr-x  4 fire  admin  128  7 11 23:27 12.0
drwxrwxr-x  4 fire  admin  128  7 11 23:27 12.1
drwxrwxr-x  4 fire  admin  128  7 11 23:27 12.2
drwxrwxr-x  4 fire  admin  128  7 11 23:27 12.3
drwxrwxr-x  4 fire  admin  128  7 11 23:27 8.0
drwxrwxr-x  4 fire  admin  128  7 11 23:27 8.1
drwxrwxr-x  4 fire  admin  128  7 11 23:27 8.2
drwxrwxr-x  4 fire  admin  128  7 13 13:11 8.3
drwxrwxr-x  4 fire  admin  128  7 11 23:27 8.4
drwxrwxr-x  4 fire  admin  128  7 11 23:27 9.0
drwxrwxr-x  4 fire  admin  128  7 11 23:27 9.1
drwxrwxr-x  4 fire  admin  128  7 11 23:27 9.2
::
::

cp -r /Applications/Xcode11.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/13.0 \
    /Applications/Xcode10.3.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport

** 注意 /Applications/Xcode11.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/13.0 的最後面
不要加斜線


另外,有好心人整理好各版本 Device Support file
https://github.com/iGhibli/iOS-DeviceSupport/tree/master/DeviceSupport