1、新建一个logcat.sh文件
在桌面新建logcat.sh文件,写入一下内容:
#!/bin/bash
packageName=$1
pid=`adb shell ps | grep $packageName | awk '{print $2}'`
adb logcat | grep --color=auto $pid
2、Git Bash Here
在桌面Git Bash Here,

3、为logcat.sh添加可执行权限
打开Git Bash,输入命令行:
chmod +x logcat.sh
4、打印日志
命令行打印日志:
./logcat.sh + 包名
./logcat.sh com.example.zjf.qq_webrtc

网友评论