How to generate Android device logs using ADB method? 

Description

In some instances, MDM support technicians might need the logs of the managed devices to understand the issue better and resolve the issues quickly.  If the issue at hand pertains to MDM App, the logs can be directly collected from the app as explained in this document. But if there is an issue at the device level, you need to generate ADB logs.

Steps

Follow the steps given below to generate ADB logs using Windows PC.

  1. On the managed device, open the Settings app.
  2. Navigate to About Phone -> Build Number. Click on it 6 to 7 times, upon which You are now a developer is shown.
  3. Now, navigate back to Settings -> Developer Options and select the option Enable USB debugging.
  4. Connect the device to a computer through USB.
  5. On the computer, download the ADB Zip file from this link and unzip its contents.
  6. Once the contents in makedeviceowner.zip are extracted, open makedeviceowner folder.
  7. Now, open Command Prompt in the expanded folder and execute the command adb devices, which will show you the connected devices.
  8. Then execute adb logcat > file.txt command. This will generate the ADB logs and the logs will be saved to the file.txt file.
  9. Reproduce the issue on the Android device and press Ctrl+C on the Terminal Window to stop debugging.
  10. You can now share the file.txt file to MDM Support team.

Follow the steps below to collect ADB logs on a Mac device:

  1. Download and install Android SDK on the Mac. Android SDK will launch automatically. Select and install Android Platform tools.
  2. Connect the Android device to your Mac through USB cable.
  3. Open a new Terminal, change the working directory to the path where Android SDK is installed by running the command cd [path where Android SDK resides]/platform-tools.
  4. Run the command ./adb kill-server
  5. Run the command ./adb devices to list the devices connected to your Mac. Note the device ID of the devices for which you need to collect the logs.
  6. Run ./adb logcat -v threadtime [device ID] > /tmp/android-debug.log. Enter the device ID obtained in the previous step in the place of Device ID.
  7. Reproduce the issue on the Android device and press Ctrl+C on the Terminal window to stop debugging.
  8. The debug data will be available in the android-debug.log file.
  9. You can now share the android-debug.log file to MDM Support team.
  10. Note: If you do not have access to collect the logs, run the command ./adb root before running the command ./adb logcat -v threadtime [device ID] > /tmp/android-debug.log