1. InValid Device State

原因:同時(shí)安裝了Xcode7和Xcode8等多個(gè)版本,在交替使用的時(shí)候會(huì)出現(xiàn)上訴錯(cuò)誤提示。
解決:關(guān)閉所有Xcode版本和模擬器,重新選擇一個(gè)Xcode版本打開(kāi)選擇xcode版本的命令:sudo xcode-select -s /Applications/Xcode7.app
2. The operation couldn’t be completed (LaunchServicesError error 0)

原因:由于某些原因資源文件的加載方式發(fā)生變化,從而產(chǎn)生了編譯緩存的問(wèn)題
解決:執(zhí)行clean操作command +shift+k,清空編譯錯(cuò)誤數(shù)據(jù),然后再Build
3. Could not find Developer Disk Image
原因是當(dāng)前的xcode版本不支持真機(jī)的系統(tǒng),
解決1:更新xcode版本
解決2:下載對(duì)應(yīng)真機(jī)的系統(tǒng)配置包,將其拷貝到下面路徑下
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
4. App installation failed. This application’s application-identifier entitlement does not match that of the installed application. These values must match for an upgrade to be allowed

原因:更換了provision文件,iPhone上已經(jīng)裝了包標(biāo)識(shí)符一樣的 App
解決:刪掉手機(jī)上app,重新運(yùn)行
5. Could not launch “DDDecorate"

原因:未設(shè)置證書(shū)信任
解決:設(shè)置 -> 通用 -> 描述文件 -> “你的AppleID” 選擇信任
6. 報(bào)錯(cuò):The identity used to sign the executable is no longer valid

原因:證書(shū)失效了。
解決:證書(shū)失效了,去開(kāi)發(fā)者中心重新生成一個(gè)。
7. An App ID with Identifier ‘ XXXX' is not available. Please enter a different string.

原因:發(fā)生在真機(jī)運(yùn)行時(shí),Bundle Identifier重復(fù)
解決:修改Bundle Identifier后重新運(yùn)行
8. “(null)” is of a model that is not supported by this version of Xcode. Please use a different device.
原因:xcode連接真機(jī)失敗
解決:關(guān)閉Xcode,再重啟運(yùn)行
9. Verify the Developer App certificate for your account is trusted on your device. Open Settings on Xxxxxxxxx and navigate to General -> Device Management, then select your Developer App certificate to trust it.

原因:使用自己的開(kāi)發(fā)者賬號(hào)進(jìn)行真機(jī)測(cè)試時(shí),沒(méi)有設(shè)置證書(shū)信任
解決:打開(kāi)手機(jī)設(shè)置->通用->描述文件與設(shè)備管理,看到自己的開(kāi)發(fā)者賬號(hào),點(diǎn)擊選擇信任。
10. iPhone is busy:Processing symbols files Xcode will continue when iPhone is finished.

原因:Xcode正在處理符號(hào)文件,Xcode每次第一次連接真機(jī)新設(shè)備會(huì)進(jìn)行這步操作。
解決:不需要解決,只要等待Xcode處理結(jié)束。
11. PCH was compiled with module cache path '/Users/XXX/Library/Developer/Xcode/DerivedData/ModuleCache/2LXVKO3BWVSZF', but the path is currently'/Users/XXX/Library/Developer/Xcode/DerivedData/ModuleCache/2LXVKO3BWVSZF'

原因:預(yù)編譯頭文件Pch路徑出了問(wèn)題,可能是變更了文件的路徑
解決:復(fù)制報(bào)錯(cuò)的路徑例:/Users/XXX/Library/Developer/Xcode/DerivedData,刪除該文件下的文件即刪除編譯緩存,然后重新打開(kāi)項(xiàng)目運(yùn)行
12. Unable to capture view hierarchy.

原因:未知,可能是代碼中調(diào)用的某些第三方類庫(kù)使得ViewHierarchy不能使用
解決:這里提供一種可替代方案,使用第三方工具Reveal類顯示視圖層級(jí),可以搜一下用法