Xcode真機調試
前期准備:Xcode7以上
Apple ID
步驟:
1:Xcode->Preference->Accounts添加你的Apple id
2:添加Apple ID后進行創建證書
點擊view details進行create
這里已經前期的配置已經完成。
3:打開系統的鑰匙串,查看我的證書,將名字填入Xcode中的bundle identifier, 並且Team 選擇自己的Apple ID
此時就可以運行了
點擊fix issue進行系統的自動配置。
過程中我出現的錯誤
1:
Could not find Developer Disk Image
原因:真機系統過高或者Xcode版本過低,我的情況是手機系統是9.3.2,Xcode版本是7.2.Xcode資源包里並沒有9.3.2所需的配置包
解決:進入工程所在的finder,command+shift+g進入配置包存在的目錄
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport將配置包添加上。
這里普及一下進入目錄的方法:
進入目錄的方法:
方法1:
打開一個finder
cmd+shift+g
輸入/System回車
方法2:
在finder圖標點右鍵
點擊“前往文件夾”
cmd+shift+g
輸入/System回車
方法3:
打開finder
打開“前往”菜單
點擊“前往文件夾”
cmd+shift+g
輸入/System回車
錯誤2:
iPhone is busy: Processing symbol files
原因:手機程序后台正在進行
解決:等待就可以
錯誤3:
No non–expired provisioning profiles were found.
原因:證書不可用,沒有添加唯一標識bundle identifier
解決:
訪問一下鑰匙串里我的證書,將名字復制到bundle identifier里面就可以啦,在這個過程中可能會出現:lanch.....failed這個錯誤。這里是由於真機中,通用--設備管理--信任開發者沒有進行勾選的原因