34

After installing android studio, I installed ADB as well. However, for some reason ADB doesn't detect my device. To make a note I think I have done all the basic stuff I found online, i.e.:

  • Set device in Developer mode and enable USB debugging

  • Cable works well (Android file transfer automatically opens when I connect the device)

  • Installed Java JDK 8

  • I have done 'adb kill-server', restarted my device and Mac but still not working

I'm using Android Studio 2.2 and running Mac OS X Sierra on my Laptop, and the android phone is running Android 5.0.1 (on an LG Phone)

NB: I have tried the other solutions on stack overflow but thats not the problem.

ADB (is installed) and works from the command line, but when I run :

  • 'adb usb' command, it says 'error: no devices/emulators found'
  • 'adb devices' command, it prints 'List of devices attached' with an empty line beneath.

I believe this is a specific issue and the general solutions to install ADB or restart doesn't work here as I have tried all that.

  • I have removed and reinstalled android studio, still not working.

  • I have removed and reinstalled adb and adb & fastboot, still not working.

  • I have restarted my device, disabled and re-enabled developer mode, still not working.

  • Obviously, I have unplugged and plugged the cable back in several times, still not working (only Android File Transfer keeps coming up)

Just in case, I have rooted my device, could that be the problem or that doesn't matter?

Willi Mentzel
  • 21,499
  • 16
  • 88
  • 101
A-Majeed
  • 1,136
  • 1
  • 9
  • 12

10 Answers10

55

You basically need to set the USB mode to PTP mode instead of Media Transfer Protocol (MTP) mode.

When I connected the device via USB the USB icon and Debugging Mode Icon appeared on the status bar on the device.

If you open control center by swiping down from the top, you should see a "Media device MTP" - Tap for more USB options. Tap it and switch the mode to "Send Images (PTP)" mode and it should ask you if you want to enable USB debugging. Enable it and the device should be recognized by ADB and Android Studio now.

Willi Mentzel
  • 21,499
  • 16
  • 88
  • 101
A-Majeed
  • 1,136
  • 1
  • 9
  • 12
  • This worked for me too. I had no issues for a long time, but suddenly found that my Android phone was not being detected on my MacBook. Now, whenever I have a similar issue, I "open control centre by swiping from the top" and then toggle MTP off/on and it seems to fix the issue for me – Various Artist Mar 16 '17 at 17:44
  • 1
    Didn't work for me. I'm using a Galaxy S4. Any other advice? – Josep Valls Apr 05 '17 at 15:27
  • Didn't work for me too, i got this problem after install tizen studio – Muklas Jul 22 '17 at 08:28
  • I had to switch my Pixel 2 to "USB tethering" for it to register in Android Studio – Kim T Jan 10 '19 at 23:04
  • Worked for me on Samsung S9. I had to choose "Charging only" as USB option for some reason. – Ariel Vardi Aug 21 '19 at 20:38
  • I've been looking for this answer for ages, this solved my problem entirely!!!!! – ludacris2k4 Nov 08 '19 at 18:05
22

I just clean installed my MBP and encountered the same issue. I tried the things suggested here but nothing worked.

What I had to do to fix it was "Revoke USB debugging authorizations" from the Developer options.

Once I did that, it offered up the usual "did you want to allow debugging on this device" option, and everything was back to normal.

Willi Mentzel
  • 21,499
  • 16
  • 88
  • 101
David Mariner
  • 246
  • 2
  • 2
  • 2
    After half an hour and doing everything, THIS fixed it! Actually, this, plus then changing the USB port going into the computer. – Brad Caldwell Jan 06 '18 at 03:30
13

Go to developer options and enable USB Debugging:

Settings > More > Developer Options > Debugging > USB Debugging.

Note:

You have to enable developer mode on your phone first

TechnoTim
  • 2,401
  • 1
  • 19
  • 27
12

I was already in USB debugging enabled state and also had switched USB configuration to PTP. It was still in always charging mode no matter what I do. I had even reinstalled all Android related stuff, tried on multiple devices to find a fix. Finally what worked for me was getting a new cable.

I had posted a question here (now marked as duplicate) since these answers didn't suffice my situation.

Willi Mentzel
  • 21,499
  • 16
  • 88
  • 101
ishandutta2007
  • 12,620
  • 12
  • 74
  • 99
  • 5
    In fact, my problem was the cable. Tried another one and instantly worked :) – Jmakuc Oct 12 '18 at 01:04
  • Once again - the cable. I have a cable that works sometimes. Not today! Tried a whole bunch of cables lying around the office until I found one that worked. That was after rebooting phone and laptop, trying different port, telling Android to forget the pairing, etc. – Andy Weinstein Jan 30 '20 at 09:51
  • Some cables don't transfer data, they'll only charge the device, so be sure to check that. ...and now I see that the answer right below me is saying the same thing lol – Sakiboy Nov 23 '20 at 23:43
4

If anyone is still having problems, consider the cable you are using. Not all USB cables are created equal! Some will charge but not allow data transfer. See this post.

drkvogel
  • 857
  • 8
  • 15
  • Had this problem, swapping cable out was the fix for me. Fortunately I have a drawer full of all sorts of cables lol. – PsychoMantis Jan 03 '21 at 01:19
4

In my case, the problem was that developer mode went away after doing an Android system update. Double-check developer mode and USB debugging settings.

pzulw
  • 1,462
  • 12
  • 18
2

I tried everything on my MBP but failed to fix the issue. Finally, with the least expectation, I reset my MBP's SMC, and everything is back to normal!!! https://support.apple.com/en-us/HT201295

Zhiyun Li
  • 51
  • 1
  • Thanks a lot! After hours of trying everything, I can't believe that the solution was that simple. Thank you. – VGM Dec 24 '20 at 09:37
2

Make sure no other services are trying to access the device via adb. For me, I was using chrome inspect for checking the network requests. When I closed that window studio automatically detected the device.

Rohit P Soman
  • 904
  • 10
  • 15
0

Add “platform-tools” to your PATH variable by invoking the following in the Terminal (make sure to change the file path to reflect where you placed the folder “platform-tools” on your system):

echo 'export PATH=$PATH:~/SDKs/android-sdk-macosx/platform-tools/' >> ~/.bash_profile

Execute the following command to reload your bash profile (this applies the change to the PATH variable):

source ~/.bash_profile

Note: The PATH variable is the search path for commands. It is a list of directories, each separated by a colon, in which the shell looks for commands. To see what values are currently in your PATH variable, use the following:

echo $PATH


adb devices

It should return something like this (if you have one Android device attached):

List of devices attached
212304114c28b9e device
sainithin
  • 1
  • 2
-2

ADB was detecting the device but AS wasn't, I went to Preferences > Build, Execut

user3471194
  • 62
  • 1
  • 3
  • It happens the same to me, but I don't see you provide any solution, you just give a route to a panel – TrOnNe Mar 26 '20 at 10:58