I am getting an endless stream of
E/IMASDK: Received monitor message: getViewability for invalid session id:
and it's making it impossible to see any other log statement in my LogCat. Does anyone know how to mute such a specific nuisance?
On the command line you can run something like
adb logcat IMASDK:S
to see log output but with IMASDK messages silenced. Android Studio also has support for filtering log messages. You can find it if you poke around in the UI a bit.
Related
I am trying to get at the Bluetooth data needed to control my Bluetooth lamp. I have created the bt_snoop file after successfully controlling my lamp through the app. I've done this many times and I always get the same result.
When I open bt_snoop in Wireshark and filter for my device all of the data has a warning: "[[Expert Info (Warning/Malformed): Length too short]". It also says "Payload: MISSING". I am able to control the light through the app, but the bt_snoop log just shows that error. I'm really lost and would really appreciate help!
I am automating an Android application and I need to be able to capture logs while I am running the automation tests. I have tried using a terminal emulator but this only seems to give console logs. Next I tried using
log = subprocess.check_output(["adb", "logcat"])
But when I do this my automation script stops indefinitely (presumably because it is waiting to continue after the logcat capture is complete), which does not work for me because I need the logcat to run in the background, while my script is running. So maybe 'Popen' is the way to go, and then pipe the output? Thank you!
The logs are always "running in the background", it's just whether you're looking at them. I would suggest instead, when you need a log dump, using
adb logcat -d
which will dump what it currently has, then exit.
So at the start of your test run:
subprocess.call(shlex.split('adb logcat -c'))
to clear the logs.
So at the end (and before any restart), dump the logs:
log = subprocess.check_output(shlex.split('adb logcat -d'))
with open("loggy.file", "w") as f:
f.write(log)
I'm having a strange issue when I run my application from Android Studio on my device. When the HDMI cable of my device (e.g. Odroid) is disconnected (no other video output connected), I found in Logcat this error "The application may be doing too much work on its main thread". When a monitor is plugged the error did not show anymore.
Do you think is something related to the code or just a random error not relevant?
PS I need to use my app without video output.
PPS The error appears only when the monitor is not plugged.
It seems that , there is some waiting mechanism in your code , So I suggest you to shift your code into AsyncTask so you will never encounter this error.
http://developer.android.com/reference/android/os/AsyncTask.html
I am not using Eclipse or Android Studio, I am just compiling my code myself and installing with adb.
If an uncaught exception or error occurs, it prints the the line number of the code that triggered it, but not the message.
If I call Log.d or Log.i, etc. , nothing happens. If I catch an exception and call e.printStackTrace() or System.err.println(), nothing happens.
What could be the issue?
Update: By the way, I am accessing logcat via the Android Device Monitor.
Update: It works fine using adb logcat. I just need it to work from Android Device Monitor now.
Make sure you don't have any filter set.If you just use the following command you should be able to see all the logs.
adb logcat
if you want to see only logs with particular tag:
adb logcat -s "TAG"
Also make sure when you building the apk,you don't have any code that is disabling the logs-because its a release binary.
If you are viewing through IDE logcat view remove the filter.It must be there left hand side corner.If the filter level is error,you need to make it verbose.
I think your log level is too high for Log.i and Log.d (for example, if your log level is 'error' you only get error messages)
So set your log level to verbose to display all logs.
You can find the log level indicator in the top right of your Android tab in Android studio
How can I see timestamp in Logcat? Is there any application which shows me the log along with the timestamp? Also, how can I increase the size of the Log in andriod phone?
To get timestamps: logcat -v time
To run logcat on the device at a shell prompt: logcat
There are several free logcat viewers for Android. I've heard that aLogCat is pretty good.
EDIT
You can set your preferences in aLogCat to see the time.
Regarding your second question, I found an answer here:
The logs are held by a kernel device; the entries are in /dev/log.
The buffer is currently 64KB, and there is no way to change the size
on a production device.
The easiest way to keep more of the log is to run "logcat" and send
the output to a file. logcat runs on the device, so you could run it
there and redirect it to (say) /sdcard/log.txt.