您的位置:首页 > 其它

手机无线连接电脑、抓取日志、日志检索命令

2017-11-01 14:10 267 查看
1. 手机无线连接电脑

adb tcpip 5555

adb connect 192.168.100.114:5555

2. 日志抓取

1)  adb logcat -v time -s xxx *:d > d:log.txt

     打印出标签带"xxx"的debug日志到log.txt

2) adb logcat - v time | findstr "xxx" > d:log.txt

    只将带"xxx"的信息打印出来

   

3) adb logcat -v time -f /sdcard/log.txt     (手机通过usb线连着电脑抓取)

    adb logcat -v time -f /sdcard/log.txt &  (后台抓log:即手机和电脑断开连接时,也能抓取)

   

4) 后台抓取log断开:

     搜索logcat_pid,

     adb shell kill -9 logcat_pid

3. 日志检索与定位:

1) 检索:

cat xxxx.log | grep -a -n -5 'xxxx'

2) 定位:

cat xxxx | tail -n +1897796 | head -n 500
sed -n '9839599,9839799p' xxxx.log
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: