The AVD Manager in Android Studio doesn't show my device but adb devices
does show it. Am I missing something obvious here?
To change what your application defaults to when you click run or debug in Android Studio, follow these steps:
1. go to Run
2. Click on Edit Configurations
3. Select the project
4. find the Target Device section under the General tab on the Android Application page.
That seems to be where you toggle what the project builds to. If you're importing a project it actually defaults to Emulator, not sure why. You can also select "Open Select Deployment Target Dialog" to list both connected as well as emulated devices.
-
3I have just set my build target to USB device in the manner specified here, and then all of a sudden the IDE cannot recognise the R class. – Ogre Aug 5 '13 at 0:04
-
i don't see Run -> Edit Configurations anywhere in android studio... screenshot? – bharal Aug 1 '16 at 9:26
-
3I followed these steps, and when I selected the usb device, a popup said it needed to install Android 1.0 because that it the target OS. However, my phone and an HTC One M8 and I was able to debug on it last week. Something changed that is now causing Abdroid Studio to fail to see my phone as a viable debugging device. I tried it on another computer running Android Studio and it worked fine. So there must be some other setting or maybe even a driver someplace that is causing this. – James Oct 3 '16 at 13:53
-
28I followed these steps, but when I try to run I get: "Error running app: No target device found" – Gabriel Apr 22 '17 at 22:13
-
3But why dont the selection dialog shows the devices? If I run
adb devices
in the command line, it is connected properly. – Csaba Toth Feb 4 '19 at 3:30
I recently had trouble with this, and regardless of what I did(restart adb, edit adb_usb.ini, restart computer+device+swap usb port, reinstall studio etc. etc.) I just couldnt get it to work, and could not even detect my device using 'adb devices'. Finally after about 2 hours of googling and testing, someone suggested switching to PTP instead of MTP on my device. When I did this I got a popup on my device asking me to allow my mac access and suddenly everything worked(had to restart studio for it to show up there as well though).
I might be bumping this thread now, but it is the first result on google search, and I had a lot of trouble finding an answer for this problem, so I thought this should be added as a solution.
-
25turning PTP or MTP on if off, or off if it is on triggers a popup, then suddenly everything works. i do not know why i need to toggle PTP or MTP for android studio to recognize my device. to set PTP or MTP -> "Modern Android devices use the MTP or PTP protocols — you can choose which one you prefer. To select a USB connection protocol, open the Settings app, tap Storage, tap the menu button, and tap USB computer connection. " howtogeek.com/192732/… (thank you LGBo) – tmr Oct 8 '14 at 16:49
-
5@Suspended PTP = connect as camera, MTP = connect as media device. You should be able to do a web search if you want to know more. – user1881400 Apr 9 '16 at 15:06
-
17the reason why it worked when you switched to
PTP
is that the first time you ran it, you did't authorize USB debugging from the dialog on your phone. if you want to useMTP
try revoking USB authorization from settings -> developer options -> revok usb authorization then start over. – Nixon Kosgei Mar 15 '17 at 4:22 -
What does it mean when the USB device is not recognized on certain projects within AS but is recognized on others? – tccpg288 Apr 30 '18 at 23:11
-
When I upgraded to Android 8.1, I suddenly started having this issue. Following the instructions provided by @tmr resolved the issue for me! – gunner_dev Jul 13 '18 at 18:25
On your device:
Go to settings/ developer settings/ allow USB debug mode
If 'allow USB debug mode' option is disabled. Then you might have the device currently connected to your PC. Disconnect the device and the option should now be available
Note: On Android 4.2 and newer, Developer options is hidden by default. To make it available, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options.
If it still doesn't help, you can google it with this expression:
How to enable developer options on YOUR_PHONE_TYPE
-
8From the android docs:
Note: On Android 4.2 and newer, Developer options is hidden by default. To make it available, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options.
developer.android.com/studio/run/device.html#setting-up – Neil Sarkar Nov 5 '16 at 2:00 -
3
-
My USB debug mode got disabled somehow. Perhaps from a software update. So don't overlook checking if USB debug mode is enabled, even if you enabled it before. – Yahya Uddin Jun 19 '20 at 7:59
Some cables can not been used for developer mode or transfer file. A solution would be change your cable and don't waste time.
Edited
Some USB3 ports are causing issues too. Not sure if there is a way to check if the cable/usb works. But there is a way to detect the USB type USB2 or USB3? . If you are using USB3 could be a port issue too.
-
7I had a cable that used to work for 10 months with Android Studio. It STILL works for charging but will no longer show as a 'connected device' in Android Studio! – kite_n_code May 23 '18 at 9:28
-
3You saved the day! Definitely wouldn't have thought of this on my own +1 – nviens Oct 22 '18 at 3:27
-
1The garbage cable that came our multi-phone charging station was the problem. The official Samsung one that came with the phone works great. – Dana Robinson Oct 26 '18 at 9:12
-
1This worked for me. Although
adb devices
shown that my device was still attached, Android Studio couldn't run on my phone until I changed the cable. – Manuel V. Battan Nov 21 '19 at 18:20 -
1Wow +1 I almost shrugged this off like "yeah right.." then thought "well, ..84 up-votes, I guess I should at least rule it out." Glad I did and didn't waste anymore time. – elrobis Aug 24 '20 at 23:19
I had to killall adb
because somehow, Android Studio managed to crash and did not want to communicate with adb anymore. Thus, my device did not show up.
So quitting Android Studio, terminating all adb instances in Terminal and starting Android Studio again (should ask if it should enable debugging then) worked.
-
2sometimes using activity window (mac) to kill (force quit) adb is enough (without quiting android studio). i force quit adb, run app again via android studio, and android studio can see the mobile phone/usb device. (thanks Sebastian Wramba) – tmr Mar 12 '15 at 6:33
After spending some time I found the problem was to enable USB debugging option to on. Just find in your mobile Settings->Developer Option->USB debugging. Just enable it and it works. It might help someone!
-
On Android 5.1, Settings->Developer Option->USB debugging has a checkbox, but it is grayed out and cannot be selected. Further down there is an option to "Select debug app" which says "No debug application set". What is a good debug app to install and use? – Phil Goetz Sep 20 '17 at 21:20
-
@PhilGoetz just check if "Developer options" is on or not. added image for your reference. – Jugal Panchal Sep 22 '17 at 17:59
It works for me by following steps below:-
If you using Windows, the device won't show up because of driver issue.
Go to device manager (just search it using Start) and look for any devices showing an error. Many androids will show as an unknown USB device and comes with exclamation mark. Select that device and try to update the drivers for it. for update part follow the link:universal adb
But before that, you have to update your sdk manager and make sure Google USB Driver package is installed.
When done, the driver files are downloaded into the \extras\google\usb_driver\ directory. Hints: Search "android_winusb.inf" under Windows Start and Open File Location to get the directory mentioned.
Open up your device manager, navigate to your android device, right click on it and select Update Driver Software then select Browse driver software. Follow the file location path previously to install Google USB Driver.
Restart Android Studio and Developer Options in your android device and reconnect USB.
Cheers !
-
Hey William, I tried your steps but got this problem: stackoverflow.com/questions/33884361/… – Ruchir Baronia Nov 24 '15 at 3:02
-
-
Another handy program to start recognizing the device is koushikdutta.com/post/universal-adb-driver – Lucia Jul 29 '16 at 22:05
-
What do you do if it's not listed in Device Manager at all? It is charging. – Curtis Jun 9 '17 at 20:28
-
His device shows up in ADB. Mine does too. We can adb shell and transfer files to and from it. That all works and is not related to the question. -- The question is why can't android studio see it. – BrainSlugs83 Jul 6 '19 at 21:28
In my case the following steps helped to resolve the issue:
1) Ensure the package "Google USB Driver" is installed in Android SDK Manager
2) Download "ADB Driver Installer 2.0" from here
3) Run the tool downloaded and connect your smartphone; in my case it showed that the driver had been installed incorrectly and suggested to fix it
After those steps my Android Studio instantly recognised the device! Both MTP and PTP started to work.
Tested for Samsung (Android 4.1.2) and Xiaomi MI4W (Android 4.4.4)
-
4
My Nexus 5 phone did not have developer options in the settings menu. I had to do the following:
On Android 4.2 and newer, Developer options is hidden by default. To make it available, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options.
In my case
android studio suddenly stop seeing my device
I fix it by change USB option to Media device (MTP)
how to get USB option from storage USB Computer Connection
check Debugging from developer options
try re-run on device , it should work
issue
USB option was charge only
UPDATE ANSWER 26/7/2016
there many reasons like not enabling developer mode --> USB debugging(if you dont see developer option click 7 times at build number )
but I face another issue every thing was works just fine suddenly android studio cant see my device
to fix this issue you need to restart adb , from terminal
adb kill-server
adb start-server
or from ddms
in devices section --> click at small arrow down --> restart adb
I plugged my phone in and it was detected fine (no need for device manager or anything like that).. but Android Studio wasn't seeing it.
I found it takes two requirements to be met
- PTP (not MTP)
- USB Debugging mode on
For PTP , go to settings..storage..usb connection..PTP (For MTP/PTP , maybe on my nexus it's there, but on my doogee I see it under 'developer options' .. then under networking , above input, it says "select usb configuration")
For USB debugging, settings..about..tap build about 7 times, then a new option appears for usb debugging and you can turn it on.
Added this is also relevant for USB debugging or MTP/PTP being moved https://android.stackexchange.com/questions/213059/where-is-the-mtp-and-ptp-option-in-android-9
-
PTP worked for me where MTP didn't (with Android Studio 3.2). I also made sure i had up to date 'SDK tools' – stephendwolff Oct 2 '18 at 12:25
-
3I am just extending the answer that if your don't found
PPT
option then selectMIDI
option. It's working for me. – Ninja Sep 11 '19 at 11:15 -
@Ninja there's MTP, PTP, and there's MIDI. No PPT! gadgetguideonline.com/android/wp-content/uploads/sites/3/2016/… MTP and PTP have been around for a while. And who is going to not find the PTP option if it is in the same menu as the (possibly more recent new) option you speak of MIDI ? – barlop Sep 20 '19 at 13:38
Try the following solutions (for Windows):
Go to your sdk tool installation path, and under \sdk\platform-tools folder and run this command:
adb devices
If your device it listed it should show something like this:
C:\android\sdk\platform-tools>adb devices
List of devices attached
081e96500591f039 device
If not, follow this:
Try these commands:
adb kill-server
adb start-server
Make sure your phone has Developer Options in Settings (if not, go to Settings, About phone (or device), click on Android Version multiple times until you see a message).
Make sure USB debugging on your phone is enabled (go to Developer Options in Settings and turn it on)
Make sure you have Select USB Configuration set to MTP (this is also in Developer Options).
Make sure you can see your files in your device in Windows Explorer when you connect via USB.
Make sure you have the driver for your device properly installed (most of the time, this happens when you first plug in your USB cable).
In Windows, right click on Computer, and go to Device Manager, check if you have Android Device right on the root folder and under it should be Android Composite ADB Interface. If you don't have this, you have to download the Google USB Driver. Get it here:
http://developer.android.com/sdk/win-usb.html
In Device Manager, find your device (should have yellow Exclamation point), right click, and update driver (open the folder with the driver you just downloaded)
If this doesn't work, try restarting Android Studio or plugging your device back in again.
Some cheap devices (some $30 tablets) don't provide the USB drivers to connect in Device Manager, so in this case you are out of luck.
-
Exactly. Worked for me. I have Win10. Android SDK on Win10 is here:
C:\Users\me\AppData\Local\Android\sdk\platform-tools
. Drivers are here:C:\Users\me\AppData\Local\Android\sdk\extras\google\usb_driver
– Green Jul 7 '16 at 5:22 -
Running
adb devices
from shell fixed it for me, because it is able to detect and fix that the ADB daemon was not running. – Matthias Ronge Feb 25 '20 at 8:54
I have found that what works for me is:
CD
to your sdk platform-tools folderCheck if adb sees your device
./adb devices
If it displays 'List of devices attached' and a blank line below, then restart adb as follows:
./adb kill-server ./adb start-server
then re-run
./adb devices
and see if it picks up the device, eg as follows:List of devices attached
015d2bc285601c0a device
-
-
@bhoomika do you have adb interface installed in device manager? or is it showing as a yellow exclamation mark under other devices? – barlop Apr 11 '20 at 14:44
If your phone was working previously
Before you do anything complicated, this might be a simple problem. Just unplug and plug back in.
If there are additional issues
You also might want to check that your configuration is set up to launch to your phone.
run --> edit configurations
And make sure that you either default to the USB device or the chooser dialog if you are going to be switching between devices on your emulator as well.
-
This is the correct answer to the question, since adb devices show the device. – MG Developer Jun 10 '18 at 21:10
-
It's pretty insane that FIVE YEARS later, this bug still exists. Just had this exact problem – easytiger Aug 19 '19 at 17:36
Be sure that you have downloaded the correct API for the version you device is using. After updating your device's Android version or switching to a different device you may not have the correct API downloaded on Android Studio. To do this:
Check your devices Android OS version by going to Settings>About Phone>Android Version
Make sure you have the correct API installed in Android Studio in the SDK Manager
-
The question had already a valid answer accepted by the question owner. – Eduardo Yáñez Parareda Apr 20 '15 at 8:39
-
1Does not always help. I have a phone with Android 4.3, I installed it in SDK manager, the phone device still doesn't show up when running the app. – Eugene Gr. Philippov Aug 4 '15 at 18:32
Also try uncheck "Tools" - "Android" - "Enable ADB Integration".
This is work for me after update Windows to 10.
-
Hey, I am having this issue: stackoverflow.com/questions/33884361/… – Ruchir Baronia Nov 24 '15 at 3:10
-
Great insight! Didn't know about this option. ADB was working for me, but Android Studio wasn't. FYI for visitors from the future, I'm on Linux. – David Kay Feb 8 '16 at 19:33
-
-
-
1
The AVD Manager is for emulator images. It never shows hardware. This is true for any usage of the AVD Manager: Eclipse, Android Studio, etc.
-
11
-
1
If you still have this problem (later than summer 2015) maybe you should:
- Go here: http://developer.android.com/sdk/win-usb.html#top
- Download the driver
- Reinstall it
I recently installed Windows 10 (not an upgrade, a clean installation) and I forgot the ADB USB driver
-
1This worked for me after trying all other options. Thought my new install of Win 10 may have done it – raklos Aug 31 '15 at 11:03
if your device version in 9 then
Go to SDK Tools and Update Sdk same Version and Intstall Google USB Driver
UPDATE 2020 Nov 27
One more reason is your cable which might be broken (only charging is available but not debugging). Hence, buy a new one! ^^
Known that "Can't connect a device with Android Studio" is such an annoying issue to newbies, but I'm kind of an old hand at Android for a quite long time. Most of the common methods have been tried:
- How to turn on developer mode.
- Forgot to enable USB debugging.
- Sometimes need to switch USB configuration to Transfer Files.
- Some subliminal guides on adb commands, which I've never tried, though.
- Try a new cable. ...
HOWEVER, what works for me is to REVOKE ACCESS again for the computer your device will connect to, namely:
- Go to Developer options.
- Revoke USB debugging authorization.
- Wait a bit for a dialogue to show up and ask your access consent.
- Bang, there you go, your device is listed in Android Studio.
I know it sounds crazy but i just reboot my phone while was connected and it appears
If you use Samsung you can download and install the device driver from Samsung.
Note
You need to enable ADB mode(Like the eleventh comment)
You need to set Target in Android Studio to "Open Select Deployment Target" Dialog. To set Target : Run > Edit Configurations > Targets > Open Select Deployment Target Dialog
Turn on USB debugging and connect the device to PC. Wait until the device gets detected by PC. While connected, turn off USB debugging and turn on it again.
while doing all this don't forget to increase the sleep time, so that if the device prompts for authentication on the mobile device you know that the connection is succeeded.
Try 1:
- Install "microsoft universal c runtime".
- Download the file as per your OS (operating system.)
https://support.microsoft.com/en-in/help/2999226/update-for-universal-c-runtime-in-windows
Installing Google USB Driver from Developersdeveloper.android.com didn't work for me.
Try 2:
- search "androidmtk" and install driver installer. (restart pc) (check whether device is showing)
- Else search "adbdriver" and install driver installer. (restart pc) (check whether device is showing)
Try 3:
- Check out whether in Android studio's status bar (displayed at the very bottom of window), any message has been shown. Do the changes suggested in the message.
Try 4:
- Check whether device is shown after changing the connection type (mostly shown on dragging the top bar on home screen).
- i.e. "Charging only", "Transfer files", "Transfer photos PTP or MTP"
Try 5:
- Go to Android "Tools menu"->"SDK manager"->
- Below "Android SDK location" you will see 3 tabs.
- Out of it click on "SDK tools" and in the list find and tick-mark "Google USB drivers" and install the package.
- Restart the computer.
I have been troubleshotting same problem. I have tried all the tips in this topic in posts above me.
My situation was: - computer have seen my tablet - had debug usb options in developer mode on - adb in sdk was not seeing my device, killing & start didnt help
The problem was I had Samsung Galaxy drivers on my win8. When I went to devices manager, there was Lenovo A7600 Tablet with yellow marking. Settings -> actualize drivers -> choose from existing ones and i hooked up the Samsung drivers to this one.
It worked like charm.
-
Thanks dude, It worked on my galaxy s7 edge. All I had to do was, just like u said, update through device manager my drivers manually. cheers. – Da Artagnan Jan 17 '17 at 23:02
If every configuration is sorted, what worked for me was to switch the device to be connected at PTP
and then back to MTP
.
None of above answers solved my problem until I updated SDK platform-tools.This maybe one of the causes of this issue.
When I faced this problem I was on Android Studio 3.1 version. I tried a lot of approach above, nothing worked for me ( Don't know why :/ ). Finally I tried something different by my own. My approach was:
Before going to bellow steps make sure
*Your "Google USB Driver" package is installed ("Tools" -> "SDK Manager" -> Check "Google USB Driver" -> "Apply" -> "Ok").
*If you are trying to access with emulator then check "Intel x86 Emulator Accelarator(HAXM installer)" is instaled. ("Tools" -> "SDK Manager" -> Check "Intel x86 Emulator Accelarator(HAXM installer)"" -> "Apply" -> "Ok")
- Goto Tools.
- Then goto SDK Manager.
- Open SDK tools.
- Uncheck "Android SDK Platform-Tools" (On my case it was checked).
- press apply then ok.
- Again goto Tools.
- Then goto SDK Manager.
- Open SDK tools.
- check "Android SDK Platform-Tools"
- Restart Android Studio :)
Hope this will help somebody like me.
adb devices
either, your problem could be that you are using a USB 3 port. Lollipop can only connect if you use a USB 2 port. – Kitalda Jun 25 '15 at 11:03Settings -> About phone -> Tap on Build number several times
, then go toSettings -> Developer -> USB debugging
– onmyway133 Feb 7 '18 at 10:34