I would like to pull the log file from a device to my PC. How can I do that?
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
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.
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.
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/
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:
- connect the device to the pc.
- Check that I already setup my os for that particular device.
- Open a terminal
- Run
adb shell logcat > log.txt