Android Log Auto Filter

Source: Internet
Author: User

In the development process of Android, leaving Eclipse, will it be annoying to catch the log?

Is it more annoying if you just want to catch a log of a process?

The general operating procedure is this:

The first step

ADB shell

$ps

And see a whole bunch of processes find the process they want. It's painful to see the process ID, because there's a lot of progress.

Step Two

$ logcat-v Time | grep pid


Figure easy to write a simple script can be run on Ubuntu or Mac terminal

The contents are 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 $} ') echo "pid==" $pid #print logcatadb logcat-v Time | grep $pid
Copy the above content into one text modify the package name after grep to rename your package name to xx.sh and then give execute permission

And then you can happily crawl the logs at the command line.

The concrete way of execution is simple./xx.sh


It's too lazy to figure out the truth no matter whether you believe it or not, I believe it anyway.


Android Log Auto Filter

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.