问题描述
这是pretty的简单:我使用NetBeans在Linux上使用Android模拟器1.6。我的logcat在我的Android手机,但得到的消息某处读取的过程并不顺利的。
This is pretty simple: I'm using NetBeans on Linux with Android emulator 1.6. I have Logcat on my android phone, but the process of getting the messages to somewhere readable isn't smooth at all.
有人可以告诉我怎么去在模拟器上运行logcat的?有什么我可以做,看到调试信息等,然后还要将APK复制到我的手机和测试呢?
Can someone tell me how to get Logcat running on the emulator? Is there anything I can do to see debug messages other then having to copy the apk to my phone and testing it?
在此先感谢!
推荐答案
您有几个选项来查看调试日志输出,假设你已经安装了SDK和您的命令路径设置正确:
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)输入亚行logcat。从所连接的设备或运行仿真器的日志输出将会出现。我通常preFER亚行logcat -v时间看到的时间戳。
(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)输入DDMS。这将启动DDMS的独立版本。它有一个展示的logcat在底部。
(2) type "ddms". This launches the stand-alone version of DDMS. It has a logcat display at the bottom.
(3)安装ADT扩展Eclipse中,并打开logcat的观点。 (由于您使用NetBeans我想这是不是你想做的事,但我提到它的完整性。)
(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.
如果您有设备和仿真器同时连接时,可以使用亚行-e的logcat仿真器和亚行-d的logcat的设备。从单机DDMS或者Eclipse,随便挑设备或仿真器从弹出式菜单。
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.
这篇关于Android的调试与logcat中和模拟器。可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!