How to check Batch logs on Android?

Follow this guide to see what Batch SDK is reporting and get more information on the Batch integration in your app.

It is possible to view the Batch SDK logs for a given device. This allows you to:

  • Easily retrieve your installation ID and your token

  • Test that direct opens are detected by Batch

  • Check if the SDK or the app is reporting errors

Prerequisite

To access the logs of a device, you need:

  • The 'Developer Options' menu on your device to be enabled (activation mode depending on the device model) ;

  • The device to be connected to the computer ;

  • The USB debug mode is to be enabled from the phone settings. To do this, go to Developer options > USB Debugging.

The image shows two Android smartphone screens demonstrating how to enable USB debugging in Developer Options. 	•	The left screen displays the System settings menu, where the user has selected “Developer options” (highlighted with a red rectangle). 	•	The right screen shows the Developer options menu, where “USB debugging” is toggled on (also highlighted with a red rectangle), indicating that USB debugging is enabled for development purposes.

You also need to install adb via Homebrew:

  • Install Homebrew:

You can follow the steps described on their website.

  • Install Android tools:

brew install homebrew/cask/android-platform-tools

Commands

Display Batch logs

Go to the computer terminal. Type the following line to watch the logcat:

adb logcat |grep Batch

This will allow ADB to output the logs from the SDK to the computer terminal, allowing you to see your installation ID and your push token when you start the app:

An ADB logcat output filtered for "Batch" messages, showing an "Installation ID" and a "Push - Registration ID/Push Token (FCM-Token)".

Get more detailed logs

You can also switch to verbose mode:

adb shell setprop log.tag.BatchInternal VERBOSE

You will then need to restart the app. This will allow you to see advanced logs, like the display of an In-App message, etc.

Testing your integration

You can follow this guide to test your integration and check what the SDK is logging at the same time.

Last updated

Was this helpful?