Android log automatic filter

Source: Internet
Author: User

Android log automatic filter

When I leave eclipse during android development, will it be annoying to capture logs?

Is it even more annoying to capture logs of a process?

The general operation process is as follows:

Step 1

Adb shell

$ Ps

Then you can see a lot of processes and find the process you want. It is very painful to see the process id.

Step 2

$ Logcat-v time | grep pid


Figure saves time by writing a simple script that can run under the terminal of ubuntu or mac.

The content is as follows:

#! /Bin/bash # get pid of protectserviceps_grep_res =$ (adb shell ps | grep com. xxx. xxx) echo $ ps_grep_respid = $ (echo $ ps_grep_res | awk '{print $2}') echo "pid =" $ pid # print logcatadb logcat-v time | grep $ pid
Copy the preceding content to a text file. Rename the package name after grep to xx. sh and grant the execution permission.

Then you can happily capture logs on the command line.

The execution method is simple./xx. sh


It's too lazy. It's easy. No picture. No truth. Believe it or not. I believe it.


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.