Android Debugging with Logcat and Emulator. Is it possible?

社会主义新天地 提交于 2019-11-27 12:47:09
fadden

You have a few options for viewing the debug log output, assuming you have the SDK installed and your command path set up correctly:

  1. Type adb logcat. The log output from the connected device or running emulator will appear. I usually prefer adb logcat -v time to see the time stamps.

  2. Type ddms. This launches the stand-alone version of DDMS. It has a logcat display at the bottom.

  3. Install the ADT extension for Eclipse, and open the logcat view. (Since you're using NetBeans I assume this isn't what you want to do, but I'm mentioning it for completeness.)

In all cases, the interaction is the same whether you're using a physical device or software emulator, because the ADB daemon conceals the details. Whatever you're doing for the device is also expected to work for the emulator.

If you have a device and emulator connected simultaneously, you can use adb -e logcat for the emulator and adb -d logcat for the device. From stand-alone DDMS or Eclipse, just pick the device or emulator from the pop-up menu.

If you have setup nbandroid you can find the adb logcat viewer in netbeans under: Window -> Output -> ADB Log

--edit Just followed up on the post above and started using C:\Program Files (x86)\Android\android-sdk-windows\tools\ddms which is alot better then the one in netbeans.

The SDK comes with a handy tool called ddms it should be in the tools folder of the SDK. At the moment an Emulator is running, or a mobile phone is connected to your machine it should show up in ddms and you can see all the log output in ddms.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!