Reputation: 195
I want to know if there's any way of recording logcat's messages when I'm testing my app with a real phone in a real environment. What I'm trying to achieve is to take my phone elsewhere and if anything goes wrong with my app, trace back why it went wrong. Especially if I give my app to a friend (or a boss) to try it out, they can't give me a lot of feedback on problems.
I could just print all the output to a .txt and then read it, but I'd like something a bit nicer
Any Ideas?
Upvotes: 4
Views: 639
Reputation: 24820
One way is to create your own Log.java function and then just change the import function to match your Class. In your Log.java you could write all the logs to some buffer and periodically save it to sdcard.
one more way is to
open adb shell
logcat > \sdcard\log.txt &
This will continue to run until restart of phone.
Upvotes: 1