问题
Periodically LogCat will stop showing messages even though I am in debug mode. At other times it will display only one line at a time! I have a solution, restart eclipse. But I would like to understand this better. It takes too much time to restart eclipse when this happens. I have seen this behavior on the emulator and connected to a device. Either the LogCat shows one line with no history or nothing.
回答1:
Yes, I can get the normal logcat back by clear the log. Also I uncheck the "Limit console output" in Run/Debug->Console.
回答2:
I was with the same problem and the solutions here didn't work for me. The solution I found is open the DDMS perspective and select the device and the running process on the Devices window. With that done, the LogCat returns to life.
回答3:
I solve these LogCat issues in two different ways:
- Clearing the log to fix the one line at a time issue
- Opening the devices window (
Window
->Show View
->Other
->Android
->Devices
), and clicking on the device that I want to view the log for. This seems to force Android to refresh LogCat on that device.
These are much easier options than restarting eclipse, or messing with adb.
回答4:
I've had that "one line at a time" problem numerous times. I don't know why exactly it happens but there is a very simple fix that works for me every time. Just hit the clear log button. Simple and easy.
I've also had Logcat fail to show messages. Generally this has been due to a problem with the emulator and it required an emulator restart.
回答5:
In eclipse you need to give more space to log buffer, default is 5000, i set it to 50000 and no have any problems.
Window->preference->android>logcat maximum num of log message to buffer __ set some number 50k is ok
回答6:
I'd recommend adjusting the Logcat buffer size and enable workspace application message monitoring in your preferences, mine are set as seen below.

回答7:
On a real Device (mine is an HTC Desire in question) I've found simply disabling then enabling ADB does not always solve it. What works more often is to disable ADB, close the page (perhaps by back) then to renter the Development page, and re-enable debug mode.
回答8:
Same here! What worked for me is open DDMS perspective and on devices pane I clicked
reset adb
回答9:
Click "Display saved filters view" button By showing the two-pane view of your LogCat you'll be able to check the active filter in the left-pane. I once fixed the empty LogCat by selecting "All messages".
回答10:
When logcat stops displaying log entries, I find that closing Eclipse and re-opening it solves the problem for me.
来源:https://stackoverflow.com/questions/5011816/logcat-stops-running-in-eclipse-needs-restart