I am experiencing a strange issue.
I am trying to collect some logs from my android phone using logcollector or aLogcat. Everything works just fine for my Nexus S and moto Defy but when I am trying to capture and send a log from Galaxy S the output is very very short. It captures only last few seconds of phone's activity.
Does anybody know how can I fix this?
Regards, Peter
Many possible things can be occurring here. Another process could be clearing the logcat buffer periodically (logcat -c). Galaxy S could have also modified the default buffer size for its logs to be very small (so it is constantly rolling them over). Other than that, who knows what it could be. The best I can think is to enable USB debugging and seeing if you can run logcat yourself and see what you can see (adb logcat). If you can see the logs fine then it is the app otherwise the system does not allow log collection.
use pipeline to save logs in text file from command prompt
adb logcat > logs.txt
Related
I'm seeing a small amount of logcat entries for my app since Android 13. I can usually only see a few minutes before plugging the phone in to check the logcat. If I leave it plugged in it doesn't clear and I can see as far back as I could when I first plugged it in. It's as if something is clearing the logcat. I have increased the log buffer size to 4M and then 8M and it's still the same. I should be able to see logcat entries from the previous day with such big log buffers. It's also the same whether checking the logcat from Android Studio or from the phone itself with a logcat reader app.
What should I check to solve this?
I have an app installed on my device.
An app that I developed, but I haven't got the source code anymore.
Is it possible to attach log cat to this app?
yes you can, just enable usb debugging on your android device, and plug the device where you have the application installed on it, by that, you will see all the logs on logcat.
Depends if you've left logs in the code. If you did, the easiest method would be probably going into your Android Studio and checking you Android Monitor tab. You can switch devices / applications there.
If you don't have any logs and your question actually means you want to add some logs in, then I'm afraid you can't reliably do that.
I can't figure out what is going on. I am using ANdroid Studio 1.6 and I have made sure I am set to "Verbose" and I have deleted all of my filters. However when I run an application on my device, I see almost no messages. Not absolutely nothing, but maybe a dozen I/D/E level messages from dalvik and the android runtime. NOthing from my application and certainly not enough messages that I would expect from a daily driver device that has a number of apps on it with online services.
I am so confused, I've looked in every corner of the Android Studio configuration and I can't see where I might be missing something. I KNOW that it is suppressing messages because when I use my on-device logcat reader, I see everything just as expected, and it's dramatically different from what AndroidStudio is showing.
Edit: going to terminal emulator on the device and starting log cat had the same effect (messages being hidden) so this must be on the device somewhere.
Tried logcat -c and checked ANDROID_LOG TAGS
Edit2: from terminal emulator if I just type log cat then I have the aforementioned problem. If I type su logcat however then I see everything. Why would I need superuser to view the full logcat?? How would I even instruct ddms to request superuser?
I was wondering if there is any way to get any feedback of what's going on behind the scenes when running an app on an Android device. If I use the emulator and eclipse I can see what's happening in the logcat. But I'm making a program with ROS android and it I cannot run it on the emulator. Now my program crashes and I don't know why. Is there any way I can get more information?
Thanks
You can use adb to debug the app on your device. See http://developer.android.com/guide/developing/device.html
I can think of a couple (less than elegant) ways to try and find out what's going on.
1) Display toasts from potential problem areas (Does it have a screen?)
2) Write logs to the SD card (does it have an SD card??)
EDIT
I wasn't thinking clearly... you have to be able to load the program to the device, so you must be able to connect it to your PC. So, as Agarwal pointed out, you can most likely hook it up, run it on the device/robot/whatever and see what happens with the logcat.
I use IntelliJ IDEA to write Android apps, and use the DDMS Windows application to view the Android logs (separate from the IDE). It works fine, but after a seemingly random period of time, the logs vanish, except for one line of log, which gets overwritten with incoming logs. I have to shut it down and restart it, which combined with the delays of deploying an app to a device over ADB to debug and test is pretty tiresome.
Is this a known issue with DDMS? Is there anything I can do to make it work consistently without breaking itself?
Are there any other Android log viewing applications for Windows that work better? I'm not very fond of the IntelliJ IDEA one. My favourite is actually CatLog on Android itself, but on a small-screen device it's not a great experience.
It's not about the time, but number of lines being recorded. As Dave C said in the comment, just clear the log and it will be fine
Have you tried looking at "Why doesn't LogCat show anything in my Android?"? The top voted answer may solve your problem