Skip to main content
Use this workflow to capture native crashes and main-thread hangs in an iOS app. Hang capture requires UIKit. Upload the matching dSYM to see source locations in stack frames. The app saves a local report when it crashes. At a later launch, your app calls replay to send the crash evidence to LogBrew. LogBrew does not send the raw Apple report.
Use LogBrew Swift 0.1.6 or later. Use native LogBrew CLI 0.1.24 or later for debug artifact upload.
Use project-scoped ingest configuration inside the app. Use an account login for artifact uploads and issue reads. A project artifact key can also upload from a build machine. Never include an account access token or an artifact key in the app.

Plan the capture boundary

Check when your app can replay each type of failure. Set the release value before the build. It must identify the app version and build. Use the same value in the SDK, the dSYM upload, and the issue filter. Do not attach user payloads, request bodies, or headers to crash metadata.

Add the crash product

First, set up SDK telemetry for your app. Replay uses that client and transport. Add the public SDK through Swift Package Manager.
Add the LogBrew product to send telemetry. Add LogBrewCrash only when the app explicitly enables native crash or hang capture. The capture integration supports iOS 15 or later. Keep one app-owned capture object because native fatal handlers are process-wide.

Configure one exact identity

Use the same project, release, environment, and service in runtime setup and artifact upload. LogBrew does not derive or replace these values.
Install the capture object on the main thread before you create the root UI. Create its parent directory first. Keep the storage directory app-owned and private. The capture object records Mach exceptions, signals, C++ exceptions, and Objective-C exceptions. The local report does not include memory contents, queue names, or console logs. The local crash report can contain sensitive app and device details. Keep it out of cloud backups and shared directories. LogBrew sends frame UUIDs, architectures, and offsets instead of the raw report. NativeCrashConfiguration has two optional limits: A value outside its range makes the configuration throw crash_invalid_configuration.

Enable hang capture

Hang capture is off when watchdog is nil. To enable it, replace the watchdog declaration above before you call install():
The threshold is in seconds, from 1 to 30. Hang capture also requires artifactIdentity. Without it, the configuration throws crash_invalid_configuration. Keep one crashCapture object for the life of the process. A second capture object cannot install. Its install() call throws crash_capture_owned. To change the threshold, use the new value at the next app launch. A recovered hang replays with crash.handled set to true. An ongoing hang left by process termination replays with crash.handled set to false. Both forms include numeric durationMs metadata. They keep the same artifact identity used by fatal crash frames. The watchdog pauses while the app is inactive or under a debugger. It also suppresses capture during serious thermal pressure. A short threshold can report normal main-thread work as hangs. Test the threshold with the build configuration that you ship. The handled state describes recovery. It does not mark the issue as solved. A handled hang still blocked the interface, so review it too.

Replay after launch

After capture installation, replay pending reports through your SDK client.
Your app must call replay. Hang recovery alone does not send an event. Call the same method after recovery or at the next launch. Replay processes valid reports oldest first and keeps their stable event IDs. A failed delivery leaves its report pending. Accepted delivery removes it. Replay discards reports that it cannot read and reports larger than maxReplayBytes. Check all three counts. A zero pending count alone does not prove delivery. Enable durable delivery before replay when a failed request must survive another restart. Do not call purge() during routine network or authentication recovery.

Upload the matching dSYM

Archive the app with debug information enabled. Keep the dSYM from the exact build that users run. Inspect its image UUIDs.
Validate the artifact locally before upload.
Repeat --expect-image-uuid for each required architecture. The command fails when the discovered UUID set differs from the expected set. Check account access. Then run the same command without --dry-run.
The upload command validates supported Apple objects and verifies every uploaded identity. It does not include local paths or filenames in API metadata. The JSON status shows the result: A build machine can upload with a project artifact key in LOGBREW_TOKEN instead of account access. Create the key as shown in Create an artifact key. That upload reports uploaded. Verify each identity later with account access:
status: "found" confirms the artifact. status: "missing" means that LogBrew has no artifact for that identity. Resolution matches the image UUID and the full artifact identity, not the source file name. A rebuild of the same source can have different UUIDs. Upload the exact dSYM bundle, not a whole build directory.

Verify hosted readback

Filter the issue list with the same runtime scope. This example selects unresolved issues. A resolved or archived issue does not appear.
The list response identifies the grouped issue. Read its detail to request hosted frame resolution.
To run these reads from a CI job or a coding agent without account sign-in, use a project read key. See Verify your setup. A matching artifact adds a symbolication object. This example shows selected fields from an issue with a resolved frame, not the complete response.

Read crash evidence

Each frame has its own status. The symbolication.status field uses the same values: Keep an unresolved frame unresolved in your notes. Do not report it as an empty stack. LogBrew resolves frames when you read the issue. A dSYM uploaded later can resolve frames of an earlier event. It cannot add frames that the event did not capture. An application frame narrows the code search, but it does not prove the cause. For breadcrumbs, the exception chain, and trace evidence, read the issue investigation:
In that response, a frame with source: "symbolicated" came from an uploaded artifact. A frame with source: "captured" is the location that the app sent. See Investigate an issue for the response fields. Keep the full project, release, environment, and service scope during every read. Do not broaden a failed lookup across projects.

Verify the production setup

Use an approved test failure in the deployed build. Never use a customer action as the trigger. Check each item in order and stop at the first failure:
  1. The runtime identity matches the uploaded artifact identity.
  2. A later launch replays one acknowledged event with zero discarded and zero pending reports.
  3. The scoped issue list returns the test issue with the expected handled state.
  4. The expected application frame resolves.
  5. A later clean launch does not add another occurrence.

Recover safely

For general issue investigation, use Investigate an issue with the API.