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

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

问题描述

我使用的是 Android Studio 2.3,我的手机是华为 P9 Lite.我注意到我的 logcat 没有显示我手机中的错误.例如,如果我的代码会因为 NullPointerException 而崩溃,并且我在模拟器上运行它,我会在 logcat 中得到异常(字体颜色:红色)并弹出说 MyApplication 停止工作,但是如果我在手机上运行相同的代码,我只会得到崩溃弹出窗口,而在 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. 打开您的拨号器应用并输入以下代码:*#*#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 没有显示我的华为 P9 手机的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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