13

I've just installed VS2015 Community with Xamarin to develop some mobile apps. The problem is, I can't achieve debugging Android apps on any device. Android Device Monitor shows empty list. I tried connecting different phones, which I know are detected on my friend's PC. I can explore their files from windows explorer, from there computer sees them.

  • USB Debugging on the phone is turned on.
  • USB connection mode is set to camera, no change at all.
  • I have Google USB driver installed in Android SDK manager.
  • I tried adb kill-server, adb start-server. Nothing changed. adb devices shows empty list.

This is device manager while Developers options are disabled on the phone. enter image description here And here with enabled Developers options enter image description here I also tried updateing driver to google usb driver, but windows said it's up to date.

Rico
  • 362
  • 1
  • 4
  • 18
  • https://stackoverflow.com/a/27043185/119741 The Comment about using Show All devices worked – Nick Oct 12 '17 at 20:08

18 Answers18

51

You most likely did not grant access to the device. Try to go into the developer settings on the smartphone and revoke the USB debugging authorisation. Then connect the phone to the pc and and wait for a popup on the phone which you should accept. After accepting you should see your device with adb devices.

You can also try to set the connection mode to MTP (instead of the camera PTP).

Hope it helps!

c0delama
  • 663
  • 6
  • 9
  • USB debugging is on. I read about MTP, but can't find it on my phone (Huawei P8, Android 5) – Rico Jul 06 '16 at 12:58
  • 2
    Have you tried revoking the authorisation and reconnecting your phone? – c0delama Jul 06 '16 at 13:02
  • Did you accept the dialog in the first answer of this question? http://stackoverflow.com/questions/15053463/android-4-2-2-usb-debugging-always-allow-from-this-computer-option-result-in-t – c0delama Jul 06 '16 at 13:04
  • Yes, several times – Rico Jul 06 '16 at 13:08
  • Is your smartphone properly installed (with AND without developer settings enabled) and are there errors in the windows device manager? – c0delama Jul 06 '16 at 13:13
  • 1
    Please google for proper Huawei P8 drivers (you need normal Windows drivers as well es ADB drivers). After that the exclamation marks in the device manager will disappear and you will get the desired prompt on your smartphone. – c0delama Jul 06 '16 at 13:34
  • Ok, there was no direct clue on Huawei site, but I find application called HiSuite and after instaling it, Huawei P8 is visible on Android Device Manager. Thanks for support. :) – Rico Jul 06 '16 at 14:01
  • With installing the HiSuite you also installed the drivers ;) Please accept my answer, thanks. – c0delama Jul 06 '16 at 14:02
  • I had the same issue. I fixed it by right clicking the device in the device manager and selecting Update Driver. – Steve Wellens Jul 24 '16 at 00:58
  • @c0delama you are my hero! – Winteriscoming Sep 21 '21 at 15:28
14

Enable the device for development

Goto: Device > Settings > Developer Options > tick USB debugging

Habeeb
  • 7,601
  • 1
  • 30
  • 33
  • 1
    If you enable the developer options for the first time, this option will be disabled by default, so, in order to get it working again, you need to Enabled it again. This solution worked for me. – Bruno Dec 18 '18 at 09:10
  • 1
    On my Huawei P30 Pro this is in Settings -> System & updates -> Developer options -> USB debugging. The solution works – Vladimir Apr 09 '22 at 13:14
9

Sometimes just restarting Visual Studio might help

ML13
  • 895
  • 8
  • 15
5

Try the this: 1 - Close Visual Studio 2 - connect your device 3 - Restart visual studio with the device already connected by usb (with the device options checked)

Fred_mOZ
  • 51
  • 1
  • 1
4

This just happened to me. And it seems setting the startup project to your Android project fixed it.

enter image description here

enter image description here

theredforest
  • 427
  • 4
  • 9
1

