What is MetrickitMetricKit is a tool introduced by Apple in iOS 13 that aggregates and analyzes reports on each device regarding exception and crash diagnostics as well as power and performance metrics. Why use MetricKit to collect crash logsCurrently, some open source frameworks on the market, such as KSCrash and PLCrashReport, cannot capture some crashes. For example, PLCrashReport cannot capture stack overflow crashes, SIGKILL, SIGQUIT and other signal crashes. KSCrash can only capture part of SIGKILL crashes. Metrickit flaws
The crash log of iOS14 will be called back once every 24 hours, which has low timeliness. After iOS15, the crash log will be returned after the next startup, but it has been verified that some will be called back immediately, while others will not, and the pattern is unpredictable. Start access1. Add MetricKit 2. Add MetricKit listeners if ( @ available ( iOS 14.0 , * )) { 3. The listener implements the MXMetricManagerSubscriber protocol method. The payloadDic contains the last crash log stack and information of this application. // If Apple has data, it will call back after registering the monitor 4. Log assembly key code examples NSArray * callStackRootFrames = [ dicFrame ArrayValueForKey : kMetrkitCallStackRootFramesKey ]; MetricKit return fields meaning and detailsJSON overall format crashDiagnostics DetailsEach crash is a dictionary with the following contents: diagnosticMetaData dictionary details| terminationReason | String | Crash reason | RBSTerminateContext domain : 10 code : 0x8BADF00D callStackTree dictionary detailscallStacks array detailsThe elements in the array are dictionaries, as follows callStackRootFrames array detailsThe elements in the array are dictionaries, as follows diskWriteExceptionDiagnostics DetailsEach crash is a dictionary with the following contents: diagnosticMetaData dictionary detailscallStackTree dictionary detailscallStacks array detailsThe elements in the array are dictionaries, as follows callStackRootFrames array detailsThe elements in the array are dictionaries, as follows cpuExceptionDiagnostics DetailsEach crash is a dictionary with the following contents: diagnosticMetaData dictionary detailscallStackTree dictionary detailscallStacks array detailsThe elements in the array are dictionaries, as follows callStackRootFrames array detailsThe elements in the array are dictionaries, as follows hangDiagnostics DetailsdiagnosticMetaData dictionary detailscallStackTree dictionary detailscallStacks array detailscallStackRootFrames array details |
<<: Let's talk about phantom types in Swift
>>: Apple discontinues iPod Touch, ending 20-year iPod legend
Tik Tok has started to associate videos and produ...
Google's technology is one of the main drivin...
In recent years Not only are mobile phones becomi...
It’s time to share with you our nearly 10 years o...
Before talking about how to improve the weight of...
It is said that "Summer's life is given ...
Choice is greater than effort? No comment. I don’...
In addition to the official website, theme park a...
In the summer of 1973, 37-year-old Korean man Lee...
Many people have had this experience: wearing gla...
The user life cycle of each product is a process ...
June is really a month that makes operations copy...
Market research company Canalys today released a ...
Eight years ago, mobile fingerprint recognition w...
Recently, affected by the discharge of nuclear co...