Reputation: 41
Now , I want to read the system log on android 4.1 . But just can only get the application itself log . My code as following:
Process logcatProc = Runtime.getRuntime().exec(new String[] { "logcat","ActivityManager:V","*:S" });
reader = new BufferedReader(new InputStreamReader(logcatProc.getInputStream()));
String line;
while ((line = reader.readLine()) != null) {
Log.e("log",line);
}
it Seems can work on android 4.0 or previous version. anybody have tried this ? Or i need the root permission ?
Upvotes: 4
Views: 1942
Reputation: 67522
System logs changed in 4.1 and are now accessible only by system apps. (Source: Google I/O Video.) This is an exception on rooted devices, of course, if the installed app is set to be a system app.
Aside from this, there is no way to access the system logs on Android 4.1+. Note: End users can access the system log by using the (very finicky) shortcut of Power + Vol Up + Vol Down.
Upvotes: 5