Enable Log messages from real device on Logcat

前端 未结 4 1021
醉梦人生
醉梦人生 2020-12-21 00:37

For my android app development, I am trying to get logcat messages from my real device (when starting an app on it from eclipse) and not just from my emulator.

Does

相关标签:
4条回答
  • 2020-12-21 01:16

    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.

    0 讨论(0)
  • 2020-12-21 01:24

    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.

    0 讨论(0)
  • 2020-12-21 01:26

    I think you should install first a suitable usb driver for your android device then your eclipse will recognize your device as an android device and start debugging

    0 讨论(0)
  • 2020-12-21 01:31

    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).
    0 讨论(0)
提交回复
热议问题