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?
source share