Skip to main content

How to Collect Logs

Collecting Crash Logs and Xcode Logs for iOS Applications

When debugging iOS application issues, both Crash Logs (from external sources like the App Store) and Xcode Logs are essential for diagnosing the root cause. Below is a guide on how to gather both types of logs.

1. Crash Logs (External Sources)

These are crash reports submitted by users through the App Store or other crash-reporting services like Firebase Crashlytics, Sentry, or Bugsnag.

A. Crash Logs via App Store (Apple's Crash Reporting)

  1. Accessing Crash Reports in App Store Connect:

    • Sign in to App Store Connect.
    • Navigate to "App Analytics".
    • Go to the "Crashes" section to see crash reports for your app.
    • You can filter crashes by version, device, OS, etc.
    • Download the crash logs for further analysis.
    • A detailed youtube video is here
  2. Crash Reports via Device (iTunes or Xcode):

    • If you have access to a user's device (e.g., via an enterprise deployment or after a user provides their crash logs), you can retrieve crash logs directly from the device.
    • Follow the instructions for Xcode Logs to fetch logs from a device and check for crash entries.

B. Crash Logs from Third-Party Services (e.g., Crashlytics, Sentry)

  1. Firebase Crashlytics:

    • Firebase provides real-time crash reports.
    • Sign in to Firebase Console.
    • Navigate to Crashlytics and select your app.
    • You can view detailed crash reports, including stack traces, device details, and the number of affected users.
    • Download or export the logs to analyze further.
  2. Sentry or Bugsnag:

    • Sign in to the respective service dashboard (e.g., Sentry or Bugsnag).
    • Select your app project.
    • Access crash reports, stack traces, and event logs.
    • Download logs for deeper analysis or share them directly with the development team.

2. Xcode Logs (Real-Time & Post-Crash)

A. Accessing Xcode Logs During App Run (Real-Time)

  1. Connect the Device to Xcode:

    • Plug the iOS device into your Mac using a USB cable.
    • Open Xcode and select the connected device from the top toolbar.
    • Run the app via Xcode to capture real-time logs in the Xcode console.
  2. View Logs in Xcode:

    • In the Xcode Console, real-time logs related to app events, errors, and warnings will appear.
    • Use filters or search to focus on specific log levels (e.g., Error or Crash).