Gathering Android Logs Using ADB

Overview

ADB (Android Debug Bridge) is a command line tool provided by Google for your computer to interact with Android devices. Using ADB, you can collect device logs from your device.

 

Preparation

Installing ADB on Computer

First you have to install the ADB command line tool on your computer that you use to collect device logs. Download the SDK Platform Tools from Google Developers site that contains the ADB tool (adb.exe).

You may save the tool in any directory. It is recommended that you add the path to the adb.exe file to your system’s PATH environment variable for easy access to the tool.

Installing Required Drivers on Computer

If you are using Windows PC to collect device logs, you may need to install an additional ADB and/or USB driver depending on the device manufacturer. Please check with the manufacturer's Web site if there is an ADB and/or USB driver specific to their devices and install it on your PC if needed.

Enabling Developer Option on Device

On your Android device, navigate to Settings > About Device. Find the Build Number and tap seven times on it until a toast notification saying that Developer Mode has been enabled. Once it has shown up, navigate to Settings > Developer Options and enable USB Debugging.

 developer_options.png usb_debugging.png

 

Collecting Device Log

  1. Plug your Android device into your computer using a USB cable.

    If you are using Windows PC and skipped the steps described in "Installing ADB Driver on Computer" above, you may be prompted to install the ADB driver at this timing. Install the standard driver bundled with the SDK Platform Tools or a specific driver provided by the device manufacturer.

  2. Open a command prompt and use the ADB command "adb devices". If you have not added the directory for adb.exe to your system’s PATH variable, you will have to navigate to the directory of where you placed adb.exe in order to run this command.

    Your device should be listed next to the word “unauthorized”. If no devices appear, one or more of the previous requirements have not been met.

    console.png

  3. You will need to accept a prompt like the one below on your device. If it does not appear upon connecting the device to the PC on Step #1, disconnect and reconnect the device to get the prompt to appear.

    allow_usb_debugging.png 

  4. Run the following command to start logging (you may want to use another file name than "log.txt"):
    adb logcat -v time *:V > log.txt
  5. Once reproduction of the issue is complete on your Android device, press Ctrl + C (or control + C) to stop the logging.

 Now you will have the log file "log.txt" on the current folder/directory.

Other Languages: 日本語

Have more questions? Submit a request

0 Comments

Article is closed for comments.