I installed Android Studio yesterday, and I tried to use the LogCat to see the logs. But there is nothing to show in the logcat. I used the terminal to run ./adb logcat
and it works.
Is there someone who can explain to me how to use logcat in Android Studio?
Restarting logcat helps me always.

I get into this state often. Logcat is blank. Debugging works, I can hit breakpoints. No filters are set. Log level is on Verbose. I fix it by repeatedly looping through the following:
- Restart logcat (see Zatziky's answer above)
- 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
And finally restarting the computer if all else fails.
The problem is intermittent, I think Android Studio is just buggy.
You need to press Alt+6 twice to restart the logcat window. That way it'll show the log outputs.
The problem mainly happens in debug mode.
These helped me :
1.Enable ADB integration





Best way to fix some unnecessary changes is to invalidate caches
Go to FILE -> click "INVALIDATE CACHES/RESTART" then a dialog box will pop-up, Select "INVALIDATE CACHES/RESTART" button.
Android studio will automatically restart and rebuild the index.
In android Studio application you need to click Debug application option (Shift+f9) to run in debug mode and to enable LogCat.
Not a technical answer but you might want to check the search box for the logcat. If there is any character inputted, your logcat will be empty as it will be searching for that certain character or word, and then if its not present, your logcat log will be totally empty.
Restarting Android Studio helped me.
**
- Read this if you are still stuck with logcat being empty
**
I've just solved this after MONTHS of annoyment and trouble.
Nothing helped, the device monitor worked fine during debugging but the standard logcat view was always empty.
The reason was annoyingly simple:
The logcat view was there but it had been moved to 0 width by an update!
You are in "ALT 6" Tab, you see two tabs in there "ADB logs" and "Devices | logcat"
Devices | logcat really means that it consists of Devices AND logcat, split by a vertical border.
The vertical border can be moved and during an update it seems to have moved to 100% right.
This results in the logcat to be collected but not displayed, move your mouse pointer to the right of the tool window and just DRAG logcat back into view.
This solution won't help everyone but I found many people with working ADB connection and still no logcat output, those might be hit by the same problem.
Try to close the project and re-open it .It worked for me. Logs will be reappear.
For me, the issue was that I had two emulators with the same name (I created it, deleted it, and then created it again with the same name). There were two emulator entries in the logcat dropdown and it was connected to the wrong one. All I had to do was switch to the other one. I prevented the problem permanently by renaming the emulator.
Run this command in terminal. It will start working again.
adb kill-server && adb start-server
In my case, in the developer options menu there is an option called
Revoke USB debugging authorisations
.
Once you revoke all the existing authorisations it will ask again to trust the computer that you are using after that it started to show the logs again.
On the right side of tab "Devices logcat" there is the button "Show only Logcat from selected Process". Its not perfect, because everytime I run another process I need to push it again, but thats the only solution that works for me. So far...
This may not be your issue, but I've found that when having multiple windows of Android Studio open, logcat is only directed to one of them, and not necessarily the one that's running an active application.
For example, Window 1 is where I'm developing a Tic-Tac-Toe app, and Window 2 is where I'm developing a weather app. If I run the weather app in debug mode, it's possible only Window 1 will be able to display logcat entries.
In Android studio 0.8.0 you should enable ADB integration through Tools -> Android, before run your app. Then the log cat will work correctly. Notice that if you make ADB integration disabled while your app is running and again make it enable, then the log cat dosen't show anything unless you rebuild your project.
In my case I just had filtered the output so it appeared empty even after restarting Logcat etc.
My problem solved, after I add android:debuggable="true" under application in your AndroiManifest.xml (even the ide mark as a wrong syntax!????)
For me, the problem was that the device was connected in the Charge only
mode.
Changing the mode to Media device (MTP)
(or Transfer files
in some devices) solved the problem.
In Android Studio 0.8.9, I opened Android Device Monitor, selected my emulator from the Devices list and got the output in the LogCat tab.
After that, I went back to the main view of Android Studio and selected Restore Logcat view in the right of the Android DDMS tab and there it was!
If this doesn't work, you could see your logcat in the Android Device Monitor as I explained in the first sentence.
Had the same issue today.
Apparently I had eclipse running too and all the logcat output was redirected to eclipse. Since the logs can only be shown at once place, make sure you dont have multiple debuggers running.
I just fixed it on mine. Look for tiny icons on the far right of the DDMS display which restore the Devices Logcat view and the ADB View.
When the DDMS first came up with both the "ADB Logs" and the "Devices | logcat" tab showing. The "Devices | logcat" is the one that should be showing the device output, but was blank. Somehow I managed to hide one or the other of those tabs, I forget exactly how. But, off to the right there was a tiny icon that said "Restore ADB" view, and I clicked it and it came up. Then there was another tiny icon that said "Restore Devices logcat view". I clicked that, and all of a sudden it appeared and was showing the device output again.
It's weird to still encounter this problem even on a recent version of Android Studio. I read through the long list of solutions but they did not work for me. The accepted answer worked on an earlier version of Android Studio ( I guess it was v2.3)
I did the following to get Logcat working again:
- Logcat > Show only selected application > No filters
- Logcat > No filters > Show only selected application
I expected resetting logcat should ideally give me the same effect but it didn't. Manually toggling filter was the only thing that worked.
This is on Android Studio 3.0.1 (stable) (I can't update it before finishing the current project) The issue occurred when I started Android studio in the morning to continue the work I left at night. I hope the devs will look into this. It was painstaking to try over 15 solutions from stackoverflow and still see no result. It's even irritating to reveal another solution for future victims of this issue.
Logcat has a little icon to the right of logcat. You can use the icon to turn logcat on and off. I can usually make logcat active by clicking the icon (maybe several times).
Full nuclear solution. ONLY USE THIS AFTER TRYING EVERYTHING ELSE because this will erase all your settings and preferences as well as stored images and everything that makes your emulators run until you reinstall and reconfigure. In my case it took about 20 minutes for both steps because I didn't customise a lot except for using Darcula.
- Delete your .AndroidStudioBeta config files directory
For linux users this is found under /home/[username]/.AndroidStudioBeta
For windows users, I'm not sure. The documentation on it is rather vague in my opinion. Probably somewhere under C:\Users[your user]\Application Data
- Check to see if it works yet, if it doesn't then also reinstall the SDK.
Rather drastic but I tried all the other things on this page, connected device, no filters, restarting the service, everything on this page and it just didn't work.
For me it was not working only for my application, it was working, if no filter has been selected (option on right side). But I needed to see only my app, therefore I found out, that if I do my own filter and filter it to package name, it is working as it should. I hope it could help to you too : )
Make sure you have enabled the build variant to "debug" in the Build Variants context menu. (You can find this at the bottom left corner of the window). This option will be set to release mode, if you have signed the apk for the application previously. This causes the debug messages not to show in the log cat.
来源:https://stackoverflow.com/questions/17432358/android-studio-logcat-nothing-to-show