Collecting Logs from Android Devices

ADB Logs:

ADB (Android Debug Bridge) is a command line tool for interacting with Android phones on your computer. ADB lets you manually sideload apps, uninstall apps, see logs, pull and push files, backup your device, and perform some other useful actions.
The traditional way of getting ADB involves installing the Android SDK and following a tedious setup procedure. However, for convenience, we've obtained ADB and its components in a small, easy-to-install package. Download the ADB Installer Here.
Note:  There are some issues with USB 3.0 ports, and ADB might not work properly, so use USB 2.0 if possible.

  1. Run the installer with Admin rights
  2. Press Y/Yes to install ADB and Fastboot
  3. Press Y/Yes to install ADB system-wide
  4. Press Y/Yes to install Drivers
  5. Continue Driver installation – Windows will prompt for confirmation to install these drivers
  6. Finished
  7. Reboot

It is also recommended to verify that the specific drivers for your device are installed. Windows sometimes is able to get them automatically; otherwise you will have to download them from the manufacturer's website.
ADB should now be installed in C:\ADB.

 

Enable USB debugging on your device

USB debugging needs to be enabled on the device in order to enable ADB features. In order to enable USB debuggining, you may do the following:

  • The "Secure Debugging" feature requires that you manually approve your computer for an ADB connection. Developer Options are hidden.
  • To enable Developer Options, navigate to Settings > About Phone.
  • Tap Build Number 7 times. You will see a toast message stating you are now a developer.
    1
  • Go back to main Settings menu and find the sub-setting called Developer Options.
  • Navigate to Developer Options, then check USB Debugging.
    2

 

Getting Started with ADB

  1. Connect your device to your PC via a USB port
  2. Accept the prompt to trust the computer on the device
  3. To confirm that all necessary drivers have been installed and that USB Debugging has been successfully enabled, run adb devices on the CMD prompt and confirm that the device shows up (list is not empty).
  4. If the device does not appear, you are likely missing device drivers. To find all necessary device drivers on your PC, open a web browser and search (via Google, Yahoo, etc.) for adb drivers for device X. Download and install the drivers on your local PC with admin rights.
  5. Check that adb devices is pulling up the device in question. If the devices shows up as unauthorized, unplug the device, plug back in, and accept the prompt to trust the PC.

 

How to gather logs using Logcat

You can use logcat from an ADB shell to view the log messages. The Android logging system provides a mechanism for collecting and viewing system debug output, which then can be viewed and filtered by the logcat command.

Use the below command:
adb logcat *:#

Where # stands for one of the following:
V    Verbose (show all possibly useless logs, default level
D    Debug (show all reasonable debug logs)
I    Info (show expected logs for regular usage)
W    Warn (show possible issues that are not yet errors)
E    Error (show issues that have caused errors)
F    Fatal (show issues that are fatal to runtime and will often result in rebooting)

  1. ADB will start collecting logs and start writing them to a text file.
  2. Start replicating the behavior and once you have replicated the issue, type CTRL+C to stop capturing logs
  3. Navigate to c:/adb/on your file explorer. The file "txt" will now contain the logs.

 

Bug Report

These are the debug level device logs which would contain device logging for a limited period of time prior to when this report is generated. It will also contain other dumpstate information including device’s system info, apps, services running, network connections etc.

To collect the bug report:

  1. Navigate to device settings and enable Developer Options (see section for ADB logs)
  2. Navigate to Developer Options and tap on Take/Submit Bug Report
  3. Select Full Report when prompted to get the full device info along with the logs
  4. The bug report takes up to 2 minutes to be generated

Once generated, you will see a device notification example: Bugreport #1 captured

 

AirWatch Agent logs

MDM-specific logs can be collected directly from the AirWatch Agent on an Android device. These can be sent to the Workspace ONE UEM Console for analysis by an administrator. However, these logs are not fully verbose and will only show the logging from Workspace ONE applications rather than the entire device. Nevertheless, they are useful for an initial look at where a particular issue may lie. Follow the steps below to gather these logs and send them to the Workspace ONE UEM Console.

  1. Logs will be gathered in real time on the device. As such, you will first want to reproduce the specific intended behavior in order to have relevant logs. As soon as the behavior has been reproduced, move on to the next steps.
  2. Open the AirWatch Agent and navigate to the Agent settings menu.
  3. Choose Send Debug Log.

    3     4

    Note: The logs will be sent to the Workspace ONE UEM Console. Navigate to Device Details > More > Attachments > Documents for the device in question. All debug logs that have been sent to the console will be available for download.

 

Request Device Log Remotely

Workspace ONE UEM Admins can request logs from devices by sending a “Request Device Log” command from the Workspace ONE UEM Console. In almost all cases, these logs are limited to the log output of the Workspace ONE UEM Hub and are EMM-specific. With Android (Legacy) devices from OEMs that utilize our generic Platform OEM Service, admins can elect to collect full logs from all processes on the device.  From specific devices and EMM-specific logs can be collected directly from the Workspace ONE Intelligent Hub on an Android device. These can be sent to the Workspace ONE Console for analysis by an administrator. However, these logs are not fully verbose and will only show the logging from Workspace ONE applications rather than the entire device. Nevertheless, they are useful for an initial look at where a particular issue may lie. Follow the steps below to gather these logs and send them to the Workspace ONE UEM Console. 

  1. Logs will be gathered in real time on the device. As such, you will first want to reproduce the specific intended behavior in order to have relevant logs. As soon as the behavior has been reproduced, move on to the next steps.
  2. Open the Intelligent Hub and navigate to the Hub settings menu.
  3. Choose Send Debug Log.
    5
  4. The logs will be sent to the Workspace ONE UEM Console. Navigate to Device Details > More > Attachments > Documents for the device in question. All debug logs that have been sent to the console will be available for download.
    mceclip7.png

 

Hub Wipe Logs

This is strictly for when a device has been unenrolled and contains the reason for unenrollment. This is collected directly from the Hub’s Welcome screen. The steps to collect wipe logs are as follows:

  1. Tap on the Hub icon on the Welcome screen of the Intelligent Hub app 5 times
  2. Next, on the Share logs screen, select Share or Copy
    7
  3. If you select Copy, the log file will be stored locally on the device at the location data/com.airwatch.androidagent/files/logs

 

Dumpstate Logs

Most carriers have a dialer code that can be entered on non-tablet devices to bring up a System Dump menu. From here, verbose device logs and information can be obtained for periods of time prior to the command being run, similar to bug report. However, note that Verizon devices do not have this menu available. Follow the steps below to utilize this logging.

  1. Type *#9900# in the Phone/dialer application
  2. Press button ENABLE SECLOG(CURRENTLY DISABLED)
  3. Reboot device.
  4. Reproduce the issue.
  5. Soon after the reproduction, type *#9900# in the Phone application
  6. Select RUN DUMPSTATE/LOGCAT
  7. Select COPY TO SDCARD(INCLUDE CP RAMDUMP).
  8. When this successfully completes, you will see a message indicating success.
    7    8    9    10
  9. Connect your device to your PC, and browse to {Device} > Phone > log.
    12
  10. Select the most recent log file and open it into a text editor.
    12
Have more questions? Submit a request

0 Comments

Article is closed for comments.