How to use ADB logcat to view output logs for a process

Source: Internet
Author: User

ADB logcat default is not this feature, I implemented a small bash function, added to your $HOME/.BASHRC file:

# 作用:能够通过进程名显示log# 用法:alogcat com.android.calendar or alogcat calendar# 当监控的进程异常退出时,需要重新运行此命令function alogcat() {    OUT=$(adb shell ps | grep -i $1 | awk ‘{print $2}‘)    OUT=$(echo $OUT | sed ‘s/[[:blank:]]\+/\|/g‘)    # 当进程异常退出,log是通过 AndroidRuntime 输出的    adb logcat -v time  |grep -E "$OUT|AndroidRuntime"}

Call Method:

alogcat email

Email is replaced with your packagename, full name or part can be

How to use ADB logcat to view output logs for a process

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.