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?
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.
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
Don’t close this popup as this will clear your logcat.
if nothing has appeared try the emphasized text
- You can use debug .
- You can use Log :
Priority constant for the println method.
Priority constant for the println method; use Log.d.
Priority constant for the println method; use Log.e.
Priority constant for the println method; use Log.i.
Priority constant for the println method; use Log.v.
Priority constant for the println method; use Log.w.
if i want to log to error log so i will use
its will print in error log “Message”
and you can fillter it by the tag “Tag”