4

After android studio running several hrs,suddenly the connected device shows as offline.And what's annoying is that it always show an offline device no matter connecting or not by usb.

As what we always do, I try to call adb kill-server or adb start-server.From the process list, it shows an new adb.exe was created while the former one wont disappear even i try to stop it from the list.

So far my only solution is restart pc, i mean, FORCE restart.Normal stop or restart will keep my pc in the stopping screen.

Hope someone facing the same issues can support a better solution.Thanks anyway.

XYz Amos
  • 1,223
  • 11
  • 17
  • are you on linux or windows – zizutg Mar 08 '16 at 13:41
  • Try this my answer from this stackoverflow question[Here](http://stackoverflow.com/questions/20680658/eclipse-detecting-the-same-device-multiple-times/34510705#34510705) – zizutg Mar 09 '16 at 08:24
  • @zizutg as i say, manually kill process from the list doesn't work either. :( – XYz Amos Mar 10 '16 at 02:14
  • I have the same issue using Intelijj Idea 15.0.6, its very annoying, beacuse Windows doesn't shut down and additionally all my USB ports stops responding (can't eject any device). – Derek K Jan 09 '17 at 10:16

2 Answers2

2

Try to update your Android Studio to 2.2. After that you will be able to kill adb.exe if you need. That helped me fix that bug, but still facing it in 2.1.1.

Alex Ivanov
  • 364
  • 4
  • 14
0

This is how I deal with my case which happens periodically. Per the tip of this answer, I find the processes using port 5037 wit command netstat as following:

Microsoft Windows [Version 10.0.15063]
(c) 2017 Microsoft Corporation. All rights reserved.

C:\Users\Hong>netstat -a -n -o | find "5037"
  TCP    127.0.0.1:5037         0.0.0.0:0              LISTENING       9232
  TCP    127.0.0.1:5037         127.0.0.1:52034        ESTABLISHED     9232
  TCP    127.0.0.1:52034        127.0.0.1:5037         ESTABLISHED     10824

In the above results, process 9232 is adb.exe and process 10824 is Visual Studio. I can kill adb.exe after closing the other process using port 5037 - Visual Studio

Hong
  • 15,059
  • 14
  • 64
  • 105