androidperformanceadbandroid-anr-dialog

I removed traces.txt file and cannot generate again


Since my traces.txt file was too big, I wanted to remove it to make it from zero. I removed by rm traces.txt command. And now I am not able to see it again. I created it manually, but when I use cat traces.txt nothing happen because it is empty.

Here is the screenshot of the terminal. As you can see when I run the cat traces.txt nothing happens.

enter image description here

Currently I need that file to understand what causes ANR but I am not able to generate it.

Thanks in advance.


Solution

  • As stated here on google developers guide,

    Android stores trace information when it experiences an ANR. On older OS releases, there's a single /data/anr/traces.txt file on the device. On newer OS releases, there are multiple /data/anr/anr_* files.

    So I guess with your case as you have manually deleted the traces.txt file the only way to get it back is reproduce the ANR, probably after this the OS will generate a new traces.txt for you. Pull that file to some location on your computer via adb pull, then try reading it with an editor.

    Hope this helps :)