开发者

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. 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.

Sometimes, only sometimes, I seem to be able to kick it into action by clicking on the tool for Debug (the little bug one). 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. 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. 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.

TIA

PS: Google searches such as "android ddms logcat" have not helped so far.

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. 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. Perhaps if someone can connect a few more of the dots in Google's inst开发者_如何学Pythonructions 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.


Just to suggest the basics, when you click on the DDMS tab, is the device listed on the devices tab? (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.

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.


It seems that ADT looses the connection with the device or is not re-connected when you reboot the device or emulator. 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 (i.e. unplug the USB cable), then restart Eclipse. Next time it starts, you can see the LogCat is back on action writing logs.

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. I've noticed that restarting the emulator , then restarting the eclipse and then relaunching the emulator from eclipse gets rid of this problem.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