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