Unable to locate adb in Android Studio - android

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:
Deleted the folder C:\Users\Abhishek\AppData\Local\Android\Sdk\platform-tools
Reinstalled the Android SDK Platform-Tools from the SDK manager.
Restarted Android studio.
Nothing works.
.
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.

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

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.

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

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.

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
Open command prompt.
Type: adb
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
Right click on 'computer' - click Properties.
Select 'Advanced system settings' on the left-side menu.
Click 'Environment Variables'
Under System Variables, scroll down until you see "Path". Select 'Path' and click 'Edit'
Copy the address folder where your adb.exe is located.
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
Under 'User variables for admin' - click 'New'
For variable name, type: ANDROID_HOME
For variable value, paste in the Sdk folder but not the platform-tools folder (C:\Users\me\AppData\Local\Android\Sdk)
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.
Right-click on computer - select 'manage'
Click on Device Manager
Search for 'Other Devices' and select either 'unknown device' or the name of your phone. Right-click to update driver
choose 'Browse my computer for driver software'
choose 'Let me pick from a list of device'
It will have a list. Just click 'next'
It will be empty. Click 'have disk'
Browse for the location of the USB driver. click OK
Select 'Android ADB Interface' and click 'Next'
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
Plug in your phone to your computer (Make sure USB debugging is on!)
Your phone should prompt you with a RSA key fingerprint! (You're 99.99% there!)
Check 'always allow'
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!

Related

Android Studio cannot find my device ! (Initializing ADB)

I'm struggling to connect my device(Galaxy S10) in Android Studio.
I used several methods to solve this problem, but it didn't work.
[Methods that I tried]
- Delete all android studio files and re-install it. ( gradle, sdk, etc.... )
- Add the PATH ( C\users....\Android\Sdk\platform-tools )
- Re-install the USB driver.
- Reset the adb using cmd. ( adb kill-server , adb start-server )
As you can see in the picture.
The connection assistant in Android Studio can find the Galax S10, but I cannot connect.
Please help me to solve this problem.
This issue not created by android studio or gradle file. Actually this issue is caused by adb drivers.Let install adb drives manually in your device. then check connect mobile with android studio.
try installing adb driver from samsung's website Link
Please check the following things to remember for connecting your phone.
Always install the driver from a trusted source.
Developer mode should be activated and USB debugging mode also enables.
Please make sure some devices require to set USB settings to file transfer mode.
In some rare cases after connecting the device we have to restart the ADB.
Step to restart ADB in Window:
Go to the task manager and search for ADB and end that task.
Step to restart ADB in Ubuntu:
Go to the System Monitor and search for ADB and kill that task.
Now go to Android Studio and try to select devices from the device list panel. And hopefully, you will be able to see your connected device.
NOTE : Connect the device to USB file transfer before kill the ADB and do not disconnect your device after killing ADB
There are many reasons why Android Studio doesn't see mobile phones.
One of them is a problem with the ADB Interface driver. You can check it in your Device Manager:
To solve this issue, follow these steps :
Connect your mobile phone with the PC using the cable and Enabled the Developer Option and USB Debugging, which you normally do
Download this Android SDK
Unzip the Zip file and go to the android-sdk-windows folder -> Run SDK Manager.exe with admin privileges
Search for Google USB Driver, Put a checkmark on it and click on Install packages... button
( Now the driver is downloaded but it won't install automatically. We will do it manually in the next steps. )
Open the Device Manager (Right-click on the Start menu -> Device Manager)
In the Device Manager locate your Android device. Then right-click on it and select "Update Driver Software".
Select "Browse my computer for driver software".
Select "Let me pick from a list of device drivers on my computer".
Select "Show All Devices" and click on the Next button
Press the "Have Disk" button.
Enter the path to the Google USB driver. ( To know where your Google USB Driver downloaded, just hover your mouse on it you will find the path/location ) [See the below image]
Select "Android ADB Interface" from the list of device types.
Confirm the installation of the driver by pressing "Yes".
Confirm the installation again by pressing "Install".
When the installation is done, press "Close".
Now, your Android device will be picked up by the Android Studio :)
For me it was the matter of a wrong USB cable :/

Android Studio Doesn't recognize my device- one plus one

I activated Developer Options" and check "USB debugging". I installed google usb driver on sdk.
But still Android studio doesn't recognize my mobile (one plus one).
I tested my mobile on my friend's laptop, it works. Also my android studio recognises Samsung when I install drivers.
But it doesn't recognize one plus one and nexsus.
Do you have any suggestion?
As I said in comment above, when I wanted to debug my app with my OPO today I got the same problem, after moving around to figuring it out, I found out it was because of ADB Driver (which for some unknown reasons got uninstalled from my system).
At first, check you Device Manager, if you see a yellow mark beside your phone, it is absolutely because of ADB Driver, so follow the steps below to install it:
Install the latest Samsung drivers: SAMSUNG USB Driver v1.5.33.0
Restart the computer (very important)
Go to Device Manager, find the Android device, and select Update Driver Software.
Select Browse my computer for driver software
Select Let me pick from a list of device drivers on my computer
Select ADB Interface from the list
Select SAMSUNG Android ADB Interface (this is a signed driver). If you get a warning, select Yes to continue.
Done!
Hope it will help you.
More on this
-Enable developer mode and usb debugging on OPO
-Open Android SDK manager either from Android Studio or the directory the SDK is saved in. 
-Tick Google USB Driver and click ok to download
-Connect OPO
-Open Device Manager
-OPO should show as unknown device
-Right Click on it
-Update or install driver
-Select from list
-Android ADB Interface
-Click ok
Information from this link OnePlusOne helped me to resolve the Chrome://inspect device not detected - Authorize popup prompt issue
Phone: One Plus One
OS: Cyanogen Version 13.1.2
Content from the link is added here :
Quick guide:
Pre-requisite : Download Google USB Driver from here
Connect your device with Android Debugging enabled to your PC
Open Device Manager of Windows from System Properties.
Your device should appear under 'Other devices' listed as something like 'Android ADB Interface' or 'Android Phone' or similar.
Right click that and click on 'Update Driver Software...'
Select 'Browse my computer for driver software'
Select 'Let me pick from a list of device drivers on my computer'
Double-click 'Show all devices'
Press the 'Have disk' button
Browse and navigate to [wherever you have extracted the downloaded file]\google-usb_driver and select android_winusb.inf
Select 'Android ADB Interface' from the list of device types.
Press the 'Yes' button
Press the 'Install' button
Press the 'Close' button
Now you've got the ADB driver set up correctly. Reconnect your device if it doesn't recognize it already.
For One Plus Phones, here is what I did and it worked. I use a One Plus 7T Pro. Before you begin, ensure Android Studio is up and running.
Go to Settings > System > Developer options.
Under Debugging, Tap on Revoke USB debugging authorisations and Tap on Ok when prompted
Switch Off the Developer Mode and Switch it back On
Switch On the Stay Awake option (if you need it)
Under Debugging, Switch On USB debugging option
Remove the USB cable from your device and reinsert it. On the device, you will be prompted to Allow USB debugging for your device ID. Tap on Allow
You should now be able to see the device detected in Android Studio.
This should work for all devices of different brands that are not automatically recognised in Android Studio.
For me the issue was in wrong USB file type transfer "Default USB configuration" option.
It was set to "No data transfer" and I needed to set it to "PTP" under
For me it was much simpler then that:
Under Developer Options
Enable developer mode and usb debugging
Under Debugging subcategory
Enable Android debugging
And my device showed right up on Android Studio 2.2 deployment target dialog.
** Android version 6.0.1
** Cyanogen OS Version 13.1.2
The previous answers didn't work for me. But following the advice from here helped me resolve the issue.
I have provided the steps I followed, but they have been lifted stright from the above link and all credit goes to them. There were a couple of deviations I had to take to make it work which were:
step 9 showed ADB device which I clicked
step 13 shows ADB didnt work but device mamanger now picks up the device and so does VS
Setup ADB & Fastboot Drivers
Step 1. To get started, download the 15-second adb/fastboot installer here and run the file on your windows desktop.
Step 2. Press Y/Yes to install ADB and Fastboot drivers and follow all the steps to continue the driver installation. Once completed you will see fastboot/adb folder on your C drive (C:\adb).
ADB-Installer
Step 3. Now the Files are installed on your desktop, next step is to configure them and setup the drivers.
Step 4. Pick your phone up and go to Settings > About Phone and tap on Build Number 7 times until you’ve enabled Developer Options, then go back to the main settings menu and go to Developer Options that magically appeared right above About Phone. And Enable Android Debugging / USB Debugging mode.
Step 5. Now connect your phone to the PC with USB cable and open Device Manager and look for your phone. It will show up under Portable Devices as your phone model number or Other Devices or ADB Interface or Android. See the screenshot below:-
ADB-Interface
Step 6. Right-click on it and select update driver software.
Update-Driver-Software
[wpsm_ads1]
Step 7. Now new popup windows will appear on your screen. From here click on the “Browse my computer for driver software”
Browse-Computer-For-Drivers
Step 8. Now from the next screen click on the “Let me pick from a list of device drivers on my computer” and hit the next button.
Let-Me-Picks-Drivers
Step 9. From the next screen click on the “Android Device” option and hit the next button to proceed.
Android-devices
Step 10. Now on the next screen you will see all the ADB drivers that are installed on your windows. Here select the “Android ADB Interface” and click on the next button to complete the setup process.
ADB-Drivers-Setup
Step 11. ADB Drivers are now properly installed. To check it is working or note. Go to the ADB folder on your C Drive which the installer created on Step 2.
Step 12. Connect your phone to the PC and open a command window in your fastboot/adb folder (C:\adb). To do this Hold Shift button on your keyboard and right-click on the empty space of the folder. See the screenshot:-
ADB-FIles
Step 13. Now the command prompt windows will appear on your desktop. And enter the following command and you will see the screen with a list of devices attached. This means the drivers are properly installed and your android is successfully connected to the window PC.
adb devices

Eclipse & adb Not Recognizing Glass as Running Android Device

So I have a physical Google Glass device attached to my laptop running Windows 8. In Windows Explorer it shows an attached 'Glass 1' device. However when I run a Hello Glass test project in the 'Android Device Chooser' in Eclipse there are no selectable running Android devices. Similarly when I run adb through command prompt, 'adb devices' brings up an empty list of attached devices.
What is the issue here and how can I get Eclipse/adb to see the Glass device?
I've been through this very issue multiple times over the last few days (doing some Glass dev work for my company). What you're going to want to do is this:
If you haven't yet, install the Google USB Driver package from the Android SDK manager.
Open the Device Manager, find the device that's showing up as Glass 1, right click, select "Update Driver Software..."
Browse for the drivers, navigate to [Android install folder]\android-sdk\extras\google\usb_driver, click next.
Let it install the drivers. If the device is now showing up as "Android Composite ADB Interface", you're good to go and it should appear in adb (assuming you enabled debug on the device itself). If it's just showing up as "Android ADB Interface" without the "Composite", uninstall the drivers, making sure to check the "Delete the driver software..." checkbox, unplug/replug the device, and go back to step 2.
Disclaimer: I've done all my dev work on Windows 7, so this may not be 100% accurate for Windows 8.
I struggled for quite a few hours getting Glass recognized by adb in Windows 7. The two answers above contain essential info, but for me one additional step was necessary:
turn off automatic driver installation in Windows
Computer -> Properties -> Advanced system settings -> Hardware -> Device Installation Settings -> "Do you want Windows to download driver software and realistic icons for your devices?" -> "No, let me choose what to do" -> "Never install driver software from Windows Update"
Then, delete the existing driver and reinstall from the adk directory as above. Before I had changed the driver installation setting, Windows had been installing its idea of the "best driver" as soon as the device was connected and refusing to replace when I attempted to update with the real Google driver.
You're on the right track if Glass shows up under "Other devices" after removing the existing driver, and if it shows as "Android Composite ADB Interface" after installing from the android sdk extras directory. Good luck.

LG G2 vs980 not recognized by ADB devices command (Win7 on virtualbox)

I have been developing android mobile apps via eclipse in school for some time now, deploying the apps to virtual devices. However, I now want to deploy them to my LG G2 android device for testing and speed purposes. I know there are posts about other devices not working, but the solutions are to no avail for me.
I am on virtualbox running windows 7. I have the necessary vb extensions installed and vb DOES detect my LG G2 (asks to view folders..etc), however eclipse/adb on my vb cannot find it still.
I have put what I thought is the proper device vendor id (1004, 0232) in the adb_usb.ini file since some others found that to help get their device detected.
I have done the commands adb kill-server & start-server many times. I have restarted the phone and vb also. I have also tried all of the phones connection types (internet/ethernet, MTP)
Some help would be awesome,
Thanks fellas
When you plug the phone in, you are given options for the "USB connection method".
You must select Internet connection or Send Images (PTP) from the list in order to use USB Debugging tools.
For selecting Internet Connection, the other options sometimes include Charge phone, Media sync, and Camera.
For selecting Send Images (PTP), the other options sometimes include Charge Phone and Media Device (MTP).
Here are may be several solutions:
1) When your device connected open Device manager(default windows tool) and found Unknown device or some not properly recognized device and try to setup driver manually.
2) Enable USB debugging option in phone settings:
go to Setting->About Phone and tap several times on Build Number,
then go back (Settings->Developer -> Options) and turn it on
3) Try to update your USB driver/adb via Android Manager launched from Eclipse.
When I upgraded my LG g2 from Android 4.4 to 5.0.2, usb debugging stopped working.
I didnt have an "Internet" option for USB connection method.
Through lots of trial, error, searching, experimenting, the I found that enabling "USB tethering" (in Settings -> Tethering & Networks -> USB Tethering) did the trick. Once I enabled USB tethering, I could download debugging programs via adb/AndroidStudio. Before USB tethering enabled, adb could not recognize my 5.0.2 device.
How to Setup ADB on Windows
Download the Android SDK package for Windows [android-sdk_r21.1-windows.zip]
Extract the zip files to your C:\ drive. Now you have a folder android-sdk-linux
Double click on SDK Manager to initiate the SDK manager. You shall perceive the following window.
Make sure everything is un-ticked. Now select Android SDK Platform-tools and install it.
During the next window, you will be prompted. Accept the license and click on Install.
When the installation is complete, close the window.
The SDK manager has now download the platform-tools successfully, which certainly includes our prior ADB.
The next step is to define the path where ADB is present.
Go to C:\android-sdk-windows\platform-tools and take note of this path.
Go to desktop, right click on Computer and select Properties.
On the left pane, click on Advanced System Settings and a new window shall open.
Select Environment Variables under Advanced tab.
Select Path variable and click edit.
Now add the path we noted in step #9 to the variable value and hit OK.
Confirm and apply all the changes.
To confirm that ADB has been configured properly, open CMD window and type in:
adb
You now have ADB successfully installed and configured on your Windows machine

