What enables the Android Eclipse LogCat? - android

The LogCat window is open. Sometimes LogCat displays Log messages, sometimes it does not, with or without the physical target attached. Is there an enable/disable Log somewhere in the debug environment?

I also have this problem within Eclipse. If you are lucky enough to not care about what has already been written to LogCat, you can click the "Clear Log" button on the top right next to the V,D,I,W,E buttons.
If you select the device and clear the log, I've found that the output is stable (at least until it fills up again).

I was having the same problem when trying to show logs on LogCat using the emulator. I solved this selecting "Reset adb" on the "Device" tab of DDMS.

type this :
adb kill-server
adb start-server
adb logcat

There is a known bug with logcat on Eclipse, it could be what you're experiencing:
http://code.google.com/p/android/issues/detail?id=2752
A suggested solution is to unplug the device and clear the logs, then start again

This happens to me when I work on an emulator and also my phone plug to the computer. My phone's log do not show on logcat. To solve the problem I close the emulator.

To disable the LogCat view from automatically appearing, deselect the following in Preferences:
Android > LogCat > Display logcat view when there are messages from an application in the workspace

If changing the Log level does not displays the log messages, close the debug perspective and then reopen it using the shortcut key or (Window -> Open Perspective -> debug), in Eclipse. This should surely resolve the issue of missing log messages.
cheers

I usually have this problem too. I found that what happens is that the LogCat is clearing the view as fast as the log messages are coming in, so I can't see anything.
What helped me was to change the log level. e.g. if it was at Debug, change to Verbose and then back to Debug. LogCat returns to normal and allows the logs to persist.
That worked for me, but YMMV.
P.S. Also check that your device is actually connected and 'online'. Sometimes, the device can go offline and LogCat can't print anything then.

click on DDMS then click on debug button (the bug icon next to run button)

To start, I am running Eclipse Indigo on a Mac OSX 10.7.4.
To keep the Logcat from dying and having to restart Eclipse each time I have been pausing Logcat and then right clicking and quitting the emulator from the dock. This does not work if you pause and click the close button in the emulator window.
Once the emulator is started again, unpause the Logcat and it seems to function properly. Make sure that the app has loaded completely, as shown by Console, before you close the window otherwise this does not work.
I have not figured out why this works yet. I have not had the chance to test this on my Windows machine.

If none of the proposed methods works, try deactivating and activating developer options on your phone. Do not forget to re-enable USB debugging!

Related

logcat in android studio not showing

After updating Android Studio to version 2.2.3, sometimes(manytimes) it doesn't show logs
Also After re-running application, it doesn't show logs
I have tried restart button in logcat but doesn't show effects and have checked all criteria like No Filters, Verbose, selected emulator and application package.
Restarting Android Studio works
to be more clear , when i clear logs it doesn't show logs again and every time I have to restart Android Studio
can anyone post a solution to this ?
I know the question is old, but I think my answer can help someone in the future. If you have problems with showing of logcats of emulators, try the following:
Turn off the emulator
Rename emulator
Start it again.
It works for me.
Try this solutions,
1) Press Alt+6 twice to restart the logcat window.it will show the log outputs.
2) Restart logcat
Change the log level to Debug (or anything else) and back to Verbose.
unplugging and plugging back in the device
running adb kill-server && adb start-server
Close Android Studio and launch ddms on the command line.
Restart Android Studio
3) try pressing Alt + 6 to open Log tab.
Look at the log level:- it must be verbose.
Restart adb.
If that doesn't works restart the android studio.
4)
In Android 2.2, for some reason, Firebase was selected by default in the dropdown box marked above. So logs didn't drop. I just needed to change it to No Filters. Then it worked.
5) Go to Tools -> Android -> Android Device Monitor (DDMS)
Now you would see Devices tab at the right side, you would see a view menu icon, just click on it and Reset adb
Now you should be able to get the log messages displayed on the LogCat console.
i hope any of these much solution can help you!!!
Frist click on Tool+ Android+ Enable ADB Integration
2.after that click on Tool+ Android+ Android device monitor
3.wait for second..........
or
1.in android 3.0
2.in bottom 6: Logcat option
On the left hand side of the Logcat window, there is an icon named restart. Simply press that icon once would show the logcat messages again.
In some cases it may be a phone issue. you should try restarting your phone or emulator.
It always works for me

