I am developing an application and it keeps crashes randomly. I finally catch the logcat when it crashes.
here are the lines I got
01-30 01:04:47.281 2856-2856/com.snappext:hascode_process I/System.out﹕ Done
01-30 01:05:02.617 2856-2861/com.snappext:hascode_process I/dalvikvm﹕ threadid=3: reacting to signal 3
01-30 01:05:02.640 2856-2861/com.snappext:hascode_process I/dalvikvm﹕ Wrote stack traces to '/data/anr/traces.txt'
01-30 01:05:39.304 2750-2752/com.snappext D/dalvikvm﹕ GC_CONCURRENT freed 830K, 14% free 11618K/13383K, paused 1ms+3ms
now I need to know how to read '/data/anr/traces.txt' I am using my Samsung S2 for testing
you can use this cmd
adb pull /data/anr/traces.txt
you will need to navigate to adb folder under android installation
You might try to do a adb shell "ls /data/anr"
which will list all the the trace files in that directory. Atleast on my device I don't have permission to list the /data
folder but I do for /data/anr
On my LG G3, despite the message saying it wrote to /data/anr/traces.txt
it would in fact keep several. Could be Xamarin/Mono I'm developing with doing this but the file I needed was actually /data/anr/traces_<PKG_NAME>.txt
where <PKG_NAME>
is the Android Package of the App but with each .
replaced with a _
(ex: com.my.project
-> com_my_project
).
It also kept other trace files, presumably for non-debugging apps, with the pattern traces00.txt
, traces01.txt
, ... traces10.txt
. In short there wasn't a 'normal' traces.txt
file in that folder, but many starting with 'traces' and ending in '.txt'
If you're using Windows:
cd
to SDK folder (see: Find SDK location from Android Studio)
cd c:/android-sdk
cd /Users/<user>/Library/Android/sdk
cd platform-tools
adb pull /data/anr/traces.txt
On step 4 you can get some errors:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With