Blinking option in Connected Devices list that won

2020-03-03 06:20发布

问题:

I have this weird problem that I have a blinking option ( appears for a second and then it's gone; and then appears again and so on) when I try to deply an app in the connected devices:

When I try to debug the app in any connected or virtual device I get this error:

01/23 18:49:36: Launching app
$ adb push D:\xxx\app\build\outputs\apk\debug\app-debug.apk /data/local/tmp/com.xxx.appname
Device emulator-5556disconnected, monitoring stopped.
Error while Installing APK

I'm not trying to deply in that ghost device. I don't know that emulator-5556 is. Tried virtual and real phones with the same error. The only thing I can do to make it "work" is doing and adb kill-server and select the device I want to debug fast. Before the emulator-5556 device starts appearing again.

The problem is after that, If I need to debug again(because I did some change of something like that) I need to kill ADB again because the emulator-5556 device is blinking again. It's really annoying.

回答1:

I executed this command:

netstat -anob

And realized another unrelated app was using port 5556:

  TCP    0.0.0.0:5556           0.0.0.0:0              LISTENING       12724
 [videostream-native.exe]
  TCP    0.0.0.0:5557           0.0.0.0:0              LISTENING       12724
 [videostream-native.exe]

Videostream is the app to stream video to chromecast. That was the culprit. Killed the process and now is not blinking anymore.



回答2:

I faced same issue on Mac and couldn't find it fully addressed anywhere. This SO answer and many other I read gave me a hint.

  1. I opened Mac network utility (Command+Space and then type network utility). Select port scan tab
  2. In address I put 0.0.0.0 for any local address
  3. Click scan. Check port that is closer to what the Studio is complaining. Mine was complaining 55580 and scanner showed up 55581.
    1. Then check which process ID is running on that port with lsof -i :<PORT>
    2. Then check process details with ps -x <PID>

Close that specific app that is causing the issue. For me it was VS Code