简体   繁体   中英

Android LogCat device disconnected

I'm struggling a bit with Logcat. The phone disconnects from LogCat with the message "Device Disconnected" every time I push a button changing intents in my program.

What can cause this? And Why? Could it be my code throwing a error disconnecting LogCat? Or is this a LogCat issue?

I'v tried to restart eclipse, and stop the adb.exe process with no luck.

 : E/(): Device disconnected

There may be some sync problem in DDMS. Just restart the eclipse it will work fine.

This is a real problem in Eclipse DDMS. If you run adb logcat at the same time that Eclipse shows "device disconnected" you will most likely still see logcat output (this is what happens in my case). Only real explanation I can see is that DDMS has a bug.

My solution? Switch to IntelliJ. It doesn't have the same problem, or any similar problems that Eclipse DDMS has connecting to devices which are recognized by adb.

Here is commented a solution that works for me, Clear Log :

LogCat Stops Running in Eclipse Needs Restart

Just Type This Command In Terminal

adb devices

u should see this log:

List of devices attached
adb server version (40) doesn't match this client (36); killing...
* daemon started successfully *
FA57NY900383    device

And Run Again, Your application starts to run on your device

So I resolved the issue. I'm not sure what part did the trick, but I noticed javaw.exe was running on the computer even though eclipse was closed. So I forced closed this one, unfortunately I also re-installed my Jelly Bean ROM. So I'm not sure what exactly did the trick. I bet it was the phone though.

I restarted my device , closed eclipse , used a command prompt opened at android-sdk/platform-tools to run adb kill-server , reopened eclipse , and then used that same command prompt to run adb logcat .

My problem was then fixed, though I'm not sure which step fixed it.

I had this same problem where it kept saying "Device Disconnected" when I could clearly hit Debug and select my phone, but for some reason I was expecting the LogCat to already be going.

But it will not be going if the phone is locked (facepalm).. After unlocking it seems fine.

Hope this helps someone else that doesn't realize their phone is locked when trying to debug / use LogCat.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM