Why doesn't logcat show anything in my Android?
Asked Answered
P

30

250

Why doesn't logcat show anything in my Android (while developing apps with Eclipse)?

It just doesn't print anything. It's empty.

Plaque answered 12/2, 2010 at 6:46 Comment(3)
Is it the logcat View in Eclipse that's blank, the output of the adb logcat command, or both?Conformist
It may also happen when debugging Android 7 (or higher) devices. See this topicCircumstantiate
What do you mean by "in my Android"? Do you mean "on my Android device"? Or "in Android Studio"? Or something else? Please respond by editing (changing) your question, not here in comments (without "Edit:", "Update:", or similar - the question should appear as if it was written today).Tennant
R
33

Maybe you have Mylyn installed?

http://code.google.com/p/android/issues/detail?id=1808

Rensselaerite answered 12/2, 2010 at 7:42 Comment(4)
That doesn't matter. I removed my Mylyn plugins, and the issue persisted.Merodach
I don't think there is any reason to down-vote this answer, it's the accepted answer because it solved the problem for TIMEX. If this is not your issue then feel free to up-vote another answer.Karinkarina
What is "Mylyn"? Can you add a link (or similar) to your answer? (But without "Edit:", "Update:", or similar - the answer should appear as if it was written today.)Tennant
@PeterMortensen I had trouble remembering what it was myself ;)Karinkarina
L
521

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

Ling answered 31/5, 2010 at 18:31 Comment(7)
Same thing happens with a physical device. You just have to click on the entry representing that device and the log messages suddenly come flooding in.Vouch
If this doesn't work right away, restart eclipse, then it works, thanks @LingPettiford
On my target device, it showed my activity, click on it and then click on Start Tracking on the next window.Slovak
from last month I restart the eclipse as solution, you make it more faster :)Steatite
I have no idea where the "device tab" is supposed to be - someone has a picture?Logwood
Window / Show View / Other... / Devices. I've just upvoted this answer to 500. ;-)Brach
@Vouch 12 years later and I have the same problem but this time clicking on the entry representing that (physical) device does not solve the issue. OTOH, every now and then I see all LogCat messages in one single long line. Could the problem be my el-cheapo Redmi 6A phone?Defrock
G
84

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.

Goa answered 9/6, 2012 at 17:28 Comment(7)
To tell the truth, my Honor starts showing log in LogCat and then it may stop. I don't rely on LogCat with this device. You may install CatLog (play.google.com/store/apps/details?id=com.nolanlawson.logcat) or a similar tool - that one always works! Good luck.Goa
Make sure you restart your phone after setting the log.Intersex
Works on Huawei P7-L07Tensity
Worked for Huawei P8 Lite - ALE L21 ! Thank you !Evulsion
Worked for Huawei MediaPad M2 8.0 M2-801L Tablet.Meninges
There isn't any hidden many. It showing "VersionInfoQuery" activity. And also in that UI only provide information about version, Device ext.. Need helpDemetrius
this solution did worked for me #42691576Isometry
S
71

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.

