如何将虚拟设备/仿真器附加到Visual Studio Xamarin Android项目? [英] How can I attach a virtual device/emulator to Visual Studio Xamarin Android project?

查看:139
本文介绍了如何将虚拟设备/仿真器附加到Visual Studio Xamarin Android项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为Ice Cream Sandwich创建了一个Android应用,并且未在默认代码中添加任何内容(除了更改"Hello World"消息的文本-我无法-或将不会-帮助自己).

I created an Android app for Ice Cream Sandwich and added nothing to the default code (except changing the text of the "Hello World" message - I couldn't - or wouldn't - help myself).

我捣碎了F5.

Nada-未连接任何设备.下拉列表显示未连接设备".

Nada - no device attached. The dropdown list says "No Devices Attached."

因此,我通过Xamarin安装添加的打开Android模拟器管理器"按钮进行设置:

So, I set one up via the "Open Android Emulator Manager" button that the Xamarin install added:

我再次捣碎了F5;同样的问题.它说从下拉列表中选择一个设备(我忘记了明确选择我刚刚设置的设备).但是...列表中什么都没有.为什么不呢?

I mashed F5 again; same problem. It said to pick a device from the dropdown list (I had forgotten to explicitly choose the one I just set up). But...there's nothing in the list. Why not?

它现在正在工作;我认为它没有显示我要选择的设备,因为某些Android软件包正在后台下载(通过Xamarin也添加了"Android SDK Manager").

It's working now; I reckon it was not showing me my device for selection because some Android packages were downloading in the background (via the "Android SDK Manager", also added by Xamarin).

两年后,当我与" Eclipse/Android/Java交往时,我感到很困惑.

I feel transported back two years, when I was "messing around with" Eclipse/Android/Java.

推荐答案

太棒了,它可以正常工作了.

Awesome that you got it working.

我发现列表并不总是更新,而重新启动Visual Studio是将仿真器放入要调试的设备列表中的最快方法.

I found that list doesnt always update and a restart of Visual Studio was the quickest way to get the emulator in the list of devices to debug against.

如果这样不起作用,请尝试重新启动ADB服务.

If that doesnt work, try restarting the ADB service.

  • 启动模拟器.
  • 打开命令提示符,浏览到Android SDK的位置(默认为'%LocalAppData%\ Android \ android-sdk \ platform-tools').
  • 运行命令"adb kill-server".
  • 运行"adb设备"(这应将正在运行的仿真器显示为连接的设备).
  • 重新启动VS,您应该在列表中看到仿真器.

这篇关于如何将虚拟设备/仿真器附加到Visual Studio Xamarin Android项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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