Visual Studio and Android Device Monitor doesn't detect any devices

不羁的心 提交于 2019-12-10 13:21:08

问题


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. And here with enabled Developers options I also tried updateing driver to google usb driver, but windows said it's up to date.


回答1:


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!




回答2:


Enable the device for development

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




回答3:


Sometimes just restarting Visual Studio might help




回答4:


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.




回答5:


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.




回答6:


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




回答7:


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...




回答8:


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



来源:https://stackoverflow.com/questions/38224370/visual-studio-and-android-device-monitor-doesnt-detect-any-devices

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!