Topic
This article discusses how to capture logs for Android devices.
Environment
- NinjaOne Mobile Device Management (MDM)
- Android
Description
Android device logs help NinjaOne Support Technicians diagnose issues with NinjaOne Mobile Device Management (MDM). This article explains how to activate developer options on an Android device, take a bug report, and capture a live logcat session.
USB debugging may be deactivated by policy on managed devices. If you cannot activate developer options or USB debugging, contact your NinjaOne administrator before continuing.
Activate Developer Options
- Open Settings on the device. You can do this in one of two ways:
- Swipe up from the home screen to open the app drawer, then tap Settings.
- Swipe down from the notification area and tap the Settings icon in the notification panel.
- Tap About device, About my device, or Device info. The label varies by manufacturer.
- Locate Build number.
- Tap Build number seven times. The device will display a message confirming that developer mode is enabled.
Activate USB Debugging
- From Settings, tap System.
- Tap Developer options. If you do not see this option, tap Advanced first.
- Scroll to USB debugging and activate it.
- Connect the device to a computer via USB. When prompted, tap Allow to authorize USB debugging on the connected computer.
Take a Bug Report
Use one of the following methods to capture a bug report.
Method 1: From the Command Line (Preferred)
This method saves the bug report directly to your computer without any interaction on the device. With the device connected to your computer via USB and USB debugging active, run the following command, replacing the path with a valid location on your computer:
adb bugreport E:ReportsMyBugReportsMethod 2: From the Device
- Open Settings.
- Tap System.
- Tap Advanced, then tap Developer options.
- Scroll to Take bug report and tap it.
- When the bug report is ready, a notification will appear. From the notification, share the report to a preferred app or download it to a connected computer.
Capture a Live Logcat
- Connect the device to your computer via USB with USB debugging active.
-
Run the following command, replacing
path/filename.txtwith a valid path on your computer:adb logcat > path/filename.txt - Reproduce the issue you want to capture. Note the exact timestamp (to the second) when the issue occurs. If the timestamp is not recorded to the second (for example, 12:13:34), it may be difficult to locate the relevant log lines.
- Press Ctrl+C to stop logging. On a Mac, press Command+C.
- Retrieve the log file from the saved location and send it to NinjaOne Support.