getting blank screen in logcat

I have got a problem in my logcat screen and the problem is that,whenever I get error from my application I get blank screen in logcat and I am unable to look at the errors and fix them.How do I overcome this sort of issue?
here is my logcat screen:
Update your ADT plugin in Eclipse and right now you are using deprecated Logcat.
Help > Check for Updates
Go to DDMS->Devices and select the device that you are currently working on.
Just Try this command:---
adb shell
echo 1 > /sys/kernel/logger/log_main/enable
I run into that problem sometimes and I suggest:
Make sure you select the "V" tag to prove that why this happened is not because there is really no errors (Since you select the "E" tag).
Install the USB driver from the manufacturer of your device. Although you can connect the phone to PC as an USB storage device without the driver, you can't debug on the phone without it.
In Settings->Applications->Development, check the USB debugging choice to allow you to debug on the phone.
Make sure you have selected the proper device or emulator, not some other emulators or devices.
Sometimes, the logcat shows nothing, even if you have finished these steps above. In this case, click the "Clear" tag(at the top right, with a RED cross), unplug the phone and plug in again.
you have 3 things to do..
start emulator...
then see devices select your avd like Windows-show view-other-android-devices...
then start logcat Windows-show view-other-android-logcat..that's it and it will do..
But First you should see the emulator in devices..
If you can't then in devices click down arrow near camera icon and click on reset adb.
I ran into this issue in the Android Debug Monitor today. The reason this happened to me was because I had set the "maximum number of logcat messages to buffer" under Preferences/Android/LogCat to some very large amount like 50000000000. If you have played with this setting try setting it lower to like 5000. Once I configured mine back down to 50000 I started seeing messages come through LogCat again. You may have to restart things like the Android Debug Monitor, adb, the computer, the emulator, or the phone. At one point or another I tried all of those. Also you should see an error message when you try to configure this setting back to default. I believe it was a Java Null pointer or something. You can safely ignore the message and just check that the configuration worked when you go back into the Debug monitor. Good luck!
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
--launcher.GTK_version
2
May also refer these posts.
Logcat show invisible messages in Eclipse Mars
Eclipse GUI broken

LogCat Stops Running in Eclipse Needs Restart

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.
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.
Yes, I can get the normal logcat back by clear the log. Also I uncheck the "Limit console output" in Run/Debug->Console.
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.
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.
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
I'd recommend adjusting the Logcat buffer size and enable workspace application message monitoring in your preferences, mine are set as seen below.
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.
Same here! What worked for me is open DDMS perspective and on devices pane I clicked
reset adb
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".
When logcat stops displaying log entries, I find that closing Eclipse and re-opening it solves the problem for me.

Logcat is often out of work

Logcat is often not working, showing nothing. It's very unlivable. Restarting eclipse everytime it happens is too annoying.
Is there anything I can do to solve it?
Thanks
Sometimes the Logcat is empty in Eclipse because the emulator doesn't have the focus. Go to the DDMS perspective and try clicking on the 'emulator' entry in the top-left screen.
Can be even more confusing if there's also a real G1 connected, then you have to choose from which one you want to see the output :)
Hope this helped.
I just always keep logcat open in my terminal instead of eclipse. Just navigate to your platform-tools folder and type adb logcat
Eclipse only has a limitted buffer to display the logcat. There's a little clear button somewhere on that page, I forget where. Press that, it will clear the logcat and start displaying again.
Even adb logcat shows weird stuff and stops working after a while for no apparent reason: logcat.png. Eclipse restart and Android device restart doesn't help.
however console: adb logcat -c does work.
This also happens to me when I'm running both an avd in the emulator and usb debugging on a physical device. The avd will not give up focus, even though I'm loading the apk onto the device for debugging. I can fix by closing the avd.
Sometimes you selected certain session filter by mistake. 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".

