Why doesn't logcat show anything in my Android?

AndroidEclipseLoggingLogcat

Android Problem Overview


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

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

Android Solutions


Solution 1 - Android

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

Solution 2 - Android

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.

Solution 3 - Android

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.

Solution 4 - Android

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

Solution 5 - Android

Solution 6 - Android

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

Solution 7 - Android

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

Solution 8 - Android

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.

Solution 9 - Android

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.

Solution 10 - Android

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

Solution 11 - Android

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)

Solution 12 - Android

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

enter image description here

Solution 13 - Android

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

Solution 14 - Android

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

Solution 15 - Android

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.

Solution 16 - Android

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.

Solution 17 - Android

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.

Solution 18 - Android

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

Solution 19 - Android

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.

Solution 20 - Android

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.

Solution 21 - Android

What worked for me besides restarting Eclipse was:

  • Remove custom filters

After removing all filters, logcat was filled with text again

Solution 22 - Android

Close logcat and then reopen it from WindowShow ViewOthers.

Solution 23 - Android

If you're using Eclipse v4.5 (Mars) (at least, Mars.1 or Mars.2), try the solution described here: https://stackoverflow.com/questions/31403672/logcat-show-invisible-messages-in-eclipse-mars.

It helped in my case.

Solution 24 - Android

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.

Solution 25 - Android

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

Solution 26 - Android

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.

Solution 27 - Android

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.

Solution 28 - Android

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionTIMEXView Question on Stackoverflow
Solution 1 - AndroidMoMoView Answer on Stackoverflow
Solution 2 - AndroiddenispyrView Answer on Stackoverflow
Solution 3 - AndroidfyodorananievView Answer on Stackoverflow
Solution 4 - AndroidNick KahnView Answer on Stackoverflow
Solution 5 - AndroidNikola SmiljanićView Answer on Stackoverflow
Solution 6 - AndroidJustin BuserView Answer on Stackoverflow
Solution 7 - AndroidRolandView Answer on Stackoverflow
Solution 8 - AndroidmasarapmabuhayView Answer on Stackoverflow
Solution 9 - Androidseth yountView Answer on Stackoverflow
Solution 10 - AndroidChris LacyView Answer on Stackoverflow
Solution 11 - AndroidMaheshView Answer on Stackoverflow
Solution 12 - AndroidGennadiy RyabkinView Answer on Stackoverflow
Solution 13 - AndroidlorlessView Answer on Stackoverflow
Solution 14 - AndroidLarsView Answer on Stackoverflow
Solution 15 - AndroidTacB0sSView Answer on Stackoverflow
Solution 16 - AndroidJaswanth KumarView Answer on Stackoverflow
Solution 17 - AndroidSrikar ReddyView Answer on Stackoverflow
Solution 18 - AndroidPavle37View Answer on Stackoverflow
Solution 19 - AndroidSterling DiazView Answer on Stackoverflow
Solution 20 - AndroidWasif HamdaniView Answer on Stackoverflow
Solution 21 - AndroidsamView Answer on Stackoverflow
Solution 22 - Androiduser5085848View Answer on Stackoverflow
Solution 23 - AndroidDmitry FrankView Answer on Stackoverflow
Solution 24 - AndroidDevGoView Answer on Stackoverflow
Solution 25 - AndroidMarc CayuelaView Answer on Stackoverflow
Solution 26 - AndroidAMRAYView Answer on Stackoverflow
Solution 27 - AndroidTokenyetView Answer on Stackoverflow
Solution 28 - AndroidwittyurchinView Answer on Stackoverflow