Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
353 views
in Technique[技术] by (71.8m points)

android - Logcat not showing errors from my Huawei P9 phone

I am using Android Studio 2.3 and my phone is Huawei P9 Lite. I noticed that my logcat does not show errors from my phone. For example if I have code that will crash because of NullPointerException and I run it on emulator I get exception in logcat (font color: red) and popup saying MyApplication stopped working, but if I run same that code on my phone, i just get crash popup and nothing in logcat. Info messages are displayed, but errors are not. What do I need to do in order to show error messages from my phone in logcat?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Huawei disables LogCat and any access to the logs of your phone. You should go to a hidden menu where you can enable these functions.

  1. Open your Dialer app and enter the following code: *#*#2846579#*#*.
  2. Enter the Background Settings page.
  3. Click on “Log Settings
  4. Check all 3 options to enable full logging.
  5. Ignore the "will affect performance" warning.
  6. Reboot the phone.

This helped me, hope it will help to you, too.

Source: https://www.xda-developers.com/huawei-phones-disable-logcat-heres-how-to-restore-access/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...