Hilal
Hilal

Reputation: 952

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.

Upvotes: 1

Views: 1532

Answers (2)

Mangesh Pawar
Mangesh Pawar

Reputation: 309

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 :)

Upvotes: 1

Hilal
Hilal

Reputation: 952

After I uninstalled and installed the application, the file is created again. I do not know the exact reason yet, however now I can view the traces.txt file.

Upvotes: 0

Related Questions