Windows computer uses adb command to view mobile App log

Project Scenario and Problem Description

When testing the newly developed App on the mobile phone, if the development is not abnormally saved, you can use the adb command to view log information such as App startup.


solution

1. Windows download and install adb

Google download adb, the path is as follows:

Windows version,
Mac version ,
Linux version
After downloading, extract it to a custom installation directory.
You can check the version information through the command prompt command adb --versionto see if the installation is successful
(configure environment variables according to the situation, and add the custom path ...\adb\platform-tools to environment variable)

2. Use the adb command to view the App log

(1) Output the log to the specified directory of the mobile phone

First, the specified directory must exist, such as /Android/xxxApp/log/
If you need to save the log as a.txt, the command is as follows:

adb logcat -f /Android/xxxApp/log/a.txt

(2) Output the log to the specified directory of the computer

Take outputting the log a.txt to the xxxApp directory of the D disk as an example, the command is as follows

adb logcat >D:\test\1.txt

(3) End log capture

ctrl + cThat's it.


reference:

Windows download and install adb (extremely simple)
adb command to view the log of the app

Guess you like

Origin blog.csdn.net/qq_39691492/article/details/128727919