热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Androidstudiologcat没有显示-Androidstudiologcatnothingtoshow

IinstalledAndroidStudioyesterday,andItriedtousetheLogCattoseethelogs.Butthereisno

I installed Android Studio yesterday, and I tried to use the LogCat to see the logs. But there is nothing to show in the logcat. I used the terminal to run ./adb logcat and it works.

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

Is there someone who can explain to me how to use logcat in Android Studio?

有没有人能告诉我怎么在Android Studio中使用logcat ?

47 个解决方案

#1


345  

Restarting logcat helps me always.

重启logcat帮助了我。

enter image description here

#2


104  

I get into this state often. Logcat is blank. Debugging works, I can hit breakpoints. No filters are set. Log level is on Verbose. I fix it by repeatedly looping through the following:

我经常处于这种状态。Logcat是空白。调试工作正常,我可以达到断点。没有设置过滤器。日志级别是详细的。我通过以下循环来修复它:

  • Restart logcat (see Zatziky's answer above)
  • 重新启动logcat(参见以上Zatziky的答案)
  • Change the log level to Debug (or anything else) and back to Verbose.
  • 将日志级别更改为Debug(或其他任何内容),并返回到Verbose。
  • unplugging and plugging back in the device
  • 拔出并插回设备。
  • running adb kill-server && adb start-server
  • 运行adb killserver & adb start-server
  • Close Android Studio and launch ddms on the command line.
  • 关闭Android Studio并在命令行上启动ddms。
  • Restart Android Studio
  • 重新启动Android工作室

And finally restarting the computer if all else fails.

如果其他方法都失败了,最后重新启动计算机。

The problem is intermittent, I think Android Studio is just buggy.

问题是断断续续的,我认为Android Studio只是有问题。

#3


51  

You need to press Alt+6 twice to restart the logcat window. That way it'll show the log outputs.

您需要按Alt+6两次来重新启动logcat窗口。这样就会显示日志输出。

The problem mainly happens in debug mode.

问题主要发生在调试模式下。

#4


51  

I had the same problem but I solved by the following steps, Try this once.

我也遇到过同样的问题,但是我通过以下步骤解决了,请尝试一次。

1) In the android studio.

1)在android studio中。

2) Open android Monitor window(bottom of android studio)

2)打开android Monitor窗口(android studio底部)

3) You can see the drop down in the right corner(spinner)

3)你可以看到右下角的下坠(转轮)

4) select -- Show only Selected application.

4) select——只显示选定的应用程序。

enter image description here

#5


35  

These helped me :

这些帮助我:

1.Enable ADB integration enter image description here 2. Go to Android Device Monitor Check if your device is online and Create a required filter enter image description here enter image description here enter image description here enter image description here

1。使亚行集成2。进入Android设备监视器检查你的设备是否在线,并创建一个必需的过滤器

#6


19  

Best way to fix some unnecessary changes is to invalidate caches

修复一些不必要的更改的最佳方法是使缓存无效。

Go to FILE -> click "INVALIDATE CACHES/RESTART" then a dialog box will pop-up, Select "INVALIDATE CACHES/RESTART" button.

转到FILE ->点击“INVALIDATE cache /RESTART”,弹出对话框,选择“INVALIDATE cache /RESTART”按钮。

Android studio will automatically restart and rebuild the index.

Android studio将自动重新启动和重建索引。

#7


16  

In android Studio application you need to click Debug application option (Shift+f9) to run in debug mode and to enable LogCat.

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

#8


11  

Not a technical answer but you might want to check the search box for the logcat. If there is any character inputted, your logcat will be empty as it will be searching for that certain character or word, and then if its not present, your logcat log will be totally empty.

这不是一个技术性的答案,但是您可能想要检查logcat的搜索框。如果有任何字符输入,您的logcat将为空,因为它将搜索特定的字符或单词,然后如果它不存在,您的logcat日志将完全为空。

#9


8  

**

* *

  • Read this if you are still stuck with logcat being empty
  • 如果你仍然觉得logcat是空的,请阅读本文

**

