Logcat没有显示来自我的Huawei P9手机的错误 [英] Logcat not showing errors from my Huawei P9 phone

查看:117
本文介绍了Logcat没有显示来自我的Huawei P9手机的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Android Studio 2.3,而我的手机是Huawei P9 Lite.我注意到我的logcat没有显示手机中的错误.例如,如果我有由于NullPointerException而崩溃的代码,并且在模拟器上运行它,则logcat(字体颜色:红色)中会出现异常,弹出窗口会显示MyApplication stopped working,但是如果我在手机上运行相同的代码,我只是出现崩溃弹出窗口,而logcat中什么也没有.显示信息消息,但不显示错误.为了在logcat中显示手机中的错误消息,我该怎么办?

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?

推荐答案

华为禁用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.

  1. 打开Dialer应用并输入以下代码:*#*#2846579#*#*.
  2. 进入背景设置页面.
  3. 点击"日志设置"
  4. 选中所有 3个选项以启用完整日志记录.
  5. 忽略将影响性能"警告.
  6. 重新启动手机.
  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.

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

这篇关于Logcat没有显示来自我的Huawei P9手机的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