我昨天安装了Android Studio,我试着用LogCat查看日志。但是日志里什么都没有。我使用终端运行。/adb logcat,它工作。

有人能给我解释一下如何在Android Studio中使用logcat吗?


当前回答

在我的例子中,在开发人员选项菜单中有一个名为

撤销USB调试授权。

一旦你撤销所有现有的授权,它会再次要求信任你正在使用的计算机,之后它开始再次显示日志。

其他回答

为我禁用验证应用程序通过USB和验证字节码 可调试的应用程序帮助我使logcat更加可靠。

我找到了三种解法。

在Android 4.0设备上调试(我之前在Android Lollipop设备上运行它)。 单击DDMS中的重启按钮。 启动Android设备监视器,你会发现logcat。祝你好运~

我的问题解决了,在我添加android:debuggable="true"下应用程序在你的androimanifes .xml(甚至ide标记为错误的语法!????)

我刚把它修好了。在DDMS显示的最右边寻找恢复Devices Logcat视图和ADB视图的小图标。

When the DDMS first came up with both the "ADB Logs" and the "Devices | logcat" tab showing. The "Devices | logcat" is the one that should be showing the device output, but was blank. Somehow I managed to hide one or the other of those tabs, I forget exactly how. But, off to the right there was a tiny icon that said "Restore ADB" view, and I clicked it and it came up. Then there was another tiny icon that said "Restore Devices logcat view". I clicked that, and all of a sudden it appeared and was showing the device output again.

试试@Robert Karl在这篇文章中提到的观点。如果没有工作,那么你肯定可以通过android设备监视器看到日志。

启动android设备监视器 选择DDMS透视图 然后选择屏幕截图所示的设备。 您可以根据您的要求应用过滤器