我昨天安装了Android Studio,我试着用LogCat查看日志。但是日志里什么都没有。我使用终端运行。/adb logcat,它工作。
有人能给我解释一下如何在Android Studio中使用logcat吗?
我昨天安装了Android Studio,我试着用LogCat查看日志。但是日志里什么都没有。我使用终端运行。/adb logcat,它工作。
有人能给我解释一下如何在Android Studio中使用logcat吗?
当前回答
对我来说,问题在于设备是在“仅充电”模式下连接的。
将模式更改为媒体设备(MTP)(或在某些设备中传输文件)解决了问题。
其他回答
您可以在搜索中输入一些文本并过滤掉Logcat结果。 这就是我遇到问题的原因:)
这不是一个技术性的答案,但您可能想要检查logcat的搜索框。如果输入了任何字符,你的logcat将为空,因为它将搜索特定的字符或单词,然后如果它不存在,你的logcat日志将完全为空。
全核解决方案。只有在尝试了所有其他方法后才使用这个方法,因为这将删除您所有的设置和首选项,以及存储的图像和所有使您的模拟器运行的东西,直到您重新安装和重新配置。以我为例,这两个步骤都花了大约20分钟,因为除了使用Darcula外,我没有进行太多自定义。
删除你的。androidstudiobeta配置文件目录
对于linux用户,这可以在/home/[username]/下找到。AndroidStudioBeta 对于windows用户,我不确定。在我看来,关于它的文件相当模糊。可能在C:\Users[你的用户]\Application Data下面
检查它是否工作,如果不能,然后重新安装SDK。
相当激烈,但我尝试了这个页面上的所有其他东西,连接设备,没有过滤器,重新启动服务,这个页面上的所有东西,它就是不工作。
所有这些都无济于事,我的日志猫功能失常。
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行为,突出显示您调试和开发所需的行和语法。 从现在开始,您需要通过调试窗口访问它。
确保在模拟器开发人员菜单选项中有记录器缓冲区大小适当值。