* *

I've just solved this after MONTHS of annoyment and trouble.
Nothing helped, the device monitor worked fine during debugging but the standard logcat view was always empty.

我刚刚解决了几个月的烦恼和麻烦。没有任何帮助,设备监视器在调试期间运行良好,但是标准的logcat视图总是空的。

The reason was annoyingly simple:
The logcat view was there but it had been moved to 0 width by an update!

原因非常简单:logcat视图在那里,但是通过更新将它的宽度移动到0。

You are in "ALT 6" Tab, you see two tabs in there "ADB logs" and "Devices | logcat"
Devices | logcat really means that it consists of Devices AND logcat, split by a vertical border.
The vertical border can be moved and during an update it seems to have moved to 100% right.

在ALT 6选项卡中,有两个选项卡"ADB log "和" device | logcat"设备| logcat实际上是指它由设备和logcat组成,由垂直边框分割。可以移动垂直边框,在更新过程中,它似乎已经向右移动了100%。

This results in the logcat to be collected but not displayed, move your mouse pointer to the right of the tool window and just DRAG logcat back into view.

这将导致logcat被收集但不显示,将鼠标指针移动到工具窗口的右边,并将logcat拖回到视图中。

This solution won't help everyone but I found many people with working ADB connection and still no logcat output, those might be hit by the same problem.

这个解决方案不会对每个人都有帮助,但是我发现很多人有工作的ADB连接,但是仍然没有logcat输出,这些人可能会遇到同样的问题。

#10


7  


Try to close the project and re-open it .It worked for me. Logs will be reappear.

试着关闭这个项目并重新打开它,它对我有用。日志将会出现。

#11


7  

For me, the issue was that I had two emulators with the same name (I created it, deleted it, and then created it again with the same name). There were two emulator entries in the logcat dropdown and it was connected to the wrong one. All I had to do was switch to the other one. I prevented the problem permanently by renaming the emulator.

对我来说,问题是我有两个同名的模拟器(我创建了它,删除了它,然后又用相同的名字创建了它)。logcat下拉菜单中有两个模拟器条目,它连接到错误的那个。我所要做的就是换到另一个。通过重新命名仿真器,我永久地避免了这个问题。

enter image description here

#12


7  

Restarting Android Studio helped me.

重启Android Studio对我有帮助。

#13


5  

enter image description here

In my case, I removed "image" from the little dropdown on the right. It showed up just fine after that. That's because it will be searching the log for the keyword in that searchbox, so if it doesn't find any matches, it returns blank

在我的例子中,我从右边的小下拉菜单中删除了“image”。在那之后一切都很好。这是因为它将在那个搜索框中搜索日志中的关键字,所以如果没有找到任何匹配项,它将返回空

#14


4  

On the right side of tab "Devices logcat" there is the button "Show only Logcat from selected Process". Its not perfect, because everytime I run another process I need to push it again, but thats the only solution that works for me. So far...

在标签“设备logcat”右侧,有一个按钮“只显示来自选定进程的logcat”。它并不完美,因为每次我运行另一个进程时,我都需要再次推动它,但这是唯一适合我的解决方案。到目前为止…

#15


4  

In my case, in the developer options menu there is an option called

在我的例子中,在developer options菜单中有一个选项叫做

Revoke USB debugging authorisations.

撤销USB调试授权。

Once you revoke all the existing authorisations it will ask again to trust the computer that you are using after that it started to show the logs again.

一旦您撤销了所有现有的授权,它将再次请求信任您正在使用的计算机,然后它开始再次显示日志。

#16


3  

This may not be your issue, but I've found that when having multiple windows of Android Studio open, logcat is only directed to one of them, and not necessarily the one that's running an active application.

这可能不是您的问题,但我发现,当打开Android Studio的多个窗口时,logcat只指向其中一个窗口,而不一定是运行活动应用程序的那个窗口。

For example, Window 1 is where I'm developing a Tic-Tac-Toe app, and Window 2 is where I'm developing a weather app. If I run the weather app in debug mode, it's possible only Window 1 will be able to display logcat entries.

