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.
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.
Collecting Device Log
- 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.
- 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.
- 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.
- 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
- 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.