How to redirect logcat output?
If you can connect the device for debugging, you can this from the command line
$ adb logcat > textfile.txt
The easiest way I found is to use System.setErr
. I allows you to easily redirect the error output to a file.
Example:
System.setErr(new PrintStream(new File("<file_path>"))