今天真機調試的時候出現了這個錯誤,如下圖
Mou icon
這一次碰到的問題是這樣的:模擬器上運行正常。我在iPhone 6上運行,程序編譯正常,但是跑起來之后,大概一兩秒的時間,就閃退(代碼是沒有問題的)。這個時候,Xcode7.1彈出這樣的提示:
Could not launch “iOSStrongDemo”
process launch failed: failed to get the task for process 1298
錯誤分析:
是因為我之前打包的時候,修改了Provisioning Profile。我看了一下Build Settings里的Code Signing配置,發現Provisioning Profile選擇的是XC Ad Hoc: *。如下圖所示:
Mou icon
Ad Hoc是用來實現發布前的用戶測試的,也就是通過Ad Hoc將未發布的App給其他人提前使用。顯然這是不對的,我們是要真機調試。
解決方案:
解決方法很簡單,將Provisioning Profile換成用開發證書創建的Provisioning Profile即可。