44

There is very awkward thing I am facing. Logcat is shown in debugging application, but while running (not debugging) application, it is not showing Logcat.

I tried restarting it but nothing is happening.

live-love
  • 48,840
  • 22
  • 240
  • 204
squiroid
  • 13,809
  • 6
  • 47
  • 67
  • Sometimes it takes 1-3 minutes after recognizing the device before the logcat is shown. Any idea on how to fix it would be great. – ByteHamster Mar 02 '15 at 17:02
  • I tried it multiple times but nothing is showing inside the logcat tab while running the app instead logs are generated during debugging. – squiroid Mar 02 '15 at 17:04
  • just FYI, I restart all ,and log cat still doesn't show anything, but seems after I choose another process to show then change to the app under debug, and check "Show only selected application", then it begin to show. Not sure whether these are the reasons to solve the problem. – jw_ Jul 15 '19 at 05:11
  • Simply restart your device developer settings – simon Oct 01 '20 at 16:12

30 Answers30

82

enter image description here

In my case 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.

I even tried restarting the logcat, that didn't work too. No Filters did the magic.

Hope this helps someone.

Edit: You can as well select Show only selected application for logcat to show only the current debugging process, i.e your app.

Cletus Ajibade
  • 1,550
  • 15
  • 14
39
  • You may be hiding it, 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.

einverne
  • 6,454
  • 6
  • 45
  • 91
Tristan
  • 3,530
  • 3
  • 30
  • 39
19

In Logcat window reselect your device then reselect your app

if it didn't appear restart adb using two commands:

adb kill-server
adb start-server
Nimantha
  • 6,405
  • 6
  • 28
  • 69
Mohammad Alotol
  • 1,409
  • 15
  • 23
6

Besides what other guys said, look if you have written something in the search box that causes this problem(it was my case).

Note: Even in case of a restart, what you have written in search box won't delete and you need to delete it yourself. enter image description here

Mehrdad Salimi
  • 1,400
  • 4
  • 16
  • 31
6

Try the following Steps:-

Step 1. Goto File > Invalidate Caches and Restart > Invalidate and Restart. Android Studio will restart automatically and logcat will work as expected.

Refer screenshots :

enter image description here Click on Invalidate and Restart

Step 2. If Step(1) didn't worked then try this : Goto Terminal > cd till your platform-tools directory (eg. in Windows default location is C:\Users\\AppData\Local\Android\Sdk\platform-tools). Now type following command :

adb kill-server

adb start-server

enter image description here

Step 3: If Step(1)&(2) both didn't worked then simply try clicking on Re-Start Logging button available in Logcat option. Refer screenshot - (Green colour curved arrow with grey box)

enter image description here

pravingaikwad07
  • 482
  • 1
  • 7
  • 24
5

First, my problem: I was testing an app on a Samsung Galaxy A3 attached via usb cable. I was getting the usual logCat messages, including the filtered ones then all of a sudden the logCat stopped displaying filtered messages. Setting it to Verbose displayed a continues stream of messages with a message at the top left corner of the logCat stating "too much output to display".

I tried restarting Android Studio (with and without clearing the cache) but no luck. I then rebooted my phone and everything was back to normal. So it appeared that the attached phone was the problem, sending too much info to the logCat.

hata
  • 11,633
  • 6
  • 46
  • 69
Clive Sargeant
  • 622
  • 11
  • 24
5

For real device, not for the emulator:

The only thing that I did was unplug the USB cable then plugged it in again. And it worked.

necip
  • 333
  • 4
  • 11
4

on The top left of logcat there is an option to choose the emulator. may it's not selected the current emulator by default. try to changing it to current emulator and it will fix.
image

Ori Marko
  • 56,308
  • 23
  • 131
  • 233
Ehsan.sarshar
  • 119
  • 1
  • 1
  • 6
3

Restart both the emulator and Android Studio.

Nimantha
  • 6,405
  • 6
  • 28
  • 69
Mabad
  • 439
  • 1
  • 4
  • 6
2

I have solved this issue by enabling "Use libusb backend" option in Android Studio -> Preferences -> Debugger -> Android Debug Bridge (adb).enter image description here

Mariusz Wiazowski
  • 2,118
  • 1
  • 16
  • 17
2

Helped restart the device (HTC)

Nimantha
  • 6,405
  • 6
  • 28
  • 69
Leonid Ivankin
  • 579
  • 4
  • 9
1

I fixed the issue by changing the USB Options of my phone from "Charging only" to "Transfer files (MTP)"

