1、背景
有时候要去验证分析Tester提的Jira Ticket,有的Ticket附加的信息很详细,有足够的Log日志,有的却信息不全甚至没有,这时候就需要自己去抓Log。这次的博客记录一下如何从Android设备抓取指定App的Log.
2、操作步骤
2.1 查看Android设备第三方App包名
2.2 找到指定App包名
例如,我使用的产品经理App的包名是:
com.woshipm.news
2.3 抓取指定package的Log
我使用的Mac,如果是Windows的话,使用如下命令:
adb logcat | findstr com.woshipm.news
如果需要保存日志的话,记得添加保存路径,命令如下:
adb logcat | grep com.woshipm.news > /Users/Ethan/Desktop/Error.txt
使用Ctrl+C结束日志输出
3、命令行汇总
adb shell pm list packages -3
adb logcat | grep com.woshipm.news
adb logcat | findstr com.woshipm.news