Android Logcat not showing logs when I switch devices

谁说我不能喝 提交于 2019-12-21 04:29:28

问题


I am trying to use Logcat to help diagnose my android issues. I frequently have a phone plugged in AND an emulator running. Sometimes I debug on the emulator, sometimes I debug on the phone, or maybe even a third device.

Logcat does not continue to show messages after a device is switched. How can I specify what Logcat does or force it to resume logging without restarting eclipse?

Insight appreciated


回答1:


I've noticed this at times. Usually one of two things does the trick. First, open the Devices view, verify that the new device is showing, and then switch back to Logcat. That seems to kick Logcat into action again.

If that doesn't work, then in the Devices view menu, select "Restart ADB" (I think that's what it's called; I don't have it open at the moment).

If even that doesn't work, then kill and restart the ADB server from the command line and repeat the above.




回答2:


If you are using Eclipse, switch to the DDMS perspective. There, logcat will be showing the log of the selected device in the devices View (Window -> Open perspective -> Other -> DDMS)




回答3:


You coupld use the CLI for ADB and reattach the debug process to your switched device. Then Logcat will pick the debug msgs from that connected device. Whatever device is actively connected to ADB will output through Logcat



来源:https://stackoverflow.com/questions/6628870/android-logcat-not-showing-logs-when-i-switch-devices

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