我昨天安装了Android Studio,我试着用LogCat查看日志。但是日志里什么都没有。我使用终端运行。/adb logcat,它工作。
有人能给我解释一下如何在Android Studio中使用logcat吗?
我昨天安装了Android Studio,我试着用LogCat查看日志。但是日志里什么都没有。我使用终端运行。/adb logcat,它工作。
有人能给我解释一下如何在Android Studio中使用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行为,突出显示您调试和开发所需的行和语法。 从现在开始,您需要通过调试窗口访问它。
其他回答
在我的情况下,我发送空标签,即
Log.d("","My Log");
而是发送一个标记名称
Log.d("Class name","My Log");
希望它能帮助到别人
在终端中执行此命令。它将重新开始工作。
adb kill-server && adb start-server
还要小心这个坏男孩(即使重新启动android studio也没有消失):
我检查了答案,只是在检查我的日志时偶然发现我的错误。 确保右边的方框显示“只显示选定的应用程序”。我的显示的是“Firebase”,所以它显示了来自Firebase的消息。
全核解决方案。只有在尝试了所有其他方法后才使用这个方法,因为这将删除您所有的设置和首选项,以及存储的图像和所有使您的模拟器运行的东西,直到您重新安装和重新配置。以我为例,这两个步骤都花了大约20分钟,因为除了使用Darcula外,我没有进行太多自定义。
删除你的。androidstudiobeta配置文件目录
对于linux用户,这可以在/home/[username]/下找到。AndroidStudioBeta 对于windows用户,我不确定。在我看来,关于它的文件相当模糊。可能在C:\Users[你的用户]\Application Data下面
检查它是否工作,如果不能,然后重新安装SDK。
相当激烈,但我尝试了这个页面上的所有其他东西,连接设备,没有过滤器,重新启动服务,这个页面上的所有东西,它就是不工作。