I want to save all the contents of log cat into specific file in Android. I used Eclipse IDE to develop the android application.
How i can achieve this ?
Thanks.
Here is a way to get the Logcat contents progrmatically.
Process process = Runtime.getRuntime().exec("logcat -d");
BufferedReader bufferedReader = new BufferedReader(
new InputStreamReader(process.getInputStream()));
StringBuilder log=new StringBuilder();
String line = "";
while ((line = bufferedReader.readLine()) != null) {
log.append(line);
}
Check this link for more details.
In the logcat tab, select all the lines. Then at the right top, click on the small triangle pointing down, called 'View Menu', and select 'Export Selection as text.."
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