例如,窗口1是我开发一个井字游戏应用程序的地方,窗口2是我开发一个天气应用程序的地方。

#17


3  

In my case I just had filtered the output so it appeared empty even after restarting Logcat etc.

在我的例子中,我只是过滤了输出,所以即使在重新启动Logcat之后,输出也是空的。

#18


2  

In Android studio 0.8.0 you should enable ADB integration through Tools -> Android, before run your app. Then the log cat will work correctly. Notice that if you make ADB integration disabled while your app is running and again make it enable, then the log cat dosen't show anything unless you rebuild your project.

在Android studio 0.8.0中,在运行应用程序之前,您应该通过工具> Android支持ADB集成。注意,如果在应用程序运行时禁用ADB集成,并再次启用它,那么日志cat不会显示任何内容,除非您重新构建项目。

#19


2  

In Android Studio 0.8.9, I opened Android Device Monitor, selected my emulator from the Devices list and got the output in the LogCat tab.

在Android Studio 0.8.9中,我打开Android设备监视器,从设备列表中选择模拟器,并在LogCat选项卡中获取输出。

After that, I went back to the main view of Android Studio and selected Restore Logcat view in the right of the Android DDMS tab and there it was!

之后,我回到Android Studio的主视图,在Android DDMS选项卡的右边选择了Restore Logcat视图,就在那里!

If this doesn't work, you could see your logcat in the Android Device Monitor as I explained in the first sentence.

如果这不起作用,您可以在Android设备监视器中看到logcat,正如我在第一句话中解释的那样。

#20


2  

Had the same issue today.

今天也有同样的问题。

Apparently I had eclipse running too and all the logcat output was redirected to eclipse. Since the logs can only be shown at once place, make sure you dont have multiple debuggers running.

显然,我也有eclipse运行,所有的logcat输出都被重定向到eclipse。因为日志只能显示在一个地方,所以要确保没有多个调试器在运行。

#21


2  

My problem solved, after I add android:debuggable="true" under application in your AndroiManifest.xml (even the ide mark as a wrong syntax!????)

我的问题解决了,当我添加android:debuggable="true"在你的android系统中。xml(甚至ide标记都是错误的语法!???)

#22


1  

Logcat has a little icon to the right of logcat. You can use the icon to turn logcat on and off. I can usually make logcat active by clicking the icon (maybe several times).

Logcat的右边有一个小图标。你可以使用这个图标来打开和关闭logcat。我通常可以通过点击图标来激活logcat(可能是几次)。

#23


1  

Full nuclear solution. ONLY USE THIS AFTER TRYING EVERYTHING ELSE because this will erase all your settings and preferences as well as stored images and everything that makes your emulators run until you reinstall and reconfigure. In my case it took about 20 minutes for both steps because I didn't customise a lot except for using Darcula.

完整的核解决方案。只有在尝试了所有其他东西之后才使用它,因为这将删除所有设置和首选项,以及存储的映像和所有使模拟器运行的内容,直到重新安装和重新配置。在我的例子中,这两个步骤都花了大约20分钟,因为除了使用Darcula之外,我没有定制很多东西。

  1. Delete your .AndroidStudioBeta config files directory
  2. 删除。androidstudiobeta配置文件目录

For linux users this is found under /home/[username]/.AndroidStudioBeta
For windows users, I'm not sure. The documentation on it is rather vague in my opinion. Probably somewhere under C:\Users[your user]\Application Data

对于linux用户,这是在/home/[用户名]/中找到的。我不确定windows用户的安卓系统。在我看来,关于它的文件相当模糊。可能在C:\用户[您的用户]\应用程序数据下面

  1. Check to see if it works yet, if it doesn't then also reinstall the SDK.
  2. 检查它是否已经工作,如果还没有,则重新安装SDK。

Rather drastic but I tried all the other things on this page, connected device, no filters, restarting the service, everything on this page and it just didn't work.

相当激烈,但我尝试了这个页面上所有其他的东西,连接设备,没有过滤器,重新启动服务,这个页面上的所有东西,它就是不能工作。

