Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio 2.1.1: "no usb devices or running emulators detected"

Suddenly my Android Studio stopped detecting all my devices, none of them is working. It happen from one execution to another. I've changed a few lines of code (1 min maybe?), hit run (instant run) and then I missed all my devices.

I'm using a Mac and as devices: Nexus 5x, Galaxy s6 and Oneplus One. What can be happening? I've checked previous questions here and tried all this:

  • Run configurations: no matter if I chose usb device or show the window, it does not work.
  • Tools > Android > Enable ADB integration: didn't help
  • Command line adb devices does not detect any either.
  • I've revoked and granted again USB authorizations. Still not working.
  • I've tried other apps I have, none work.
  • Restarted phones
  • Restarted android studio
  • Restarted computer

(Note: if I start an emulator it works, but I'd prefer to use physical device since I have to scan real barcodes)

Thanks a lot in advance.

like image 868
Alberto Garrido Avatar asked Jul 12 '16 10:07

Alberto Garrido


2 Answers

On Lollipop 5.1

  1. Go to About Phone
  2. Click 7 times on Build Number. Now Developer options are enabled
  3. Go back and Click Developer options
  4. Enable USB debugging under Debugging.
like image 197
Naveen Paul Avatar answered Oct 12 '22 23:10

Naveen Paul


Well, I've fixed. The problem in case any faces the same was a Stetho (http://facebook.github.io/stetho/) tab in chrome, the one you open by typing: chrome://inspect/#devices not sure about the reason because it's been open for 2 days now, but it was the cause, once I closed it, it worked.

Found this unaccepted answer here: macbook adb cannot open interface That for sure should be accepted.

EDIT: I've been able to replicate the problem. It happens when you have the devices tab open and try to run a second app that has stetho configured.

like image 40
Alberto Garrido Avatar answered Oct 12 '22 22:10

Alberto Garrido