adb logcat - no output, adb shell works though - android

I have a strange problem after Oreo update - 'adb logcat' stopped working.
Note that device is properly connected - I can debug, I can view logs in Android Studio, even I can start adb shell and do logcat but no direct logcat out from the adb command.
So in short,
# adb logcat
Absolutely no output. However, following works (logcat from the adb shell)
# adb shell
logcat
Any idea?

try these steps (even though your logcat is open)
in android studio go to
View->Tool Windows->Logcat
see if it works

Related

Detecting if emulator has started completely

I want to check if all the emulators has booted successfully. I have tried with this command adb shell getprop sys.boot_completed this works if i am running one emulator. But if i have more than one emulator this command returns error as following: error: more than one device/emulator.How to solve this?
You should specify the device serial number on the adb command line to let it know which one you want to interact with.
Something like
adb -s emulator-5554 shell ...
Also, if you are doing it from the command line, multiple times and you are starting to be annoyed by that, you can try https://gist.github.com/dtmilano/4537110 which allows you to select the device
$ adb shell
1) 02783201431feeee device 3) emulator-5554
2) 3832380FA5F30000 device 4) emulator-5556
Select the device to use, <Q> to quit: 1
$

ADB not working anymore

$ adb kill-server
$ adb start-server
None of the above commands give any response the command gets stucked and give no response. It used to work before but dont know why it stopped working.
Android studio also gives a popup saying error initializing adb.
$ adb devices
List of devices attached
It gets stuck here
Please Help
My os Ubuntu 16.4.

Debugging a WebView (Ionic) app on Android via logcat

There are several questions about the subject, however not one of them seems to address the particular problem I'm having.
I'm developing an app with Cordova/Ionic, and printing debugging info I was outputting with console.log() by using adb logcat CordovaLog:D *:S was working just fine until some updates. Now I can't seem to figure out how to properly filter logcat's output so I could only get the debugging info from my app.
Logging itself works. If I set no filters and redirect output to a file, I can see my debugging info among all the other debug messages, and it looks like this:
I/Web Console: Event triggered: device.ready:1
Logging to screen also works, but at a rate of approximately 100 lines per second. I've tried at least the following to filter output:
adb logcat -s "Web Console"
adb logcat "Web Console":V
adb logcat "Web Console":*
adb logcat -s Web
adb logcat Web:V
adb logcat "myApp":V
adb logcat myApp:V
adb logcat -s myApp
... and probably others I've already forgotten. They either print absolutely nothing, or absolutely everything from the system services.
I'm on Windows so I can't grep, and the device I'm debugging on is running Android 4.2.2 so I can't use GapDebug, and neither does it seem to be possible to access the device's log via chrome://inspect in Chrome.
I really, really would like to understand how filtering logcat's output works. I'm not willing to log everything to a file and then shift through that.
It seems that logcat can not properly parse tag names with whitespaces. So instead I suggest using grep on the device:
adb shell "logcat | grep 'Web Console'"
Alternatively when runing adb on linux or unix based os/git bash:
adb logcat | grep 'Web Console'
What works for me in 2019:
adb -d logcat chromium:I *:S
The -d indicating a physical device in my case. If all else fails just dump the results of adb logcat into a text file and do a search for "CONSOLE", that will give you the provider for your logcat filter. It seems this changes over time, and depending on your particular dev environment.
While you can use grep under Linux/Unix, findstr might be your choice under Windows:
adb logcat | findstr /C:"Web Console"
If you prefer to use grep under Windows, you can get it from
http://gnuwin32.sourceforge.net/packages/grep.htm.

adb install doesn't stop when adb klill-server has been started

This is my first post here, so first of all, hello everybody!
I am not sure if it is bug or a feature:) but I have noticed that when you will run adb install with no device connected, it firstly starts adb daemon (if was not currently running), and then wait for the device. After that, when you open new window and run adb kill-server, adb install command will not stop, but shows protocol fault and then restart adb daemon again.
There is no other way of stopping this, than killing the process (for example using ctrl+c).
Screenshot
I have also noticed that other commands like adb shell, adb devices, adb wait-for-device doesn't act like adb install - stop when adb kill-server will be lunched.
My version of ADB is 1.0.31
I have tested this issue on Linux and Windows, and both works the same.
Please let me know, what do you think about it.
Best Regards,
Pawel

adb pull freezes when it encounters kmsg

I'm trying to debug why my android mobile will not boot. When I run:
adb pull / e:\temp
It freezes at
pull: /proc/kmsg -> e:\temp/proc/kmsg
Is there some way to stop it freezing here or to get 'pull' to by-pass this file.
(I'm running this command while the phone is sitting in the recovery menu as I cant get adb to run in any other state).
Samsung Galaxy GT-i5500, android 2.2, windows 7.
You can instead dump the log using
adb logcat -d > log.txt
This will provide you with the log which you can use to debug the issue.
Run-time messages can be obtained through
adb shell dmesg
For kmsg, the following command can be tried.
adb shell cat /proc/kmesg

Categories

Resources