I would like to read the last n lines from logcat. Should this work ?:
Process process = Runtime.getRuntime().exec("logcat -t -500");
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
...
-t number
Makes a log cut only for entries from the position indicated by the number and beyond. A positive number indicates that the position refers to the beginning of the log file, and a negative number indicates that the position is relative to the end of the log file.
thank
source
share