# 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. 1. On your Windows Computer, download and [Install](https://developer.android.com/studio/?hl=i) Android SDK.
2. Once the installation completes, Android SDK will launch automatically. Select and Install Android Platform Tools.
3. Connect your Android device to your Windows PC via USB cable.
4. Open a new command prompt session with administrator privileges, change the working directory to the path where Android SDK is installed (cd \[path where Android SDK resides\]/platform-tools).
5. First, run the following command
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
     adb.exe kill-server
    
       1
    
    
    
       adb.exe kill-server
6. Next, run the command to list the devices connected to your PC. Note down the device id of your device.

adb.exe devices

   1

  adb.exe devices

   

 

 8. Run,
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    adb.exe logcat -v threadtime \[device id\] > C:\\android-debug.log
    
       1
    
    
    
      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\].
9. Perform any actions on your Android device.
10. To stop the adb process, press **Ctrl + C** on the command prompt window.
11. 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](https://developer.android.com/studio/?hl=i) 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
    
       1
    
    
    
       ./adb kill-server
5. Next, run the command to list the devices connected to your PC. Note down the device id of your device.

./adb devices

   1

  ./adb devices

   

 

 7. Run,
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    ./adb logcat -v threadtime \[device ID\] > /tmp/android-debug.log
    
       1
    
    
    
      ./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.