Android Development: Use Windows CMD window to crawl Android phone log

Source: Internet
Author: User

Written in front of the crap

General Android developers will use Eclipse,android Studio to observe the log output, in fact, the background is to use ADB to print the log, here is how to let the log output to the cmd window, not eclipse,android studio, Testers can use this method to fetch logs to developers, and developers can use this method for emergencies when the eclipse's logcat is drawn.


Cmd crawl Android Logcat step

1, decompression adb_tool_windows.zip. Get three files:adb.exe ,AdbWinApi.dll ,AdbWinUsbApi.dll

2, the computer system to determine the level or the position. Right-click on "Computer" (WinXP called "My Computer") propertyon PC desktop,Win7 Popup interface:

3. Copy the extracted files to the specified folder:

3.1.Windows Xp/win7/vista System, the above 3 files are copied to the C:\Windows\ system System32 Directory

3.2. Copy the files to the C:\Windows\SysWOW64 directory If the system is a bit

4, verify that the adb file copy is correct or not. Shortcut key ctrl+r input cmd Enter, open cmd command line, enter adb enter , if No output :"adb" is not an internal or external command, nor is it a running program or batch. The output is the information in the figure below, then proceed to the next step, otherwise check the above steps. The following is the correct output :


5, install the mobile phone driver. can install and open the PC side pea pod or mobile phone assistant, using USB to connect the phone, remember to turn on the phone's usb Debugging features . The driver has been installed directly into the next step, after the installation drive is successful, it can be viewed in Device Manager :

6. Clear the extra Log. Phone USB connection do not disconnect, enter in cmd command line:

Enter execution,

7. Print Log. Phone USB connection do not disconnect, enter in cmd command line:

ADB logcat-v time > D:\Logfiles\log201508041508.txt
Enter the execution, open the need to crawl log app to do the appropriate operation, computer-side cmd window


PS : The D:\Logfiles\log201508041508.txt above is the file path of the output log, the log of the phone Will output in the background in that file, the person who prints the log can modify the path according to his or her computer. After the above command executes, the screen will be stuck on the current page, please do not repeatedly hit enter to execute .

8, End log print. Mobile app After the operation is complete, you do not need to crawl the Span style= "Font-family:times New Roman" >log at the current cmd command line window, using computer shortcuts ctrl+c end print, output log

Note: printing log to the same file multiple times will cause the previously printed log to be lost, if you need to print log more than once , replace log the file path.


Conclusion

The above is in the Windows platform, using the cmd command line, using the ADB logcat to crawl the log method introduced, I hope to be helpful to everyone.

Want to know more useful logcat commands, poke: http://blog.csdn.net/xiong_it/article/details/45197851.

Reprint Please specify the author xiong_it and the original link: http://blog.csdn.net/xiong_it/article/details/47278461, thank you!

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Android Development: Use Windows CMD window to crawl Android phone log

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.