My understanding is that the Google USB Drivers from the Android SDK Manager only work for Google Nexus devices (at least according to https://developer.android.com/studio/run/win-usb.html); annoyingly enough, to use other kinds of devices you'll probably need to download vendor-specific drivers. For example, I definitely had to download Motorola's drivers to use my Droid for debugging purposes. Unfortunately, for whatever reason Windows wasn't able to automatically detect that that's what it needed to download, so I had to download them manually.

1

I had the same problem, using a Samsung Galaxy A5

  • Google Drivers Installed
  • Samsung Drivers Installed
  • Phone shows up in file explorer

Plugging the phone in while Visual Studio was opened resulted in a pop up asking for permission. After authorising, everything worked perfectly. I didn't have to go into the developer settings on the smartphone and revoke the USB debugging authorisation.

  • Even though Windows 10 automatically install the drivers, it didn't work. I had to install drivers from the manufactures to get my physical device to show in Visual Studio – PLOW Mar 27 '17 at 15:32
1

To preface, I had connected my phone (a blackberry which had Android and full Google Play Store access) via Android Studio before so I KNOW it's possible, but when I was trying to do it with Xamarin I was having issues, Visual Studio just wouldn't recognize my device.

Found the problem appears to be the USB cable I was using. When I standardly plug in the USB, blackberry gives me the option to just charge the phone, or to enable File Transferring. But the first cable I was using always just charged the phone and didn't give me options. I tried switching the usb cable and voila, I got the prompt, and I can see the device now in the Start Debugging dropdown. So it looks like there's charge-only usb cables as well as Data cables. Be sure you're using a Data cable else it won't be able to see your Device

DeltaPng
  • 505
  • 4
  • 6
1

I had the same issue after updating Visual Studio found that in recent versions is better if you open VS in administrator mode to properly work, this should fix the problem.

Mortwin
  • 11
  • 2
1

I had previously revoked debug auth on my phone, but my phone didn't prompt me to allow debugging on my PC when I connected it again. Ended-up restarting my LG V30 while connected to my PC and I was prompted to allow debugging.

After that, Visual Studio 2019 version 16.10.0 adds my phone to the device list.

WarHorse
  • 31
  • 4
1

Running on Windows 11. Visual Studio 2022. But, I don't think the versions are really relevant here - included for completeness.

Followed all instructions re enabling USB debugging from the device. Also, the USB Drivers for my Samsung device were successfully installed on the Windows machine.

I was running the Duet Display application as I had previously installed it for use with my iOS devices. This appears to have created a conflict when connecting the Android device, as the prompt related to Duet would appear but not the prompt to allow USB debugging from the computer along with the RSA thumbprint. Once I exited the Duet app from my system tray and reconnected the Android device I got the prompt and it immediately appeared in Visual Studio 2022.

Jim Speaker
  • 1,303
  • 10
  • 28
0

Here's some things I check when having an issue with Android device not appearing:

  • Enable developer mode on the device from settings
  • Install (e.g. to windows) the manufacturer's* developer USB drivers for the device
  • Ensure the Minimum Android Version in the AndroidManifest.xml is lower or equal to your device
  • And as always, try a different lead and restart both PC and Device!!

*Manufacturer Android USB Development driver links I know of:
Sony | Samsung | Google/Nexus | Blackberry

noelicus
  • 14,468
  • 3
  • 92
  • 111
0

I have just updated from VS2015 (14.0.25402.00 Update 3) to VS2017 (15.7.5).
Amongst other things, I had to migrate a .forms app from 2.3.x to 3.1.x...
As it (according to MS) now should be possible to install also the Xamarin integration software in parallel to older versions of VS, I first (for security reasons) wanted to leave my “old” .forms app under VS2015 and .forms 2.3x and start to update to .forms 3.x with VS2017.

First, everything looked good - I was able to open my “old” .forms 2.3.x project in VS2015 (what was not possible in the earlier migration from VS2013 to VS2015).
But, I was not able to bring my two dev mobiles (both Samsung Galaxy S7) to work under VS2015 again, although, they were showed to my dev-machine (windows explorer) correct.
After wasting about a full day (doing every suggested workaround, I found on the web), I gave up und started to migrate the .forms project under VS2017.

Under VS2017 both mobiles were showed immediately without any problems and I was able to debug to the device.
So.. it seems, as the installation of VS2017 (with Xamarin integration SW) has “destroyed” something in the VS2015 installation regarding the access to the mobile devices...

FredyWenger
  • 2,236
  • 2
  • 32
  • 36
0

I wasn't getting the USB debugging prompt on the device to trust the PC it was connected to and it wasn't appearing in the drop down list of devices in Visual Studio or ADB. Tried many things but installing the USB driver for the device (in my case Sony Xperia XA1 from: https://developer.sony.com/develop/drivers/

After installing this device driver by right-clicking the ADB Interface device in Device Manager and choosing the downloaded driver it showed the prompt to allow the PC and now works fine. This was on Windows 8.1 . I don't remember having to do the same for my Windows 10 PC.

ses
  • 158
  • 1
  • 7
0

I tried all the options but the only way I got it working is to unplug the USB cable and connect it on a different USB port.

Javier
  • 2,093
  • 35
  • 50
0

After downloading phone specific drivers and restarting computer / restarting visual studio etc etc. What fixed it for me was from developer options

  1. Disable USB Debugging
  2. Enable USB Debugging This was on a Samsung Galaxy, looks like although it was saying USB debugging was enabled it was in fact not enabled until I retriggered it using the above method.
0

On my phone (Huawei P30) i had to select Transfer Files instead of Charge only while connected.

Astrophage
  • 1,231
  • 1
  • 12
  • 38
0

If everything doesn't work like mine, then try to replace the USB cable. With my old cable, the handphone continuously disconnected to Visual Studio. After replacing the USB cable, then it works properly.

And not only software, hardware like USB cable or the handphone USB connection is dirty could be case.

Yohanes Nurcahyo
  • 601
  • 8
  • 19