Why doesn't logcat show anything in my Android?

Why doesn't logcat show anything in my Android (while developing apps with Eclipse)?
It just doesn't print anything. It's empty.
I had this same issue but my fix was much more basic:
If the LogCat panel is empty in Eclipse 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).
Dial
*#*#2846579#*#*
and you will see a hidden menu. Go to the Project Menu > Background Setting > Log setting and define the log availability (log switch) and level (log level setting).
Please note this may apply to Huawei phones only as is stated for an Ideos X3 (here) and is tested at a Honor U8860.
If clicking in Devices panel doesn't bring the spam, use reset adb in dropout menu from triangle on the right of the snapshot button.
I have the same problem on/off and the way I solved is by menu File → Restart (restart Eclipse).
Maybe you have Mylyn installed?
http://code.google.com/p/android/issues/detail?id=1808
While the answer provided by MoMo will resolve the problem temporarily it will most likely reoccur the next time you launch Eclipse, or launch on a different Emulator/Device.
Instead of always having to select my device in the devices view I've found a better solution is to go into your Eclipse preferences and navigate to Android -> LogCat in the list on the left and then enable "Monitor logcat for messages from applications in workspace".
This way no matter what device you are using logcat will automatically start showing output from it as soon as the application launches.
It will also setup a filter that ensures that only output from your application is displayed, which you can reuse / disable as needed.
Maybe the log is not enabled in your device.
Try to run the following command.
adb shell
echo 1 > /sys/kernel/logger/log_main/enable
OK. This is how I got it to work. I first followed MoMo's advice, that is...
If the LogCat panel is empty in Eclipse 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).
But to no avail.
I then attempted to reset adb (Android Debug Bridge) as suggested by fyodorananiev.
How? Menu Window → Devices → upside down triangle menu button → Reset adb.
It also didn't work, but I did get the following message:
Android hierarchyviewer: Unable to get the focused window from device
This meant that MoMo was right in that my Android device or emulator didn't have focus. However, the solution I did in my case is different.
What worked for me:
Replugged my Android device, which was connected to my computer via USB.
Restarted Eclipse, as mentioned by Abu Hamzah (although since I didn't know I can do menu File → Restart, I manually closed down Eclipse, and then restarted the application again.)
I can now see logs in my logcat.
Go to Developer settings and check that for Debugging\Select App for Debugging is empty
If you are using a device, the simplest check is to restart Eclipse.
You don't have to shutdown Eclipse
Use menu File → Restart
In a quick second or two you should see your LogCat return.
The simplest solution worked for me: Shutdown and restart my phone and Eclipse alike.
I had faced the same issue but in my case logs are shown when other devices are connected and not shown when my device is connected.
It took me days and finally, the issue resolved when I restarted my phone.
Below: Really dumb answer, but it happens!
My cat stepped on the space button while I was away and [SPACE]xN was typed in the search bar.
That resulted in an empty Log Cat. I tried restarting and wasted like 1 hour before I realized I should clear my search bar.
TLDR; CLEAR YOUR LOG CAT SEARCH BAR!
I think you haven't selected the device or emulator, on which running your application.
In Eclipse, go to DDMS Perspective and select the device or emulator on which you are running your application.
(Note: No need to restart Eclipse)
In case if you are using CyanogenMod in your mobile, it will disable logging by default. Try this method:
In your device, open "/system/etc/init.d/" folder
If there are many files, try opening each file and find for this line:
rm /dev/log/main
Now, comment this line like this: # rm /dev/log/main
Save the file and reboot.
It gets interesting when you find out that none of all the answers in for this question were helpful.
And then you find out that in your version of ADT 22.6.3.v201404151837-1123206 if you add two filters with the same package name (application name) then the log will not appear.
It was weird, because the log was there two seconds ago, and launching the app in debug mode adds a default filter for the app which collides with the filter I've setup manually, and then ADT magically removes all the logs, and none of the filter worked including the all messages (no filters)!
But it was masking another issue...
I'm working with dual screens. The second one is connected via VGA/RGB - (not really sure what it's called) and what can I do. I'm a ton more comfortable with the logcat away from my code editors, so I've placed it in another window, and as it turns out that is the main reason for the disappearing logs for me.
If using the DDMS to refocus doesn't work, try closing and restarting LogCat. That helped me.
I've had this happen occasionally. Closing and re-opening Eclipse seems to fix it.
If you tried all of the others, and still got losing on an empty logcat. I got another simple way.
Download an old version of ADB, and try again. It might be working, at least working for me with Android 7.0 phone (vendor stopped updating).
Here is the useful link for old versions.
I had the same issue. No need to restart Eclipse or clean your project. You may follow:
Click on LogCat icon on bottom right corner of eclipse.
In Saved Filter Pane (Left side), double click package of your project (in my case it's com.apps..*).
In Logcate Message Filter Settings popup, select desired option of "by Log Level". You can select verbose, info, error etc.
Click Ok.
Run/Debug your project.
This is simple.
Just close the Logcat from eclipse.
Then reopen it by following steps in Eclipse.
Window - Show View - Other - Android - LogCat - ok
Hope this solves your problem.
Many times when I switched to a new Android device, I do see no more logcat messages. Unfortunately, none of the above suggestions worked for me (Eclipse Photon 4.8.0).
I am now using this . It seems to work for different devices.
Check if the Console is telling you something. Usually this happens when the project could not be installed in the device, and just shows the previous one.
The most common case I have seen this is when there are different signatures in the project, and is not running at all.
Please, read all the red letters you see. If the LogCat does not show anything, take for sure that the Console will do.
For OnePlus devices and Ubuntu OS:
Install Wine on Ubuntu
Install ADB tools on Ubuntu
sudo apt-get install android-tools-adb
Now, attach your device to PC with USB.
Open mounted "One Plus Drivers". A disc like icon
Right click on OnePlus_USB_Drivers_setup.exe and run with Wine
Then open the terminal in the present drive where your "OnePlus_USB_Drivers_setup.exe" and other driver files exists. And run
./adb_config_Linux_OSX.sh or sh adb_config_Linux_OSX.sh
Close this terminal
Open a new terminal and run
adb server-start
Your OnePlus device should prompt you to recognise your PC as a debugging agent.
Now, run on the terminal. It should show your device.
adb devices
Reference: [SOLVED] Android Studio does not recognise my One Plus Two in Linux
Set the same date and time in your Android phone and in your laptop.
I had a similar problem of logs not showing, and when I set the correct date in the phone I started seeing the logs (I restarted the phone and the hour was completely wrong!).
What worked for me besides restarting Eclipse was:
Remove custom filters
After removing all filters, logcat was filled with text again
Close logcat and then reopen it from Window → Show View → Others.
If you're using Eclipse v4.5 (Mars) (at least, Mars.1 or Mars.2), try the solution described here: Logcat show invisible messages in Eclipse Mars.
It helped in my case.
In my case (after trying all the answers provided here to no avail), the problem (and solution) has to do with port 8700:
What I needed to do is:
Exit "Android Device Monitor" (monitor.bat)
Exit all instances of Eclipse.
C:\adt-bundle-windows-x86_64\sdk\tools>..\platform-tools\adb.exe kill-server
C:\adt-bundle-windows-x86_64\sdk\tools>..\platform-tools\adb.exe start-server
C:\adt-bundle-windows-x86_64\sdk\tools> monitor.bat
Also, the Scroll Lock button, needs to be "pressed/active":
Not the other way:

Categories

Resources