最新Android手机导出ANR、tombstones文件 - 无惧Permission denied

转载自:https://cloud.tencent.com/developer/article/1545585

 

1. root手机导出

这个没什么可说的,adb pull就行,提示权限不够的话,adb root.

down下来某个文件:

adb pull /data/anr/traces.txt

down下来整个文件夹

adb pull /data/anr

2. 新版本手机

新版本手机有的可以进入/data/anr, 有的没有权限进入,但不管能不能进入,都没有权限

~ ❯❯❯ adb shell
raphael:/ $ cd /data/anr
raphael:/data/anr $ ls
anr_2019-11-26-17-55-57-277 dumptrace_9p35of trace_00
raphael:/data/anr $ cat trace_00
cat: trace_00: Permission denied

然后就会提醒你Permission denied.

导出tombstone文件也会一样遇到类似问题

~ ❯❯❯ adb shell
raphael:/ $ cd /data/tombstones
raphael:/data/tombstones $ ls
ls: .: Permission denied
1|raphael:/data/tombstones $

在新版本中,adb提供bugreport命令来解决这个问题。

~ ❯❯❯ adb bugreport
等待了大概5分钟~~~
~ ❯❯❯ ls -al | grep bugreport
-rw-r--r--@   1 along   staff  11543365 Nov 26 18:05 bugreport-raphael-QKQ1.190716.003-2019-11-26-18-03-25.zip

在FS/data下分别有anr和tombstones文件夹,里面便是对应文件。

posted on 2021-01-27 16:09  albert1017  阅读(876)  评论(0编辑  收藏  举报

导航