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
No need to drink from Heshuo, just brew tea and f...
Following the popularity of the chicken-eating ga...
In the past, whenever an account performed poorly...
How much does it cost to recruit investors for th...
After developing e-commerce mini programs, many b...
According to CNBC, a new consumer survey shows th...
In 2010, the tablet computer was born under the c...
During the epidemic, go home only if you can. Tod...
When talking about user growth, we often talk abo...
WeChat Mini Store is a new SaaS quick store build...
I don’t know if you guys have this feeling: the m...
In the article "Re-cognition of Manufacturin...
"Smoking is harmful to health" has beco...
According to our data monitoring of the mobile ap...
Recently, iFixit, a well-known foreign repair org...