I google a lot and found only this approach:
String cmd = String.format("logcat -d '%s:I' '*:S'", Schema.TAG);
Process process = Runtime.getRuntime().exec(cmd);
BufferedReader reader = new BufferedReader(
new InputStreamReader(process.getInputStream()));
while((line = reader.readLine()) != null) {
builder.append(line);
builder.append(separator);
}
But it's not work well. I get an empty string or a small part of logs when execute this command.
Could you suggest how I can get the logs form device, like adb at PC.