Read the syslog on Android 4.1

Now I want to read the syslog on Android 4.1. But you can just get only the application log itself. My code is:

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 may be running Android 4.0 or a previous version. Has anyone tried this? Or do I need root permission?

+4
source share
1 answer

System logs are changed in 4.1 and are now available only to system applications. (Source: Google I / O Video .) This is an exception for root devices, of course, if the installed application is installed as an application system.

In addition, there is no access to system logs on Android 4.1+. Note. End users can access the system log using the (very thin) Power + Vol Up + Vol Down shortcut.

+5
source

Source: https://habr.com/ru/post/1444245/


All Articles