#24


1  

For me it was not working only for my application, it was working, if no filter has been selected (option on right side). But I needed to see only my app, therefore I found out, that if I do my own filter and filter it to package name, it is working as it should. I hope it could help to you too : )

对于我来说,它不仅适用于我的应用程序,如果没有选择过滤器(右边的选项),它还可以工作。但我只需要看到我的应用,因此我发现,如果我做我自己的过滤器,过滤它到包名,它就会正常工作。我希望这对你也有帮助。

#25


1  

Make sure you have enabled the build variant to "debug" in the Build Variants context menu. (You can find this at the bottom left corner of the window). This option will be set to release mode, if you have signed the apk for the application previously. This causes the debug messages not to show in the log cat.

请确保在build variant上下文菜单中启用了构建变体“debug”。(你可以在窗口左下角找到这个)。如果您之前已经为应用程序签了apk,那么这个选项将被设置为发布模式。这会导致调试消息不显示在log cat中。

#26


1  

Easy fix that worked for me (after trying some of these other suggestion). My logcat was sitting blank in a separate window (on my second screen). Just had to drag the Logcat tab back to it's original place in the debug panel next to the Debugger and Console tabs, and VOILA... it began immediately updating and showing all processes verbose. So (If your logcat is anywhere outside of the debugger panel (i.e. the logcat tab isn't sitting nested alongside the debugger and console tab) then it won't receive updates and will sit there blankly. Don't know if this is an issue with older versions of Android Studio. But again, easy to try and if it works... it works!!

