问题
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