其實很簡單
其實很自然
收集 Crash 是應用開發必要的環節, 通過分析和修復 Crash 信息可以大大提高應用的穩定性而不會讓更多的用戶失望甚至刪除應用.
點擊 》》》》》》BugHD
進入官網,還是那套路,注冊賬號 - 瀏覽文檔 - 下載SDK - 創建項目 - 集成SDK
這個第三方的使用教程很友好,怎么集成,怎么使用都已提示,按照步驟來就行 = =
這是Crash報告界面
demo的項目設置界面
demo crash 消息通知設置
- 集成SDK之后,不管是手動下載SDK集成還是通過CocoaPods集成,順便說一句cocoapods上面的版本只有
pod 'KSCrash', '~> 1.7'
,而不是文檔里邊的1.8 【現在時間是17-01-19】 - 然后在 AppDelegate.m 中導入頭文件:
#import <KSCrash/KSCrashInstallationStandard.h>
- 然后在
application:didFinishLaunchingWithOptions:
方法中加入:
#ifdef DEBUG
//do sth.
#else
//do sth.
KSCrashInstallationStandard* installation = [KSCrashInstallationStandard sharedInstance];
installation.url = [NSURL URLWithString:@"https://collector.bughd.com/kscrash?key=你的General Key"];
[installation install];
[installation sendAllReportsWithCompletion:nil];
#endif
注意:
如果配置后收不到 crash ,請將didFinishLaunchingWithOptions
方法中配置的部分放到最后,避免與其他 SDK 有接口沖突;
KSCrash 不接收 Debug 模式下的崩潰信息;
因為使用的是第三方kscrash,所以Bughd上沒有顯示沒有激活,有crash產生后會自動激活。
-END-