How to save LogCat contents to file?

B. Clay Shannon picture B. Clay Shannon · Nov 25, 2011 · Viewed 93.9k times · Source

I've added debug strings (using Log.d()) and want to see them in context from the contents of logCat. The "save" icon for LogCat has a "Save selected items" hint, but there's got to be a quick way to just save the entire contents, or select the entire contents, but I don't see how to do it.

Answer

Dinesh Prajapati picture Dinesh Prajapati · Nov 25, 2011

To save the Log cat content to the file, you need to redirect to the android sdk's platform tools folder and hit the below command

adb logcat > logcat.txt

In Android Studio, version 3.6RC1, file will be created of the name "logcat.txt" in respective project folder. you can change the name according to your interest. enjoy