Android Filter by package name Logcat

Source: Internet
Author: User

1#!/bin/Bash2 3 if[[!-N $1]]; Then4                 Cat<<EOF5Usage: 'basename$0' <packagename>6 EOF7Exit18 fi One  Apackage_name=$1 -ip=110.1.1.19:5555 -pid_list=$ (adb-s $ip ShellPS|grep$package _name) the if[[-N $pid _list]]; Then -#FindPidgrepLogcat with PID (s) -#convert toEgrepformat -pid_list=$ (Echo$pid _list|awk '{print $}'|sed-R"s# (. *) #\\\ (\[\ \]*\1\\\) #g"|TR '\ n' '|') +#strip the Last '|' -pid_list=${pid_list::-1} +#adb Logcat |grep--color-e"$pid _list"|grep-ve"MediaPlayer" AAdb-s $ip Logcat *:D |grep--color-e"$pid _list" at fi

How to use: Parameters follow the package name, while the script inside the IP this variable is changed

Android Filter by package name Logcat

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.