Crash Investigation Workflow

Updated: 2026-07-07 15:48 ET · Audited: 2026-06-26

TL;DR: Ten-step workflow for turning a crash report into a documented root cause: capture context in the Azure DevOps bug, check MetroLog/logcat, query Sentry (sentry-cli issues list -p dotnet-maui, org air-line-pilots-association-eo), symbolicate iOS logs against uploaded dSYMs, then analyze, document, and prevent recurrence. Jump to Quick Reference Commands for the sentry-cli/adb one-liners; performance hangs belong in profiling instead.

When a crash is discovered during testing or reported by users, use this workflow to capture actionable diagnostics and document findings in Azure DevOps.

1. Capture Initial Context

Document the following in the Azure DevOps bug:

2. Check Application Logs

iOS MetroLog

Logs are stored in the app Documents directory and commonly shared as a zip export.

python3 -m zipfile -e crash-logs.zip /tmp/
grep -n "TIMESTAMP" /tmp/Log\ -\ YYYYMMDD.log
grep -i -A 20 -B 5 "exception\|crash\|fatal" /tmp/Log\ -\ YYYYMMDD.log

Look for: last logged action before crash, exception messages (if caught by .NET), stack traces, thread IDs, authentication state, network requests in flight.

If no exception is logged, suspect a native crash where the runtime terminated before .NET logging completed.

3. Query Sentry for Crash Reports

Prerequisites

# List unresolved issues
sentry-cli issues list --status unresolved --max-rows 30 -p dotnet-maui

# Search by date or platform
sentry-cli issues list --all --query "firstSeen:>2026-02-15" --max-rows 30 -p dotnet-maui
sentry-cli issues list --all --query "platform:cocoa" --max-rows 30 -p dotnet-maui

# Search by environment
sentry-cli issues list --all --query "environment:production" -p dotnet-maui
sentry-cli issues list --all --query "environment:testflight" -p dotnet-maui

If crash is found in Sentry

sentry-cli issues show <ISSUE_ID>

Review in Sentry Web UI: open Sentry project issues, navigate to Issues, open the matching crash issue, review stack trace, breadcrumbs, device data, and tags.

4. Capture Native Crash Logs

iOS crash logs

Option A: Device analytics logs

  1. On device: Settings > Privacy & Security > Analytics & Improvements
  2. Open Analytics Data and locate ALPADocs crash entries
  3. Match by timestamp
  4. Export with share action

Typical file formats: ALPADocs-YYYY-MM-DD-XXXXXX.ips, ALPADocs_YYYY-MM-DD_XXXXXX.crash

Option B: Xcode

  1. Open Xcode > Window > Devices and Simulators
  2. Select device or simulator
  3. Open View Device Logs, filter by process ALPADocs
  4. Export matching crash log

Option C: Console.app

  1. Open Console.app, select device, filter on process ALPADocs
  2. Export matching report

Android crash logs

Option A: logcat

adb devices
adb logcat -d > crash-logcat.txt
grep -i "exception\|fatal\|crash" crash-logcat.txt
grep "com.accella.alpa" crash-logcat.txt

Option B: Google Play Console

  1. Open Google Play Console, select app
  2. Quality > Android vitals > Crashes & ANRs
  3. Filter by version and date, open crash cluster details

5. Symbolicate iOS Crash Logs

# Check dSYM upload status
sentry-cli debug-files list --type dsym -p dotnet-maui
sentry-cli debug-files list --type dsym -p dotnet-maui | grep "5.0.8"

# Upload missing dSYMs
sentry-cli debug-files upload \
  --org air-line-pilots-association-eo \
  --project dotnet-maui \
  ALPAMobile/bin/Release/net10.0-ios/ios-arm64/ALPADocs.app.dSYM/

# Symbolicate locally (macOS)
xcrun atos -o ALPADocs.app.dSYM/Contents/Resources/DWARF/ALPADocs \
  -arch arm64 \
  -l <load_address> \
  <crash_address>

6. Analyze Crash

Common iOS crash types

Exception CodeMeaningCommon Causes
EXC_BAD_ACCESS (SIGSEGV)Memory access violationNull dereference, use-after-free, overflow
EXC_CRASH (SIGABRT)Abort signalUncaught exception, assertion failure
EXC_BAD_INSTRUCTION (SIGILL)Invalid instructionMemory corruption, invalid pointer
SIGBUSBus errorUnaligned memory access
WatchdogLaunch or terminate timeoutDeadlock, infinite loop on main thread

Common Android crash types

ExceptionMeaningCommon Causes
NullPointerExceptionNull referenceMissing null checks
OutOfMemoryErrorMemory exhaustedBitmap leaks, large allocations
ANRUI thread blocked >5sMain-thread work, deadlock
IllegalStateExceptionInvalid stateActivity or fragment lifecycle mismatch

Stack trace checklist

  1. Identify crash thread (often main thread)
  2. Confirm exception type and signal
  3. Find first app frame
  4. Inspect preceding frames
  5. Correlate with app lifecycle and user path

7. Document Findings in Azure DevOps

## Crash Analysis

### Crash Type
- Exception: [type]
- Signal: [signal]
- Thread: [main/background]

### Stack Trace
[paste symbolicated stack trace]

### Crash Location
- File: [file]
- Method: [method]
- Line: [line]

### Root Cause
[summary]

### Contributing Factors
- [factor]

### Sentry Link
[issue link]

8. CI and Automation Hooks

# Capture logs on iOS UI test failure
- name: Capture iOS Crash Logs on Failure
  if: failure()
  run: |
    xcrun simctl spawn booted log show --predicate 'process == "ALPADocs"' \
      --style syslog --last 5m > crash-logs.txt

# Query Sentry after failure
- name: Query Sentry for Recent Crashes
  if: failure()
  run: |
    sentry-cli issues list --query "firstSeen:>$(date -u -d '1 hour ago' +%Y-%m-%d)" \
      -p dotnet-maui --max-rows 10

# Existing dSYM upload in pipeline
- task: CmdLine@2
  displayName: Sentry-CLI Upload dSYM
  inputs:
    script: 'sentry-cli debug-files upload --auth-token $(SentryAuthToken) --org air-line-pilots-association-eo --project dotnet-maui ALPAMobile/bin/Release/net10.0-ios/ios-arm64/ALPADocs.app.dSYM/'

9. Reproduce and Verify

  1. Reproduce locally with the same path
  2. Add targeted debug logging around crash point
  3. Run with debugger attached
  4. Validate on matching device and OS version

10. Prevent Recurrence

  1. Add tests for crash scenario
  2. Add crash checks to automated test flow where possible
  3. Monitor Sentry for regressions
  4. Improve error handling and guard clauses

Quick Reference Commands

sentry-cli info
sentry-cli issues list --status unresolved --max-rows 20 -p dotnet-maui
sentry-cli issues list --all --query "firstSeen:>2026-02-20" -p dotnet-maui
sentry-cli debug-files list --type dsym -p dotnet-maui
adb logcat -d > crash.txt