views:

47

answers:

2

Hi,

I am no good with hardware concepts. So I have this probably very silly doubt.

I want to add Log to my application. When running on an emulator, I know where to see the Log output - it's visible in the Logcat window of Eclipse.

I want to know where I can see these logs when I run it on a hardware device. I am using following command to load my app on to the device : ./adb install helloWorld.apk

So where will the log be created and under what name?

Apologies if the question is vague or silly. I really do not know more details.

-Kiki

+1  A: 

Try to use:

./adb logcat
kogut
Yes, that helps me view the log.Is there a way to filter out the other log messages and view only the ones I have logged in my app?
kiki
Do you have a common TAG you use for logging?
joki
`adb logcat | grep "whatever"`?
Felix
Yes, a TAG is used. Is that to be given in "whatever"?..i.e adb logcat | grep "TAG"
kiki
One more little doubt..Is this logcat available as a file? I mean, if I want to do some more logging, in software layers below the android application layer, can I give the path of the same LogCat file? When working with emulator, I observed that no such file is created as such in my workspace.
kiki
logcat is a program.You can use: "adb logcat > log.file", then you will get your logs stored inside the log.file
kogut
hmmm, that command will save the current logcat into log.file, right? Will it continue futher logging into that file?
kiki
A: 

When you run on device, the log is also available in LogCat. You will need to turn on USB debugging (Settings > Applications > Development > USB Debugging) in your device, then you can use LogCat just like in the emulator, both using ./adb logcat and in Eclipse.

Lie Ryan