1. Home
  2. Troubleshooting
  3. How to obtain Android device logs using Windows and Mac

How to obtain Android device logs using Windows and Mac

Using Windows

Notes:

  • Ensure that the Developer options is enabled on your Android device (Settings > About Device > Tap on Build Number 7 times and Developer Options will be visible in your Settings menu). Enable USB Debugging on your device (Developer Options > USB Debugging).
  • The device must not be locked and should be active.


Follow the steps below to obtain debug-logs from Android devices on your Windows PC.

On your Windows Computer, download and Install Android SDK.

  1. Once the installation completes, Android SDK will launch automatically. Select and Install Android Platform Tools.
  2. Connect your Android device to your Windows PC via USB cable.
  3. Open a new command prompt session, change the working directory to the path where Android SDK is installed (cd [path where Android SDK resides]/platform-tools).
  4. First, run the following command
     adb.exe kill-server
  5. Next, run the command to list the devices connected to your PC. Note down the device id of your device.
  6. adb.exe devices
  7. Run,
    adb.exe.logcat -v threadtime [device id] > C:\android-debug.log

    Enter the device id obtained in the previous step in place of [device id].

  8. Perform any actions on your Android device.
  9. To stop the adb process, press Ctrl + C on the command prompt window.
  10. The debug data can be viewed from c:\android-debug.log file.

In case your machine does not recognize your device, try the following:

  • Unplug and replug your device.
  • Enable Verify apps over USB option (Settings > System > Developer Options > Debugging).
  • Check if the device notification bar displays the message USB debugging connected.
  • Select Revoke USB debugging authorizations to revoke access to all computers you’ve previously authorized (Settings > System > Developer Options > Debugging).

Using Mac

Notes:

  • Ensure that the Developer options is enabled on your Android device (Settings > About Device > Tap on Build Number 7 times and Developer Options will be visible in your Settings menu). Enable USB Debugging on your device (Developer Options > USB Debugging).
  • The device must not be locked and should be active.


Follow the steps below to obtain debug-logs from Android devices on your Mac device.

On your Mac device, download and Install Android SDK.

  1. On your Mac device, download and install Android SDK. Once the installation completes, Android SDK will launch automatically. Select and Install Android Platform Tools.
  2. Connect your Android device to your Mac device via USB cable.
  3. Open a new Terminal, change the working directory to the path where Android SDK is installed (cd [path where Android SDK resides]/platform-tools).
  4. First, run the following command
     ./adb kill-server
  5. Next, run the command to list the devices connected to your PC. Note down the device id of your device.
  6. ./adb devices
  7. Run,
    ./adb logcat -v threadtime [device ID] > /tmp/android-debug.log

    Enter the device id obtained in the previous step in place of [device id].

  8. Perform any actions on your Android device or reproduce any issue you encountered.
  9. To stop the adb process, press Ctrl + C on the Terminal window.
  10. The debug data can be viewed from android-debug.log file.
  •  
  •  
  •  
  •  
  •  

Was this article helpful?

Related Articles

Leave a Comment