Android Eclipse LogCat - 不工作

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20828207/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 03:32:45  来源:igfitidea点击:

Eclipse LogCat - Not Working

androideclipselogcat

提问by KickAss

This is the most frustrating thing ever, LogCat keeps deactivating/disconnecting. After running eclipse, LogCat logs for first run and after that, it goes Blank. I have to restart Eclipse to get it running again, and then same thing happens again. What is matter with it? It used to work fine. I can't recall changes I've made to undo what I (might) have done.

这是有史以来最令人沮丧的事情,LogCat 不断停用/断开连接。运行 eclipse 后,LogCat 会记录第一次运行,然后,它变为空白。我必须重新启动 Eclipse 才能让它再次运行,然后同样的事情再次发生。这有什么关系?它曾经工作得很好。我不记得我为了撤消我(可能)所做的所做的更改。

EDIT- Screen of Eclipse as requested.

编辑- 按要求的 Eclipse 屏幕。

enter image description here

在此处输入图片说明

EDIT 2- Screen of currently installed SDK packages

编辑 2- 当前安装的 SDK 包的屏幕

enter image description here

在此处输入图片说明

回答by Rahul Gupta

If the LogCat is empty, the emulator doesn't have the focus. Go to the DDMS perspective and try clicking on the 'emulator' entry in the Devices panel (top-left screen).

如果 LogCat 为空,则模拟器没有焦点。转到 DDMS 透视图并尝试单击“设备”面板(左上角屏幕)中的“模拟器”条目。

Same thing with a device. You just have to click on the entry representing that device and the log messages comes.

设备也是一样。您只需单击代表该设备的条目,就会出现日志消息。

回答by CONvid19

For Eclipseonlywhen LogCatisn't working:

对于Eclipse只有LogCat不工作:

1 - Open Perspective "DDMS".
2 - On the left side, click on the device you want to monitor.
3 - Change Perspective back to "JAVA".

1 - 打开透视图“ DDMS”。
2 - 在左侧,单击要监控的设备。
3 - 将视角改回“ JAVA”。

回答by Yauraw Gadav

Most of the time Rahuls methodwould work, but sometimes even that doesn't work in that case, Kill the ADB and restart the eclipse.

大多数情况下,Rahuls 方法会起作用,但有时即使在这种情况下也不起作用,请杀死 ADB 并重新启动 eclipse。

回答by Peter

I believe this other post with the same problem will answer this:

我相信另一个有同样问题的帖子会回答这个问题:

https://stackoverflow.com/a/11967853/241014

https://stackoverflow.com/a/11967853/241014

Essentially, set the log's buffer to a higher value by going in Eclipse to Window > Preferences > Android > LogCat. Set the "Maximum number of logcat messages to buffer" to something higher than the default of 5,000.

本质上,通过在 Eclipse 中转到 Window > Preferences > Android > LogCat,将日志的缓冲区设置为更高的值。将“要缓冲的最大 logcat 消息数”设置为高于默认值 5,000 的值。

enter image description here

在此处输入图片说明

回答by Jaswanth Kumar

In case if you are using cynogenmod in your mobile, try this:

如果您在手机中使用 cynogenmod,请尝试以下操作:

In your device, open "/system/etc/init.d/" folder If there are many files, try opening each file and find for this line:

在你的设备中,打开“/system/etc/init.d/”文件夹如果有很多文件,试着打开每个文件并找到这一行:

rm /dev/log/main

rm /dev/log/main

Now, comment this line like this: # rm /dev/log/main

现在,像这样注释这一行:# rm /dev/log/main

save the file and reboot.

保存文件并重新启动。

回答by Glenn

If you close LogCat and re-open it it will display the information.

如果您关闭 LogCat 并重新打开它,它将显示信息。

回答by sunnyboy

Although this question has been asked long before, I am answering for others who might stumble upon this trouble.

虽然很久以前就有人问过这个问题,但我正在回答可能会遇到这个麻烦的其他人。

In Mars, eclipse 4.5 and linux using GTK 3, if Android Logcat display is missing, add the following in eclipse.ini before "--launcher.appendVmargs".

在 Mars、eclipse 4.5 和使用 GTK 3 的 linux 中,如果缺少 Android Logcat 显示,请在 eclipse.ini 中的“--launcher.appendVmargs”之前添加以下内容。

--launcher.GTK_version
2

--launcher.GTK_version
2

May also refer these posts.
Logcat show invisible messages in Eclipse Mars
Eclipse GUI broken

也可以参考这些帖子。
Logcat 在 Eclipse Mars Eclipse GUI 中显示不可见消息
损坏