how to access android files /data/anr/traces.txt a

2019-01-30 05:05发布

This question already has an answer here:

I am writing an application for reporting crashes and the relevant logs. So from my application I am trying to access traces.txt and tombstones, but I am getting an error:

03-25 09:48:46.220 W/System.err(10250): java.io.FileNotFoundException: /data/tombstone/tombstone_00 (Permission denied)

I am able to access traces.txt, but not tombstones.

8条回答
Lonely孤独者°
2楼-- · 2019-01-30 05:44

This did it for me: adb pull "/data/anr/traces.txt"

查看更多
倾城 Initia
3楼-- · 2019-01-30 05:45

Note: This only works with android emulators and rooted android devices.

You can first check if the file is created or not. You can do this by going in

DDMS -> File Explorer -> data -> data -> (Your Package) -> files -> (Your File)

DDMS is on right top corner of your eclipse. If the file is not present in the above mentioned path then it is not created properly but if it is still there change the path your file accordingly while accessing it eg. /data/data/(Your Package)/traces.txt

You can also pull that traces.txt file onto your desktop. Pull option is given on top bar below DDMS.

查看更多
登录 后发表回答