如何用symbolicatecrash工具分析iOS Crash文件:
1、在桌面建立一個crash文件夾
1.Xcoe-Window-Organize找到Archives找到App-右擊-Show in Finder
2.複製.app和.app.dSYM到crash夾文件:右擊..xcarchive文件-顯示包內容
如圖:
複製好之後如圖:
2、首先找到symbolicatecrash工具存放的地址
1.打開終端輸入如下命令:
find /Applications/Xcode.app -name symbolicatecrash -type f
你會找到:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKitBase.framework/Versions/A/Resources/./symbolicatecrash
2.用命令將symbolicatecrash拷貝到桌面的crash文件夾裏面,與.app和.app.dSYM放一塊兒
cp /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKitBase.framework/Versions/A/Resources/symbolicatecrash /Users/angel/Desktop/crash
如圖:
3.將Crash文件也拷到當前文件夾裏面
如圖:
3、執行symbolicatecrash
1.打開終端用命令切換到桌面的crash目錄下:
cd /Users/你的電腦名稱/Desktop/crash
2.執行命令
./symbolicatecrash /Users/angelseahappiness/Desktop/crash/Control_2014-01-13-111838_Lynns-iPad3.crash /Users/angel/Desktop/crash/Control.app.dSYM > Control_symbol.crash
這時候終端有可能會出現:Error: "DEVELOPER_DIR" is not defined at ./symbolicatecrash line 60.
3.輸入命令:export DEVELOPER_DIR="/Applications/XCode.app/Contents/Developer"
4.再執行./symbolicatecrash /Users/angelseahappiness/Desktop/crash/Control_2014-01-13-111838_Lynns-iPad3.crash /Users/angel/Desktop/crash/Control.app.dSYM > Control_symbol.crash
這時候終端將會進行處理了
5.將終端完成之後,在crash文件夾裏面會多出一個文件Control_symbol.crash:這個就是最終的文件,能夠查看bug所在的
如圖:
app
補充:兩個終端命令:1.查找 —— find /Applications/Xcode.app -name symbolicatecrash -type f工具
2.拷貝 —— cp /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKitBase.framework/Versions/A/Resources/symbolicatecrash /Users/angel/Desktop/crash code