0

I have two android application, (not on play store), I install both app in a mobile, Now i want to read all logs of Application1 into Application2, how can i do it, I'm able to read inapplog, not others, using this code:

Process logcat;
final StringBuilder log = new StringBuilder();
try {
logcat = Runtime.getRuntime().exec(new String[]{"logcat", "-d"});
BufferedReader br = new BufferedReader(new InputStreamReader(logcat.getInputStream()),4*1024);
String line;
String separator = System.getProperty("line.separator"); 
    while ((line = br.readLine()) != null) {
        log.append(line);
        log.append(separator);
    }
} catch (Exception e) {
    e.printStackTrace();
}

Need Help.

letsintegreat
  • 3,328
  • 4
  • 18
  • 39
Amritesh Kumar
  • 207
  • 1
  • 5
  • 16
  • Possible duplicate of https://stackoverflow.com/questions/22127349/how-to-read-android-log-cat-progamatically-for-other-applications – Shalu T D Mar 26 '18 at 05:58
  • In above post he is saying can't read logcat above Android 4.1. Then how Android Studio is reading and showing our logs in logcat. – Amritesh Kumar Mar 26 '18 at 06:24

0 Answers0