Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get android application traces.txt file from android device [duplicate]

Tags:

android

I want to get the my application traces.txt file from the android device. I check lots of the link in the google, but still not get success. If any one have any idea, please help me. I also check the below link. how to access android files /data/anr/traces.txt and /data/tombstones/tombstones How to find this stack trace?

I am also trying this. adb -s 0123456789ABCDEF shell # <<< This will open a shell to your device

ps | grep com.package.name # This will list some info about the running         instance of your app
# Output should be something like: 
# u0_a7    18941 173   869348 26040 ffffffff 00000000 S    com.package.name
# Important is the PID (number in the second column), in this case 18941.

# Now send the SIGQUIT to your process, please change '18941' to your PID
run-as com.package.name kill -3 18941

# Now Android should have created the file /data/anr/traces.txt, check that:
ls -l /data/anr/traces.txt 
# Output should be something like
# -rw-rw-rw- system   system     325391 2014-02-03 14:11 traces.txt

# And finally pull that file
exit

adb -s 0123456789ABCDEF pull /data/anr/traces.txt

but I am getting the this error "run-as: Package 'com.package.name' has corrupt installation."

like image 903
jiten Avatar asked Feb 03 '14 09:02

jiten


People also ask

Where are Android trace files stored?

On devices running Android 10 (API level 29), traces are shown in the Files app. If desired, you can share a trace from this app.

What is trace TXT file in Android?

From your question, 'trace' files are the files which are used to trace the errors within an app if the app crashes and either you report it yourself or your phone reports it for you.

How do I open a Perfetto trace file?

Open your web browser and go to https://ui.perfetto.dev. Select Open trace file. Navigate to and open your PERFETTO-TRACE file.


1 Answers

You can do the same thing using adb:

adb pull /data/anr/traces.txt
like image 184
Arpana Avatar answered Nov 14 '22 23:11

Arpana