Use of the adb logcat command in Android NDK Development

Source: Internet
Author: User


LogCat is stored in a buffer called circular memory buffers.
Usually, you can use the logcat plug-in provided by eclipse to view logcat,
In fact, you can also use commands to export logcat so that you can view logcat in certain situations,
The following is a simple usage command:

adb logcat -d > logcat.txt



Refer to the materials searched on the Internet and the development practices you have developed some time ago,
(It is inevitable that there will be some superficial points in the preliminary exploration. You are welcome to give me some advice .)
The following describes how to use logcat in advanced mode:

[Adb] logcat [<option>]... [<filter-spec>]...


[Options] The command includes the following options:
-F <filename>-Specify the output log information to a file. The default value is stdout.

-G-Output the specified log buffer and exit after the output.

-N <count>-Set the maximum number of logs <count>. The default value is 4 and must be used with the-r option.

-R <kbytes>-Logs are output every time <kbytes>. The default value is 16 and must be used with the-f option.

-S-Set a filter. For example, specify '*: s '.

<Tag> indicates the log component, tag (or use *

-V <format>-Set the log printing format. <format> only one of the following options is supported:
These fields can control the output result by modifying the output format.

: Show priority/: show only process PID: show only priority/: show only process: thread and priority/: Show Original log information, no other metadata field: Show Date, call time, priority/: display all metadata fields and separate message content with blank lines

-C-Clear all logs and exit

-D-Get all logs and exit (not blocked)

-B <buffer>-Different ring buffers are requested.



-View the main buffer zone (default buffer zone)-view messages contained in wireless-view event-related messages

-B-Output logs to binary files (or output logs in binary format ).

Or cannot see, I am a split line -------------------------
III,
The following describes how to use a slightly complex logcat command:

-s file_a. file_b. *:S > logcat_local.txt

I personally think that commands that can be understood and skillfully used should be enough. Pai_^

Related Article

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.