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?

- 1,925
- 3
- 30
- 49
-
Clear filters, set option "no filters", and check log level – miljon Mar 09 '17 at 09:12
-
1Possible 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) – Yazan Mar 09 '17 at 09:43
-
@Yazan Thank you, I have solved the problem – clzola Mar 09 '17 at 10:07
4 Answers
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.
- Open your Dialer app and enter the following code: *#*#2846579#*#*.
- Enter the Background Settings page.
- Click on “Log Settings”
- Check all 3 options to enable full logging.
- Ignore the "will affect performance" warning.
- 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/
-
Yes, I did this back then and it worked as @Yazan mentioned in the comments of this question. – clzola Apr 22 '17 at 16:39
-
2Perfect solution for me - except (for me) **don't reboot the phone**. – OldCurmudgeon May 25 '18 at 06:22
I was facing the same issue and I solved it as below:
Select Tools -> Android -> then disable ADB integration and then re-enable it. Hope it'll help you

- 2,020
- 14
- 21
Don't close this popup as this will clear your logcat.
if nothing has appeared try the emphasized text

- 74,687
- 32
- 99
- 138
-
1I have selected my phone, and I have set log level to verbose, and no filters – clzola Mar 09 '17 at 09:57
- You can use debug .
- You can use Log :
int ASSERT Priority constant for the println method.
int DEBUG Priority constant for the println method; use Log.d.
int ERROR Priority constant for the println method; use Log.e.
int INFO Priority constant for the println method; use Log.i.
int VERBOSE Priority constant for the println method; use Log.v.
int WARN Priority constant for the println method; use Log.w.
Example : if i want to log to error log so i will use Log.e("TAG","Message"); its will print in error log "Message" and you can fillter it by the tag "Tag"

- 314
- 1
- 3
- 11
-
`Log.e()` is shown, but some code where I do not need `try-catch` for example if `NullPointerException` occurs application crashes and I do not see error in logcat from phone, however I see it if same code runs on emulator – clzola Mar 09 '17 at 09:59