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

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


当前回答

在Android 3.6.1中,我必须:

升级到最新的Android Studio版本(4.x.x) 重启Logcat 重启应用程序 重启Android Studio 重新启动Android测试设备

其他回答

在android Studio应用程序中,您需要单击调试应用程序选项(Shift+f9)以调试模式运行并启用LogCat。

重新启动logcat总是对我有帮助。

我有同样的症状,但我的问题要简单得多,这真的是我的错误。我的滤镜设置错了。

解决方案只是验证我设置了正确的过滤器。

所有这些都无济于事,我的日志猫功能失常。

After a lot of angry searching I found a solution that seems to work: 1. Make sure logcat itself is working (use DDMS from Tools->Android) and if it does close DDMS window again 2. Now go to Tab 5 (Debug), there select Logcat (this is not the same logcat as in Window 6!) 3. The window is empty just like Window 6, but now start a debugging run. For me logcat in the Debug window now started to show all the stuff again! Also when normally running the application the Debug->logcat view is still functional while the Tool Window #6 "logcat" is disfunctional as before

这是一个黑客,但是它会导致正常的logcat行为,突出显示您调试和开发所需的行和语法。 从现在开始,您需要通过调试窗口访问它。

我刚刚更改了applictionId和logcat停止工作。要重置它,您必须更改包的名称。只需点击右上角的下拉在Logcat窗口,显示你的应用程序包的名称,点击它,然后点击编辑过滤器配置,现在改变包的名称。它将开始工作。