0

I working on an Android app that reads from log cat. It works perfectly on all Android devices except for the Huawei company. I've read a lot of stuff about on the internet, and I saw that logcat is disabled in Huawei. So I activated it following these steps:

  1. Dial ##2846579##
  2. Go ProjectMenu->Background Setting->Log Setting
  3. Set Log switch to on
  4. Finally restart your device and enjoy the app

I did that now the logs appear in logcat when I execute the app connected to Eclipse. But Still I can't read from log cat it always returns null:

Runtime.getRuntime().exec(new String[] { "logcat", "-c" }); logcat = Runtime.getRuntime().exec(new String[] { "logcat" }); BufferedReader br = new BufferedReader(new InputStreamReader(logcat.getInputStream()), 4 * 1024); String line; while ((line = br.readLine()) != null) {System.out.println("HELLO");}

br.readLine() always returns null.

Any help is appreciated.

Denis Davydov
  • 463
  • 2
  • 8
  • 22
  • possible duplicate of [Huawei, logcat not showing the log for my app?](http://stackoverflow.com/questions/18124334/huawei-logcat-not-showing-the-log-for-my-app) – Siebe May 16 '14 at 13:31
  • @Siebe - no, please **take time to read the question** as it states that the procedure you would point to has already been used, **and made a difference** (eclipse now shows logs) but that it is **not the problem this question seeks to solve**. This question concerns instead reading logs **from within the app**. – Chris Stratton May 16 '14 at 14:23
  • `System Menu/Developer Options/Android Debug`... or does it only work on rooted/modded phones? – Phantômaxx May 16 '14 at 14:28
  • @Der Golem I did this. And if I'm not mistaken this just enables USB debugging – Denis Davydov May 17 '14 at 11:53

0 Answers0