创建ag.sh文件
输入:
set -x TEMP_DIR=$(mktemp -d Leslie.Guan.XXXXXX) cd ${TEMP_DIR} wget https://github.com/ggreer/the_silver_searcher/archive/master.zip TAR_DIR=$(unzip *.zip) TAR_DIR=${TAR_DIR%%/*} TAR_DIR=${TAR_DIR##*:} cd ${TAR_DIR} apt-get install -y automake pkg-config libpcre3-dev zlib1g-dev liblzma-dev --force-yes ./build.sh && make install cd ../../ rm -rf ${TEMP_DIR} ag -V set +x
运行ag.sh。
grep -rn "ANR in\|ANRManager: Reason:\|ANRManager: Android time\|am_anr\|WATCHDOG KILLING SYSTEM PROCESS\| iowait\| Blocked\| held by thread\| waiting to lock" 高效的过滤命令,虽然grep很好用,文件超大的时候还是ag速度快 ag "ANR in|ANRManager: Reason:|ANRManager: Android time|am_anr|WATCHDOG KILLING SYSTEM PROCESS| iowait| Blocked| held by thread| waiting to lock"