简体   繁体   English

Eclipse DDMS Persepctive(Android ADT插件)中的Logcat选项卡保持空白

[英]Logcat tab in Eclipse DDMS Persepctive (Android ADT plugin) Keeps Coming up Blank

I have seen this problem off and on while running the Eclipse (Galileo) under Fedora 11-13, whether the target is my device or an emulator. 我在Fedora 11-13下运行Eclipse(Galileo)时已经看到了这个问题,无论目标是我的设备还是模拟器。 But now with my new device, the HTC T-Mobile G2 (Android 2.2), I see it much more frequently: I successfully download the app (complete with lots of Log.d() calls), the system successfully launches it, but the LogCat pane in the DDMS perspective is completely blank. 但现在使用我的新设备HTC T-Mobile G2(Android 2.2),我更频繁地看到它:我成功下载了应用程序(完成了大量的Log.d()调用),系统成功启动了它,但是DDMS透视图中的LogCat窗格完全空白。

Sometimes, only sometimes, I seem to be able to kick it into action by clicking on the tool for Debug (the little bug one). 有时,只有在某些时候,我似乎能够通过点击Debug(小错误)工具来实现它。 But that doesn't even work all the time. 但这甚至都不起作用。 Worse yet, it forces me to restart the whole program, which is very cumbersome. 更糟糕的是,它迫使我重新启动整个程序,这非常麻烦。

And yes, I did remember to connect the device and make sure the device shows up under "adb devices", AND make sure that is the device the ADT downloaded to. 是的,我确实记得连接设备并确保设备显示在“adb设备”下,并确保这是ADT下载到的设备。 I can even hit breakpoints in the code. 我甚至可以在代码中点击断点。

I suppose I could try relying only on the debugger, but I put a lot of work into writing those Log.d statements in the right place, it would be a giant leap backwards to do without them now. 我想我可以尝试仅仅依赖于调试器,但我在正确的地方编写了很多工作来编写这些Log.d语句,现在没有它们将是一个巨大的飞跃。 So any suggestions concerning what the problem might be, workarounds, or how to find relevant bugs logged against either ADT, SDK or the G2, would be welcome. 因此,欢迎任何关于问题可能是什么,变通方法或如何找到针对ADT,SDK或G2记录的相关错误的建议。

TIA TIA

PS: Google searches such as "android ddms logcat" have not helped so far. PS:到目前为止谷歌搜索“android ddms logcat”没有帮助。

PS: I have also considered running ddms from the commandline, but the instructions on how to do this wtihout conflicting with the port already chosen by ADT for running DDMS are not clear enough to inspire confidence: so I always quit Eclipse before running the command line version of ddms. PS:我还考虑过从命令行运行ddms,但是有关如何执行此操作的说明与ADT已经选择用于运行DDMS的端口冲突并不清楚,这足以激发信心:所以我总是在运行命令行之前退出Eclipse ddms的版本。 But then I lose the handy ability (provided by Eclipse) of navigating my source code while reading the log, so this too, is an inferior solution. 但是后来我失去了在阅读日志时导航我的源代码的方便能力(由Eclipse提供),所以这也是一个较差的解决方案。 Perhaps if someone can connect a few more of the dots in Google's instructions on this by explaining how to get the device and command-line DDMS to agree on a port while still running Eclipse, that would be a good solution. 也许如果有人可以通过解释如何让设备和命令行DDMS在仍然运行Eclipse的同时在端口上达成一致来连接Google的说明中的更多点,那将是一个很好的解决方案。

Just to suggest the basics, when you click on the DDMS tab, is the device listed on the devices tab? 只需建议基础知识,当您单击DDMS选项卡时,设备选项卡上列出的设备是什么? (If devices isn't there, click Window->Show View->Devices) If it is listed, have you clicked on the device (on the name column). (如果没有设备,请单击窗口 - >显示视图 - >设备)如果已列出,则单击设备(在名称列上)。 Sometimes if the device isn't clicked on it will not show the logcat. 有时如果没有点击设备,它将不会显示logcat。

If it is and you have selected the device - try clearing the log (the icon of a page with a red cross at the bottom right corener of it - located at the top right of the logcat panel) I find if I have had it running for a long time it sometimes fills up and stops displaying the log, although normally one line is shown. 如果是,并且您已经选择了设备 - 尝试清除日志(位于logcat面板右上角的红色十字架的图标 - 位于logcat面板的右上角)我发现我是否已经运行很长一段时间它有时会填满并停止显示日志,尽管通常会显示一行。

It seems that ADT looses the connection with the device or is not re-connected when you reboot the device or emulator. 似乎ADT丢失了与设备的连接,或者在重新启动设备或仿真器时没有重新连接。 I've found that if you have more than one device or emulator you can click on the other one, click on the empty log window and the logs for this other device appear, then click the device that lost connection and will be re-connected. 我发现如果您有多个设备或模拟器,您可以单击另一个设备或模拟器,单击空日志窗口并显示该其他设备的日志,然后单击丢失连接的设备并将重新连接。

Yes, sounds like black magic, but it's all we have... 是的,听起来像是黑魔法,但这就是我们所拥有的......

It worked for me when I did following. 当我跟随时,它对我有用。 Remove the connection to the device (ie unplug the USB cable), then restart Eclipse. 删除与设备的连接(即拔下USB电缆),然后重新启动Eclipse。 Next time it starts, you can see the LogCat is back on action writing logs. 下次启动时,您可以看到LogCat重新开始写动作日志。

Hope this helps. 希望这可以帮助。

I have experienced the same problem on and off. 我经历过同样的问题。 Basically the logs were coming on console using "adb logcat" but not in the logcat view of eclipse. 基本上日志是使用“adb logcat”在控制台上进行的,而不是在eclipse的logcat视图中。 I've noticed that restarting the emulator , then restarting the eclipse and then relaunching the emulator from eclipse gets rid of this problem. 我注意到重新启动模拟器,然后重新启动eclipse,然后从eclipse重新启动模拟器摆脱了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM