Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: How to obtain data/anr/traces.txt from Samsung Galaxy Tab?

Tags:

My application gives an anr while debugging on my Samsung Galaxy Tab. The device is viewable in DDMS in Eclipse, and I can browse the sdcard with the DDMS file explorer. But I cannot browse into the data directory (when I click the drop down arrow next to this directory, it appears the directory is open). Any tips how I can obtain the file?

like image 363
ab11 Avatar asked Mar 15 '11 18:03

ab11


People also ask

How do I read ANR logs?

A good way to try to detect the problem is by fetching the file /data/anr/traces. txt which is generated after a ANR happens on a device (beware that it is overridden after another ANR happens). That offers you a overview of what each thread was doing at the time of the ANR.

How do you analyze ANR traces?

Using traces file:After ANR is recreated pull the traces file via adb pull /data/anr/traces. txt command. In the above example the main thread is held by SampleHandlerThread and SampleHandlerThread is held by the main thread causing a Deadlock.

Where can I find ANR?

ANR data is available in Play Console only. You'll see all ANRs collected from Android devices whose users have opted in to automatically share usage and diagnostics data. Data is available for the previous two months. For more information about how Android users opt in to share data, go to the Accounts Help Center.

How do you resolve ANR?

How to prevent an ANR? Stop doing heavy tasks on the main thread. Instead use worker threads such as IntentService, AsyncTask Handler, or another Thread simply.


1 Answers

You can fetch the file using the following command:

adb pull /data/anr/traces.txt

Hope this helps, Francisco.

like image 151
Francisco Jordano Avatar answered Sep 27 '22 22:09

Francisco Jordano