views:

98

answers:

3

Hi folks,

while my time developing on android I was looking for a functionality to get logcat messages from my real device (when starting an app on it from eclipse) and not only from my emulator...

Does someone know how to enable such a feature?

greetz. poeschlorn

+3  A: 

It works like the emulator, use the ddms or eclipse plugin to get the logcat from your app running on devices.

Otherwise you have always the options to use a Log Collector app (download a free one from Market), you can tell your users to use such app if they want to send you the log.

Pentium10
Mhhh, while using my emulator I get LogCat entries, but when I start the same app at the same way on my phone I don't see anything
poeschlorn
+5  A: 

You need to enable USB Debugging on your device. Go to settings, applications, development and tick "USB Debugging". Then when your device is connected by USB you can see its name in DDMS as if it was another emulator.

James
in a strange way, it doesn't...usb-debugging has already been enabled
poeschlorn
aaaaaah, I found it out :) I just had to click at the device in DDMS to enable logcat for it. Thanks for the hint :) Reading can be useful ;-)
poeschlorn
+3  A: 

Sometimes, you have to explicitly enable debugging on a real device.

  • It could be that a device android image is built with debuggable property as off (you can check that by running adb shell getprop). In this case you need to declare your app as debuggable in the AndroidManifest.xml (<application .... android:debuggable="true">). This is actually explicitly stated in the Android Dev Guide here (Under Set up your device for development, which also mentions turning on "USB Debugging" and a couple more tweaks).
  • Some devices (e.g. Motorola Cliq) disable by default all verbose and debug log messages. For it to work, you must run adb shell setprop log.debug_level 1 on the device and only then debug messages work (that is, until you power-cycle the device).
adamk
everything on http://developer.android.com/guide/developing/device.html has been done already...this is very strange...
poeschlorn
and the debuggable="true" has also been added ...
poeschlorn
What device are you working on? Do you see any logs, or is it just your app's logs are missing?Did you try to emit logs at all log-levels?
adamk