在尝试了一些其他的建议之后,这个简单的修复对我很有效。我的logcat在另一个窗口(在我的第二个屏幕上)空着。只需将Logcat选项卡拖回到调试面板中调试和控制台选项卡旁边的原始位置,然后……它立即开始更新并显示所有进程的详细信息。因此(如果您的logcat位于调试器面板之外的任何位置(例如,logcat选项卡没有嵌套在调试器和控制台选项卡旁边),那么它将不会接收更新,并将空白地坐在那里。不知道这是不是老版本的Android Studio的问题。但是,很容易尝试,如果可行的话…它的工作原理!

#27


1  

Make sure you are importing the right class

确保导入了正确的类

import android.util.Log;

#28


1  

Go to run->debug If incase you have lose connection with host, it will ask permission to reconnect. Click yes. That should do it.

运行->调试如果你已经失去了与主机的连接,它将请求重新连接的权限。单击yes。应该做的。

#29


1  

I had the same symptoms but my problem was way simpler and really my mistake. I had the wrong filter set.

我也有同样的症状,但我的问题更简单,而且是我的错误。我设置了错误的过滤器。

The solution was just to verify that I had the correct filter set.

解决方案是验证我有正确的过滤器集。

#30


1  

I just fixed it on mine. Look for tiny icons on the far right of the DDMS display which restore the Devices Logcat view and the ADB View.

我刚把它固定在我的上面。在DDMS显示的最右边寻找小图标,它可以恢复设备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.

当DDMS首次同时显示“ADB日志”和“设备| logcat”选项卡时。“设备| logcat”是应该显示设备输出的,但是是空白的。不知何故,我设法隐藏了其中的一个或另一个标签,我完全忘记了如何隐藏。但是,在右边有一个小图标写着“恢复ADB”视图,我点击它,它就出现了。还有一个小图标是“恢复设备logcat视图”。我点击了它,突然它出现了,并再次显示设备输出。


推荐阅读
  • 前景:当UI一个查询条件为多项选择,或录入多个条件的时候,比如查询所有名称里面包含以下动态条件,需要模糊查询里面每一项时比如是这样一个数组条件:newstring[]{兴业银行, ... [详细]
  • 本文介绍了一个在线急等问题解决方法,即如何统计数据库中某个字段下的所有数据,并将结果显示在文本框里。作者提到了自己是一个菜鸟,希望能够得到帮助。作者使用的是ACCESS数据库,并且给出了一个例子,希望得到的结果是560。作者还提到自己已经尝试了使用"select sum(字段2) from 表名"的语句,得到的结果是650,但不知道如何得到560。希望能够得到解决方案。 ... [详细]
  • Iamtryingtocreateanarrayofstructinstanceslikethis:我试图创建一个这样的struct实例数组:letinstallers: ... [详细]
  • 本文介绍了如何在Jquery中通过元素的样式值获取元素,并将其赋值给一个变量。提供了5种解决方案供参考。 ... [详细]
  • tcpdump 4.5.1 crash 深入分析
    tcpdump 4.5.1 crash 深入分析 ... [详细]
  • 本文详细介绍了SQL日志收缩的方法,包括截断日志和删除不需要的旧日志记录。通过备份日志和使用DBCC SHRINKFILE命令可以实现日志的收缩。同时,还介绍了截断日志的原理和注意事项,包括不能截断事务日志的活动部分和MinLSN的确定方法。通过本文的方法,可以有效减小逻辑日志的大小,提高数据库的性能。 ... [详细]
  • 本文介绍了设计师伊振华受邀参与沈阳市智慧城市运行管理中心项目的整体设计,并以数字赋能和创新驱动高质量发展的理念,建设了集成、智慧、高效的一体化城市综合管理平台,促进了城市的数字化转型。该中心被称为当代城市的智能心脏,为沈阳市的智慧城市建设做出了重要贡献。 ... [详细]
  • Linux重启网络命令实例及关机和重启示例教程
    本文介绍了Linux系统中重启网络命令的实例,以及使用不同方式关机和重启系统的示例教程。包括使用图形界面和控制台访问系统的方法,以及使用shutdown命令进行系统关机和重启的句法和用法。 ... [详细]
  • 图解redis的持久化存储机制RDB和AOF的原理和优缺点
    本文通过图解的方式介绍了redis的持久化存储机制RDB和AOF的原理和优缺点。RDB是将redis内存中的数据保存为快照文件,恢复速度较快但不支持拉链式快照。AOF是将操作日志保存到磁盘,实时存储数据但恢复速度较慢。文章详细分析了两种机制的优缺点,帮助读者更好地理解redis的持久化存储策略。 ... [详细]
  • 本文讨论了在数据库打开和关闭状态下,重新命名或移动数据文件和日志文件的情况。针对性能和维护原因,需要将数据库文件移动到不同的磁盘上或重新分配到新的磁盘上的情况,以及在操作系统级别移动或重命名数据文件但未在数据库层进行重命名导致报错的情况。通过三个方面进行讨论。 ... [详细]
  • MyBatis多表查询与动态SQL使用
    本文介绍了MyBatis多表查询与动态SQL的使用方法,包括一对一查询和一对多查询。同时还介绍了动态SQL的使用,包括if标签、trim标签、where标签、set标签和foreach标签的用法。文章还提供了相关的配置信息和示例代码。 ... [详细]
  • 本文介绍了深入浅出Linux设备驱动编程的重要性,以及两种加载和删除Linux内核模块的方法。通过一个内核模块的例子,展示了模块的编译和加载过程,并讨论了模块对内核大小的控制。深入理解Linux设备驱动编程对于开发者来说非常重要。 ... [详细]
  • 解决nginx启动报错epoll_wait() reported that client prematurely closed connection的方法
    本文介绍了解决nginx启动报错epoll_wait() reported that client prematurely closed connection的方法,包括检查location配置是否正确、pass_proxy是否需要加“/”等。同时,还介绍了修改nginx的error.log日志级别为debug,以便查看详细日志信息。 ... [详细]
  • 在Oracle11g以前版本中的的DataGuard物理备用数据库,可以以只读的方式打开数据库,但此时MediaRecovery利用日志进行数据同步的过 ... [详细]
  • 本文介绍了一个React Native新手在尝试将数据发布到服务器时遇到的问题,以及他的React Native代码和服务器端代码。他使用fetch方法将数据发送到服务器,但无法在服务器端读取/获取发布的数据。 ... [详细]
author-avatar
顾玉妙
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有