Android:log cat 在设备上运行时去哪里?
我在 mac 上使用 Eclipse 来开发 Android 应用程序。 当我在模拟器上运行应用程序时,日志猫窗口显示了预期的内容并且工作正常,但是当我在真正的 Android 连接设备上运行(甚至调试)时,我的日志猫窗口甚至不显示一行。
在真实的android设备上运行时如何处理log cat?
谢谢,
I'm using Eclipse on mac for developing android apps.
When I run the application on emulator the log cat window shows what is expected and do work fine but when I run(or even debug) on real android connected device my log cat window doesn't show even a single line.
How to deal with log cat when running on real android devices?
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您必须在DDMS环境中选择设备,Windows选项卡,选择“设备”,然后选择您的设备,即“HtXXXXXXX”。
You have to select the device in the DDMS environment, Windows tab, select "Devices", and then select your device, i.e. "HtXXXXXXX".
首先,设备是否真正连接?要检查设备是否已连接,只需在控制台上运行
adb devices
即可。它将列出连接到系统的所有设备。其次,只需在命令提示符下运行
adb logcat
命令,它就会单独显示logcat窗口。当许多设备连接到系统时,adb logcat 将显示以下消息:
- 等待设备 -
错误:多个设备和模拟器
因此要解决上述情况,您必须使用带有 -s 选项的设备 ID 运行命令。
例如:
adb -s emulator-5556 logcat
,这将显示模拟器的 logcat。First, Is device really connected? To check whether the device is connected or not, just run
adb devices
on console. It will list all the devices attached to the system.Second, just run the
adb logcat
command at the command prompt, it will display the logcat window separately.While many devices are attached to a system, adb logcat will display the following message:
- waiting for device -
error: more than one device and emulator
so to resolve above case, you have to run the command with device id with -s option.
For example:
adb -s emulator-5556 logcat
, this will display the logcat for emulator.连接到设备后尝试重新启动它。
Try just to restart it when you connected to device.