如何使用Xamarin for Visual Studio在真实的Android设备上调试? [英] How do I debug on a real Android device using Xamarin for Visual Studio?

查看:385
本文介绍了如何使用Xamarin for Visual Studio在真实的Android设备上调试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找到了一些链接,但是它们没有解释如何完成此操作.我可以使用Xamarin Studio IDE进行调试,但与Visual Studio 2012相比,该IDE(没有冒犯性)是la脚. 使用Visual Studio 2012,似乎只有一个选项可以选择要调试的仿真器.那么,如何通过USB在我的真实设备上调试它(我已经有USB Debugging = true)?

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)?

推荐答案

我正在将Visual Studio 2017与OnePlus一起使用.

I'm using Visual Studio 2017 with a OnePlus.

为了进行调试,我做了以下工作.

In order get debugging working I did the following.

  1. 转到设置>关于手机,然后反复点击内部编号,直到启用了开发人员模式
  2. 进入设置>开发人员选项,然后打开USB调试
  3. 通过USB将手机连接到PC. 我不得不将手机插入PC的板载USB端口,而不是USB集线器,因为这不起作用
  4. 应该提示您信任您的PC(信任它)
  5. 启动Visual Studio
  6. 打开您的解决方案,您的设备现在应该可用了.
  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.

这篇关于如何使用Xamarin for Visual Studio在真实的Android设备上调试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