Getting a Debug Log
Learn how to capture detailed debug logs from your mobile app using the OneSignal SDK. This guide walks through enabling verbose logging, reproducing issues, and sharing logs for troubleshooting push notification issues across Android and iOS platforms.
Capturing a debug log is the most effective way to troubleshoot mobile SDK and push notification issues. This guide will help you generate debug logs for your iOS and Android app and share logs with our Support Team if needed.
Requirements
To capture a debug log, make sure you have:
- A device that can reproduce the issue
- Access to the app’s developer tools
- OneSignal Mobile SDK version 5.0.0 or higher
If you’re using an earlier SDK version, refer to Version 9.0 docs for instructions.
Step-by-step instructions
1. Enable verbose logging
Add the VERBOSE
log level call to your app before initializing the OneSignal SDK. This ensures detailed diagnostic information is captured for every OneSignal operation.
Set the log level before calling OneSignal.init
to ensure all SDK activity
is logged.
2. Reproduce the issue
With verbose logging enabled, reproduce the issue on a physical device or emulator connected to Android Studio or Xcode.
Reproduce the issue
3. Capture and Share the Logs
Once the issue is reproduced, review the logs to see if it helps diagnose the issue.
If you need assistance, copy-paste the entire log from start to end and send them to OneSignal Support as a .txt
file.
Include all relevant reproduction steps, screenshots, and other details.
Share the log
Platform-specific instructions
Android Studio
- Open the Run tab in the bottom panel. (If not visible, go to View > Tool Windows > Run)
- Run the app on a connected device or emulator.
- Reproduce the issue.
- Select all log output (
Ctrl + A
orCmd + A
) and copy it. - Paste it into a
.txt
file. - Send the file to OneSignal Support with steps to reproduce.
How to run the app in Android Studio.
Android Studio
- Open the Run tab in the bottom panel. (If not visible, go to View > Tool Windows > Run)
- Run the app on a connected device or emulator.
- Reproduce the issue.
- Select all log output (
Ctrl + A
orCmd + A
) and copy it. - Paste it into a
.txt
file. - Send the file to OneSignal Support with steps to reproduce.
How to run the app in Android Studio.
Xcode
Important: Crashes must occur while the device is not connected to your Mac. Plug it in after reproducing the crash.
- Open Window > Devices and Simulators in Xcode.
- Select your device and click Open Console.
- Filter by All Messages in the dropdown.
- Reproduce the issue.
- Select all output (
Cmd + A
) and copy (Cmd + C
). - Paste into a
.txt
file. - Send the file to OneSignal Support with steps to reproduce.
Example of the console for Xcode.