Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Blinking option in Connected Devices list that won't let me debug any app

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.

like image 213
Mariano L Avatar asked Jan 23 '19 17:01

Mariano L


People also ask

How do you enable USB debugging to test apps on your phone?

On the device, open the Settings app, select Developer options, and then enable USB debugging (if applicable).


2 Answers

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.

like image 72
Mariano L Avatar answered Oct 10 '22 17:10

Mariano L


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

like image 2
Stefano Mtangoo Avatar answered Oct 10 '22 18:10

Stefano Mtangoo