Analyze a .mxdiagnostic payload from MetricKit (production diagnostics)
analyzeMetricKitPayloadParse Apple MetricKit .mxdiagnostic payloads to aggregate crashes, hang hotspots, and exceptions from real-device builds, with clustered results and symbolication offsets.
Instructions
[mg.production] Parse Apple MetricKit .mxdiagnostic payloads from real-device TestFlight / App Store builds. Aggregates crashes (clustered by exception type / binary / top frame), hang hotspots (sorted by duration, with localized-string handling for hangDuration), CPU exceptions, and disk-write exceptions. Inputs: payloadPath (single file), payloadDir (aggregate across files), or payloadJson (raw). Each output entry includes the raw binaryUUID + offset for downstream dSYM symbolication. Returns 3 most-actionable sections + cross-tool chain hints (e.g. objc_release top frame -> findCycles, sqlite top frame -> analyzeHangs with main-thread-violation classifier). No symbolication in v1; that's a separate tool. Simulator does NOT generate MetricKit payloads (Apple-side limitation) — frame this as post-mortem analysis. New in v1.18.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| payloadPath | No | Absolute path to a single `.mxdiagnostic` file (the JSON Apple's MetricKit writes to the app's MetricKit directory on real-device builds). | |
| payloadDir | No | Absolute path to a directory containing one or more `.mxdiagnostic` files. The tool walks the dir non-recursively and aggregates findings across all payloads. | |
| payloadJson | No | Raw `.mxdiagnostic` JSON string. For in-memory callers and tests; if both `payloadPath` and `payloadJson` are provided, `payloadJson` wins. | |
| topN | No | Cap on `crashCluster[]` / `hangHotspots[]` / `cpuExceptions[]` / `diskWriteExceptions[]` length. Default 10. | |
| groupBy | No | Clustering key for `crashCluster[]`. `exception-type` groups by exceptionType + signal (catches mass-crash on the same OS-level fault). `binary` groups by the top frame's binary name (catches crashes localized to one dylib/framework). `top-frame` groups by binary + offset (the most granular). Default `exception-type`. | exception-type |