Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I debug on a real Android device using Xamarin for Visual Studio?

I've found a few links but they don't explain how this is done. I can debug using Xamarin Studio IDE but that IDE (no offense) is lame compared to Visual Studio 2012.
Using Visual Studio 2012, there appears to only be option to select an emulator to debug. So how do I get it to debug on my real device via USB (I already have USB Debugging = true)?

like image 325
jay_t55 Avatar asked Aug 07 '14 21:08

jay_t55


People also ask

How do you debug an app on a real device?

On the device, open the Settings app, select Developer options, and then enable USB debugging (if applicable). Note: If you do not see Developer options, follow the instructions to enable developer options. Set up your system to detect your device. Chrome OS: No additional configuration required.


2 Answers

I'm using Visual Studio 2017 with a OnePlus.

In order get debugging working I did the following.

  1. Go to Settings > About phone and tap Build Number repeatedly until developer mode is enabled
  2. Go into Settings > Developer options and turn USB debugging ON
  3. Connect you phone to your PC via USB. I had to plug my phone into my PC's onboard USB port, not my USB hub as this did not work
  4. You should be prompted to trust your PC (trust it)
  5. Fire up Visual Studio
  6. Open your solution and your device should now be available.

Side note: I have noticed that sometimes it also depends on the cable you use. If you still have no luck, perhaps try another cable.

like image 141
Shane Dixon Avatar answered Oct 23 '22 12:10

Shane Dixon


You will get a confirmation prompt on the android device to ask if the PC is allowed to connect. It's easy to miss this if your device's screen has gone to sleep.

like image 38
Greg M. Avatar answered Oct 23 '22 11:10

Greg M.