Starlike answered 2/2, 2012 at 15:44 Comment(3)
Watch out because Console will spit out [YYYY-MM-DD HH:MM:SS - DeviceMonitor] Adb connection Error:EOF... Connection attempts: 1. As posted elsewhere on SO (#1997974), this is benign but you will have to unplug/reconnect your devices so they show up.Severable
This fixed it, and I didn't have to reconnect my device for it to show up, fwiwChad
Just found it, but I only get message that Adb connection was forcebly close and no reconnection.Congelation
R
41

I have the same problem on/off and the way I solved is by menu FileRestart (restart Eclipse).

Ritual answered 1/3, 2012 at 4:49 Comment(2)
No need restart eclipse > just select your emulator or device from DDMSSedentary
We dont have time to restart the eclipse as it takes 5-10 minutes :(Darelldarelle
R
33

Maybe you have Mylyn installed?

http://code.google.com/p/android/issues/detail?id=1808

Rensselaerite answered 12/2, 2010 at 7:42 Comment(4)
That doesn't matter. I removed my Mylyn plugins, and the issue persisted.Merodach
I don't think there is any reason to down-vote this answer, it's the accepted answer because it solved the problem for TIMEX. If this is not your issue then feel free to up-vote another answer.Karinkarina
What is "Mylyn"? Can you add a link (or similar) to your answer? (But without "Edit:", "Update:", or similar - the answer should appear as if it was written today.)Tennant
@PeterMortensen I had trouble remembering what it was myself ;)Karinkarina
A
11

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.

Logcat application output enabling setting

Adrianaadriane answered 27/8, 2012 at 14:10 Comment(2)
"Window" -> Android -> ... etc.Seeing
INFO: This fixed LogCat on Blackberry Priv Android 5.1.1 Only when I press RUN and this is enoughEaston
I
10

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
Impotent answered 30/11, 2010 at 9:8 Comment(5)
That was the problem in my Huawei U8500. Neither adb logcat nor eclipse were showing anything. Thanks!Chippewa
What does it mean if there is no 'logger' directory inside of /sys/kernel?Pullen
Try in another directory: echo 1 > /sys/kernel/logger_mode/logger_modeIllbehaved
That directory is not there either. There is a config directory, but it is empty.Darling
@Impotent There is no /sys/kernel/logger in Redmi 6A (the device I use for debugging).Defrock
O
6

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 WindowDevices → 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:

  1. Replugged my Android device, which was connected to my computer via USB.

  2. Restarted Eclipse, as mentioned by Abu Hamzah (although since I didn't know I can do menu FileRestart, I manually closed down Eclipse, and then restarted the application again.)

I can now see logs in my logcat.

Ozone answered 8/1, 2014 at 6:49 Comment(1)
What worked for you is waaaay too cumbersome and time consuming. It used to work for me without a hitch on a Nexsus One and LG LS670 and Samsung Galaxy S. I have no idea what happened the current state of Eclipse+ADT development (other than that it is no longer supported by Google).Defrock
L
3

If you are using a device, the simplest check is to restart Eclipse.

You don't have to shutdown Eclipse

Use menu FileRestart

In a quick second or two you should see your LogCat return.

Logography answered 22/10, 2013 at 17:13 Comment(2)
it is as long as shutdown eclipse, I don't see the difference.Fearfully
@LeSam, yeah, the only difference is that Eclipse is re-started automatically.Apply
N
3

Go to Developer settings and check that for Debugging\Select App for Debugging is empty

enter image description here

Ninety answered 29/8, 2016 at 12:58 Comment(2)
I have a BLU Dash XL. I couldn't see the log and tried this solution. BAM! Worked!! Thanks!Sy
Unfortunately, Select debug app does not solve my problem.Defrock
S
2

The simplest solution worked for me: Shutdown and restart my phone and Eclipse alike.

Samy answered 28/6, 2012 at 22:45 Comment(1)
No need restart eclipse > just select your emulator or device from DDMSSedentary
S
2

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)

Sedentary answered 22/11, 2012 at 11:2 Comment(0)
L
2

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.

Laney answered 23/6, 2014 at 20:16 Comment(0)
H
2

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.

Headlock answered 9/10, 2014 at 18:44 Comment(0)
B
2

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.

Biggs answered 28/2, 2017 at 6:2 Comment(1)
Happened to me tooNipple
F
2

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!

enter image description here

Fiora answered 10/8, 2021 at 16:16 Comment(0)
F
1

If using the DDMS to refocus doesn't work, try closing and restarting LogCat. That helped me.

Feather answered 9/4, 2013 at 20:17 Comment(0)
H
1

I've had this happen occasionally. Closing and re-opening Eclipse seems to fix it.

Hillinck answered 4/11, 2013 at 23:11 Comment(0)
A
1

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.

Aufmann answered 7/6, 2019 at 16:20 Comment(0)
T
0

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.

Tricyclic answered 17/12, 2012 at 5:53 Comment(0)
O
0

I had the same issue. No need to restart Eclipse or clean your project. You may follow:

  1. Click on LogCat icon on bottom right corner of eclipse.
  2. In Saved Filter Pane (Left side), double click package of your project (in my case it's com.apps..*).
  3. In Logcate Message Filter Settings popup, select desired option of "by Log Level". You can select verbose, info, error etc.
  4. Click Ok.
  5. Run/Debug your project.
Oversexed answered 27/8, 2013 at 4:35 Comment(0)
M
0

What worked for me besides restarting Eclipse was:

  • Remove custom filters

After removing all filters, logcat was filled with text again

Mori answered 23/3, 2015 at 12:13 Comment(0)
O
0

Close logcat and then reopen it from WindowShow ViewOthers.

Overblown answered 3/11, 2015 at 12:11 Comment(0)
J
0

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.

Jesse answered 27/3, 2016 at 8:54 Comment(0)
H
0

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.

Hermanhermann answered 7/6, 2016 at 5:22 Comment(0)
B
0

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

Bullate answered 8/8, 2016 at 18:30 Comment(0)
S
0

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.

Squad answered 30/11, 2018 at 8:9 Comment(0)
H
0

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

Honorine answered 19/6, 2020 at 7:57 Comment(0)
D
0

In my case (after trying all the answers provided here to no avail), the problem (and solution) has to do with port 8700:

enter image description here

What I needed to do is:

  1. Exit "Android Device Monitor" (monitor.bat)
  2. Exit all instances of Eclipse.
  3. C:\adt-bundle-windows-x86_64\sdk\tools>..\platform-tools\adb.exe kill-server
  4. C:\adt-bundle-windows-x86_64\sdk\tools>..\platform-tools\adb.exe start-server
  5. C:\adt-bundle-windows-x86_64\sdk\tools> monitor.bat

Also, the Scroll Lock button, needs to be "pressed/active":

logcat scrolling

Not the other way:

logcat paused

Defrock answered 7/12, 2022 at 16:5 Comment(0)
M
0

These are the steps that helped me

  1. Verify the variant you are working on and check app has debuggable true in gradle. It may be possible you are some other variant and have check for BuildConfig.Debug
buildTypes {
        debug {
            debuggable true
            }
}
  1. Try selecting the device properly if you are working on Android studio

  2. Try closing and reopening the logcat; sometimes I found this is the only issue

  3. Try restarting the adb

adb kill-server
adb start-server
Mansion answered 7/2 at 12:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.