5

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:

The option that appears

When the option dissapears

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.

Mariano L
  • 1,809
  • 4
  • 29
  • 51

2 Answers2

5

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.

Mariano L
  • 1,809
  • 4
  • 29
  • 51
  • I have same issue on mac. How I can fix this? – Lester Jan 25 '19 at 20:10
  • There must be some app listening in port 555* .... run the equivalent of netstat in MAC and it should appear wich app is doing that. – Mariano L Jan 26 '19 at 10:06
  • I used `lsof -i :5556` and got `...PID 6189...` Killing process with given PID didn't help – Lester Jan 26 '19 at 23:05
  • 3
    lsof -i :5556 will tell you the process that is using the 5556 port, then you should run: ps -x using the PID returned from the previous command to get the application that owns the pid You can then stop the application – mguest Feb 01 '19 at 16:09
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

Stefano Mtangoo
  • 6,017
  • 6
  • 47
  • 93