1
You need to press Alt+6 twice to restart the logcat window. That way it'll show the log outputs.


Go to your sdk Folder --> Platform tools -->  adb  click 2 times 

using this adb server restart again 

Please check your Sdk Location My Location is d drive Please See This

enter image description here

enter image description here

Keshav Gera
  • 10,807
  • 1
  • 75
  • 53
1

In my case when select No Filters, I see

logcat: Unexpected EOF!

then I fixed it by:

adb logcat -G 100M

See Logcat crashes with error: unexpected EOF

Fangxing
  • 5,716
  • 2
  • 49
  • 53
0

I had this code:

 Log.e(getMyName(),message);

The problem with this was, the variable that the getter method was accessing was null. Android Studio did not give me any error about it! Seems this was silently not letting the Log.e statement to work. I checked many blogs but couldn't find the solution. This small miss wasted my complete one hour. Hope this helps someone.

Kapil Bhagia
  • 65
  • 1
  • 7
0

Check you don't have something in the logcat search that returns no matches, for example a non existent package name.

I had renamed my packages, but left an old name in the logcat search field.

Result: No logcat output visible

Nimantha
  • 6,405
  • 6
  • 28
  • 69
0

I tried to switch "Extended log" in my device settings from "Selectivly" to "Allowed" and it helped. Now debug info appears in LogCat.

Andrew
  • 1
  • 1
0

I had the kind of issue the way which got me the logcat to work was that I was not choosing the right filter. as I was using SQLite (Database) and in filters I had chosen Firebase.so that's why my logcat was not working.

Nimantha
  • 6,405
  • 6
  • 28
  • 69
0

Cleaning and then Rebuilding fixed it for me. Apparently when I ran, it wasn't actually rebuilding the APK, just running the one that had already been made.

Nimantha
  • 6,405
  • 6
  • 28
  • 69
djsavvy
  • 106
  • 1
  • 2
  • 9
0

I had the same issue, and I resolved it by the following actions:

First, open the terminal in android studio and navigate to the following path:

C:\Users\user_name\AppData\Local\Android\Sdk\platform-tools

Second, enter the command: adb reboot.

It takes about 2 minutes, but now logcat is functioning again and showing every logcat.

Omri Attiya
  • 3,917
  • 3
  • 19
  • 35
0

This problem appeared after reinstalling (changing) GitHub in Android Studio. it happened when I connected the GitHub Desktop (git.exe) to the Android Studio. And right after that logcat fell.

Solution: commit + push = fixed logcat))

I did not understand how it works, but it is a fact

StasP
  • 1
0

I had the same problem. I tried killing and restarting the adb-server, but it didn't help. I deleted the debug apk of the app in the path:

<your_app>/<your_app>_app/build/outputs/apk/debug/

And run the project again. It solved the problem for me.

0

If your app has crashed, there is a dropdown that has 2 process, you have to select the other process that is dead, so you can see the error message:

enter image description here

live-love
  • 48,840
  • 22
  • 240
  • 204
0

A better approach (for ADB wifi and USB both )and it Always works Magically!

First, run the app:

enter image description here

Then stop before it launch the app: enter image description here

You have to stop as soon as the red stop button becomes red from gray (which happens after Gradle build complete). In this way, you will start seeing logs, errors everything in the run tab. There is no need to unplug and plug USB. No need to restart ADB server.

Make sure you repeat this process until you see the logs (usually takes 1 or 2 repeats) (One request - Please upvote)

Second Master Approach:

In your emulator or android device, launch the app manually and close it manually. Then launch it from android studio.

Vijay
  • 1,163
  • 8
  • 22
0

I tried all steps and debugging just to find out that I had accidently typed a space in the filter.

Make sure that in your Logcat Windows a space is not chosen as a Filter.

Nimantha
  • 6,405
  • 6
  • 28
  • 69
evoships
  • 1
  • 1
0

There will be a search bar, keep it empty. It worked in my case.

0

Don't do anything, if you run app in emulator or device just uninstall and reinstall the app. Done.

flyingfishcattle
  • 1,817
  • 3
  • 14
  • 25
0

Try restarting ADB using the below commands:

adb kill-server
adb start-server
artenson.art98
  • 1,543
  • 15
  • 15
0

File --> Invalidate caches/Restart

This solved my issue.

Aishwarya
  • 151
  • 1
  • 5
0

Simple invalidate cache and restart worked for me.

Srikanth Reddy
  • 119
  • 1
  • 5