1, the background

Sometimes we need to verify and analyze the Jira tickets proposed by Tester. Some tickets attach detailed information and have enough Log logs, while others have incomplete or even no information. At this time, we need to capture the Log by ourselves. This blog post describes how to Log a specific App from an Android device.

2. Operation steps

2.1 Viewing the Third-party App Package Name of the Android Device

2.2 Finding the specified App package name

For example, the package name of the product manager App I use is:

com.woshipm.news

2.3 Capture the Log of the specified package

The Mac I use, if Windows, uses the following command:

adb logcat | findstr com.woshipm.news
Copy the code

If you need to save logs, add a save path as follows:

adb logcat | grep com.woshipm.news > /Users/Ethan/Desktop/Error.txt
Copy the code

Press Ctrl+C to end the log output

3. Summary of commands

adb shell pm list packages -3
adb logcat | grep com.woshipm.news
adb logcat | findstr com.woshipm.news
Copy the code