1

I am new to Android Studio. I wanted to run the basic "Hello world" app in my mobile phone. So after enabling USB debugging mode in my phone, I pressed the run button, but nothing shows up in my phone. After some troubleshooting, I found out that, it shows this error everytime I try to restart the ADB server

Unable to locate ADB

Steps I followed to fix this error:

  1. Deleted the folder C:\Users\Abhishek\AppData\Local\Android\Sdk\platform-tools
  2. Reinstalled the Android SDK Platform-Tools from the SDK manager.
  3. Restarted Android studio.

Nothing works.

enter image description here

.

In fact, as you can see adb.exe exists inside the platform-tools folder. I don't understand why android studio, is unable to locate it.

5 Answers5

0

If using avast go for virus chest, will find ADB, restore it by clicking the right button.

If you are not using avast then you need to set up the below configuration.

open Android Studio settings-->System settings --> Android SDK --> select SDK tool tab -->> select "Android SDK platform tool" and install

Also, you can check ADB working well by executing this command in CMD or terminal in the platform-tools folder

ADB devices
0

Sometimes Android Studio is in funny mode.

Just press the Ctrl+Alt+Del button. Then select Task Manager and select ADB and end task.

You can also try File--> Invalidate Cache / Restart.

And restart your PC.

Abhnav Maurya
  • 115
  • 1
  • 4
0

Try downloading "SDK Platform-Tools" from https://developer.android.com/studio/releases/platform-tools

Copy 'adb.exe' to C:\Users\user\AppData\Local\Android\Sdk\platform-tools. This will fix the issue.

I also got the same bug and I have added(Optional) C:\Users\user\AppData\Local\Android\Sdk\platform-tools\adb.exe to the exception list of my anti-virus tool

  • I have no antivirus installed and neither is my Windows Defender enabled. –  Feb 25 '21 at 01:54
0

It was very dumb of me to realize that I hadn't actually connected my mobile phone to my PC the whole time. I kept using the USB connection to charge rather than transfer files, as a result of which my USB debugging was never really enabled.

It's working fine now. Thank you for your help everyone.

0

This is my solution for windows 7 and Moto phone. I hope it works for other versions of windows and android.

Make sure developer options and USB Debugging is enabled on your android phone (and that the phone is plugged in to your computer.)

Make sure you have adb.exe in your Android folder (For me, it's users/me/appdata/local/android/sdk/platform-tools/) . If not, you can use SDK manager to install it or download it from https://developer.android.com/studio/releases/platform-tools

Test to see if you computer detects adb.exe

  1. Open command prompt.
  2. Type: adb
  3. If it can't find it, it would display nothing. If it does, it should display a bunch of text (Skip next step, go to 'install usb driver')

Make sure your computer knows where to find ADB.exe

  1. Right click on 'computer' - click Properties.
  2. Select 'Advanced system settings' on the left-side menu.
  3. Click 'Environment Variables'
  4. Under System Variables, scroll down until you see "Path". Select 'Path' and click 'Edit'
  5. Copy the address folder where your adb.exe is located.
  6. Under 'variable value'- Do NOT delete what is already there! Type a semicolon at the very end after all the other paths. Then paste your folder address after the semicolon. (For me it's ;C:\Users\me\AppData\Local\Android\Sdk\platform-tools) click OK
  7. Under 'User variables for admin' - click 'New'
  8. For variable name, type: ANDROID_HOME
  9. For variable value, paste in the Sdk folder but not the platform-tools folder (C:\Users\me\AppData\Local\Android\Sdk)
  10. Open command prompt and type: adb If it list version #, then congrats to getting past one hurdle. Yay! If not, check to see if your anti-virus software have adb in quarantine.

Install Google USB Driver (or Intel Android Driver depending on what smartphone you have.) Use SDK Manager to install the USB Driver or download it directly on the website. Copy the location of where it is installed. (For me, it's c:\Users\me\appdata\local\android\sdk\extras\google\usb_driver)

Update the driver on your phone. Plug in your phone to your computer.

  1. Right-click on computer - select 'manage'
  2. Click on Device Manager
  3. Search for 'Other Devices' and select either 'unknown device' or the name of your phone. Right-click to update driver
  4. choose 'Browse my computer for driver software'
  5. choose 'Let me pick from a list of device'
  6. It will have a list. Just click 'next'
  7. It will be empty. Click 'have disk'
  8. Browse for the location of the USB driver. click OK
  9. Select 'Android ADB Interface' and click 'Next'
  10. Update the driver for your phone.

If you see the message 'Windows has successfully updated your driver software' Yay!

Restart everything. Turn OFF developer option on your phone and disconnect. Restart computer. Turn ON developer option, turn ON USB debugging, and connect to computer.

Check to see if computer recognizes your phone as debugging device

  1. Plug in your phone to your computer (Make sure USB debugging is on!)
  2. Your phone should prompt you with a RSA key fingerprint! (You're 99.99% there!)
  3. Check 'always allow'
  4. Click 'OK'

Open command prompt and type: adb devices It should list your phone as a series of numbers and letters.

CONGRATS!!!

Open Android Studio and run your app. It should list your phone if plugged in. Woo! Yay!

schenyc
  • 51
  • 4