Android Development - Command "adb devices" not listing my device

I see many people has this problem and so I see many solutions as well. But none is working.
I am having Ainol Novo8 Dream QuadCore Tablet running Android 4.1.1. My Window machine is Win 7 (with all updates).
For above I have download usb_driver i got from somewhere but window is not taking it. It says it is already up-to-date. Even after uninstalling the driver it does not take mine but update from net. My device is fully connected through USB without Yellow warning.
Do, I still need to use usb_driver I got from somewhere for my Tablet ?
I read about SDK setup, but I did not find it anywhere. I have Eclipse with ADT from Google Developer page.
Also, there were no .... google/usb_drive/ folder exist. For info, Virtual Device is working correctly on my Eclipse setup.
I read about two files which looks important: adb_usb.ini and android_winusb.inf. Both are not present in my installation. Though in the downloaded usb_driver for Ainol android_winusb.inf exist.
Tried with "adb start-servers" and adb kill-servers". No help for "adb devices".
My folder structure is
C:\Eclipse_N_ADT\adt-bundle-windows-x86_64-20130522\sdk
I have done with USB Debug Mode on. Notification is showing this. I removed the slide password thinking if it can interfere with. My device is rooted by default.
My device is not coming on Portable Device list. When I check through Devices and Printer on Win7 then I can see window has found device drivers. There it shows my Tablet Model under driver list.
For the sake of anyone else still struggling with this, I found a driver package that works.
I recently purchased an Ainol Novo Hero 10 II for development purposes and faced the same problem as you. This solution works for me:
Source:
http://www.slatedroid.com/topic/70585-adb-drivers/
If you have already installed any previous drivers but your ADB doesn't recognise it, go to your Device Mangers to uninstall and remove all existing drivers associated with your new device.
Download modified USB driver from here: http://yadi.sk/d/54lX5c2O386XU
This driver is UNSIGNED so install at your own risk (although it seems to work for me). Windows has a Driver Signature Enforcement that you need to disable. A google search will lead you to instructions (sorry not enough rep points to post more than 2 links :P)
Reinstall with the new driver. The package already includes an adb_usb.ini file that includes a Vendor ID 0x10d6 that should help recognise your device.
Reboot Windows (and remember to reactivate your Drive Signature Enforcement) and it should be working.
Follow the below steps for recognize your device with 'adb devices' command.
For this your device should be enabled 'USB Debugging' option in {developer options}.
Click 'Start' button on computer.
Right click on Computer.
Select 'Manager' > 'Computer Management' window will be opened.
Click on 'Device Manager'
Now Expand 'Portable Devices' > Here you can find your device name with yellow exclamation symbol.
Right click on your device Name.
Select 'Update drivers Software'
Select second option 'Browse my computer for driver software'.
Select 'Let me pick from a list of device drivers on my computer'.
Common hardware types list will be opened.
Select 'Android Device' > click on 'Next' button.
Now select 'Android ADB Interface' and Click 'Next' button.
it pops up 'driver warning' > Click 'Yes'.
Now you will see the 'Windows has successfully updated your driver software'.
Now you can see the pop up in your device with 'digital signature' > click 'OK'
Now open cmd and write command 'adb devices' > now you can see the your device is listed with some ID.
Quick guide:
Connect your device with Android Debugging enabled to your PC
Open Device Manager
Your device should appear under 'Other devices' listed as something like 'Android Phone' or similar.
Right click that and click on 'Update Driver Software...'
Select 'Browse my computer for driver software'
Select 'Let me pick from a list of device drivers on my computer'
Double-click 'Show all devices'
Press the 'Have disk' button
Navigate to [wherever your SDK has been installed]\extras\google\usb_driver
Select 'Android ADB Interface' from the list of device types.
Press the 'Yes' button
Press the 'Install' button
Press the 'Close' button

Categories

Resources