views:

553

answers:

5

I would like to pull the log file from a device to my PC. How can I do that?

A: 

The first stop for all Android questions is the Android Developers site.

This question is addressed here: http://developer.android.com/guide/appendix/faq/commontasks.html#logging

chr
But that link describes how to do it on the emulator, right?
aioobe
That doesn't count, either emulator or real device it has too work. As far I got, I must have the adb running and ddms.
Pentium10
A: 

I think you can only do it if the device is connected to the PC, using your USB cable and with USB debugging selected. You can then view the log file just as you would when using the emulator.

beetstra
A: 

EDIT:

The internal log is a circular buffer in memory. There are actually a few such circular buffers for each of: radio, events, main. The default is main.

To obtain a copy of a buffer, one technique involves executing a command on the device and obtaining the output as a string variable.

SendLog is an open source App which does just this: http://www.l6n.org/android/sendlog.shtml

The key is to run logcat on the device in the embedded OS. It's not as hard as it sounds, just check out the open source app in the link.

Brad Hein
This dumps the output to the screen, I need it in a file.
Pentium10
You can send logs with aLogCat. Or simply copy-paste from DDMS :P
molnarm
@molnarm I concede my answer was slightly over-engineered if that's all he needs to do =)
Brad Hein
+1  A: 

A simple way is to make your own log collector methods or even just an existing log collector app from the market. For my apps I made a report functionality which sends the logs to my email (or event to another place, once you get the log you can do whether you want with it). Here is a simple example about hot to get the log file from a device: http://code.google.com/p/android-log-collector/

Moss
+1  A: 

Logcollector is a good option but you need to install it first.

When I want to get the logfile to send by mail, I usually do the following:

Macarse