Android模拟器不显示在Visual Studio中。

时间:2021-10-20 16:00:22

I made an Android Virtual Device. It runs on the SDK emulator using Intel HAXM. I was able to see it in Visual studio (debug devices drop down list) and debug my applications on it. This is great for when I don't have a physical device to hand. Then something happened!?! It refuses to show up now?

我做了一个Android虚拟设备。它使用Intel HAXM在SDK模拟器上运行。我可以在Visual studio中看到它(调试设备下拉列表),并调试我的应用程序。这对于我手头没有物理设备的时候是很好的。然后发生了一件事! ? !它现在拒绝出现?

Over the last week I have tried (In no particular order):

在过去的一周里,我尝试过(没有特别的顺序):

  • Recreating my virtual device.
  • 重建我的虚拟设备。
  • Reinstalling visual studio.
  • 重新安装visual studio。
  • Reinstalling Android SDK.
  • 重新安装Android SDK。
  • Installing both of the above as an administrator.
  • 将上述两者都安装为管理员。
  • Checking the SDK path in the windows registry.
  • 检查windows注册表中的SDK路径。
  • Tried adb kill-server / start-server.
  • 尝试了adb killserver / start-server。
  • Checked that Adb can see the device - it can.
  • 检查Adb是否可以看到设备——它可以。
  • Tried uninstalling/reinstalling HAXM manually.
  • 试着卸载/重新安装手动HAXM。
  • Made sure my project targets API of the emulator.
  • 确保我的项目目标是模拟器的API。
  • Made sure that the build active configuration matches the emulator.
  • 确保构建活动配置与仿真器匹配。
  • Ended any other ADB processes using task manager (leaving just the one for visual studio).
  • 使用任务管理器结束任何其他ADB进程(只留下一个用于visual studio)。
  • Checked windows event log for any warnings/errors. Nothing.
  • 检查windows事件日志中是否有任何警告/错误。什么都没有。

I have read these. Also no joy...

我读了这些。也没有欢乐…

Other info:

其他信息:

  • I am using Visual Studio 2015 Community.
  • 我正在使用Visual Studio 2015社区。
  • Physical devices work and appear without fail in the devices drop down!
  • 物理设备的工作和出现在设备的下降!
  • latest android SDK
  • 最新的android SDK

5 个解决方案

#1


6  

I had a similar issue using VS 2015 with Android Emulator Manager (AVD). I have to start my emulator from the Android Emulator Manager and then it will show up in the debug devices drop down list, but one day it didn't show up. Tools > Android > Restart Adb Server fixed it for me.

我在使用VS 2015时也遇到过类似的问题。我必须从Android模拟器管理器启动我的模拟器,然后它会出现在调试设备下拉列表中,但是有一天它没有出现。工具> Android >重启Adb服务器为我修复。

#2


0  

Similar issue here, I had a series of android emulators setup in Visual Studio 2015 Android Emulator Manager (AVD), but when I tried to run a xamarin.forms sample, none of the emulators I created were showing up in the debug targets drop-down.

类似的问题,我在Visual Studio 2015 android Emulator Manager (AVD)中设置了一系列android模拟器,但当我尝试运行xamarin时。表单示例,我创建的模拟器中没有一个出现在debug target下拉列表中。

What fixed it for me was to set the android project as StartUp Project manually (right-click project > set as startup project)

对我来说,将android项目作为启动项目(右键单击project >设置为启动项目)是固定的。

For some reason (bug/feature?) it doesn't suffice to just change the selected item from Visual Studio menu drop-down 'startup projects'. Hope this helps!

由于某些原因(bug/特性?),仅仅从Visual Studio菜单下拉菜单“启动项目”中更改所选项目是不够的。希望这可以帮助!

#3


0  

After making sure that you have installed the required software properly (having the Hyper-V option checked in Windows Features, also enabled in BIOS) :

在确保正确安装了所需的软件之后(在Windows特性中检查Hyper-V选项,在BIOS中也启用):

  1. Go to your project's properties by selecting the project in Solutions Explorer and clicking ALT+ENTER
  2. 通过在解决方案资源管理器中选择项目并单击ALT+ENTER进入项目的属性
  3. After that, make sure that the Minimum Android to target is greater than or equal to at least one of your Device Profiles in Visual Studio Emulator Manager.
  4. 之后,确保目标的最小Android大于或等于至少一个您的设备配置文件在Visual Studio仿真器管理器中。

#4


0  

I had this problem and realised that the visual studio environment variable was pointing to: C:\ProgramData\Microsoft\AndroidSDK\25 & not 'C:\Program Files (x86)\Android\android-sdk' where I'd created my new AVD.

我遇到了这个问题,并意识到visual studio环境变量指向的是:C:\ProgramData\Microsoft\AndroidSDK\25 & not 'C:\程序文件(x86)\Android\ Android -sdk,在那里我创建了新的AVD。

So, I simply changed that and... of course it didn't work.

所以,我只是改变了这个。当然没用。

However, all is not lost. Simply fire up the emulator in AVD Manager, and drag and drop the .apk file on top of it and it installs!

然而,并不是所有的东西都丢失了。只需在AVD管理器中启动仿真器,并在其上拖放.apk文件,它就会安装!

#5


0  

I've had similar issues in VS2015. A solution that worked for me was Tools> Android > Restart Adb Server as @chlochlofasho mentioned.

我在VS2015年遇到过类似的问题。我的一个解决方案是工具> Android >重新启动Adb服务器,@chlochlofasho提到。

Another time, what worked was simply: Cleaning sln, rebuilding sln, and then just restarting VS

另一次,有效的方法很简单:清理sln,重建sln,然后重新启动VS

#1


6  

I had a similar issue using VS 2015 with Android Emulator Manager (AVD). I have to start my emulator from the Android Emulator Manager and then it will show up in the debug devices drop down list, but one day it didn't show up. Tools > Android > Restart Adb Server fixed it for me.

我在使用VS 2015时也遇到过类似的问题。我必须从Android模拟器管理器启动我的模拟器,然后它会出现在调试设备下拉列表中,但是有一天它没有出现。工具> Android >重启Adb服务器为我修复。

#2


0  

Similar issue here, I had a series of android emulators setup in Visual Studio 2015 Android Emulator Manager (AVD), but when I tried to run a xamarin.forms sample, none of the emulators I created were showing up in the debug targets drop-down.

类似的问题,我在Visual Studio 2015 android Emulator Manager (AVD)中设置了一系列android模拟器,但当我尝试运行xamarin时。表单示例,我创建的模拟器中没有一个出现在debug target下拉列表中。

What fixed it for me was to set the android project as StartUp Project manually (right-click project > set as startup project)

对我来说,将android项目作为启动项目(右键单击project >设置为启动项目)是固定的。

For some reason (bug/feature?) it doesn't suffice to just change the selected item from Visual Studio menu drop-down 'startup projects'. Hope this helps!

由于某些原因(bug/特性?),仅仅从Visual Studio菜单下拉菜单“启动项目”中更改所选项目是不够的。希望这可以帮助!

#3


0  

After making sure that you have installed the required software properly (having the Hyper-V option checked in Windows Features, also enabled in BIOS) :

在确保正确安装了所需的软件之后(在Windows特性中检查Hyper-V选项,在BIOS中也启用):

  1. Go to your project's properties by selecting the project in Solutions Explorer and clicking ALT+ENTER
  2. 通过在解决方案资源管理器中选择项目并单击ALT+ENTER进入项目的属性
  3. After that, make sure that the Minimum Android to target is greater than or equal to at least one of your Device Profiles in Visual Studio Emulator Manager.
  4. 之后,确保目标的最小Android大于或等于至少一个您的设备配置文件在Visual Studio仿真器管理器中。

#4


0  

I had this problem and realised that the visual studio environment variable was pointing to: C:\ProgramData\Microsoft\AndroidSDK\25 & not 'C:\Program Files (x86)\Android\android-sdk' where I'd created my new AVD.

我遇到了这个问题,并意识到visual studio环境变量指向的是:C:\ProgramData\Microsoft\AndroidSDK\25 & not 'C:\程序文件(x86)\Android\ Android -sdk,在那里我创建了新的AVD。

So, I simply changed that and... of course it didn't work.

所以,我只是改变了这个。当然没用。

However, all is not lost. Simply fire up the emulator in AVD Manager, and drag and drop the .apk file on top of it and it installs!

然而,并不是所有的东西都丢失了。只需在AVD管理器中启动仿真器,并在其上拖放.apk文件,它就会安装!

#5


0  

I've had similar issues in VS2015. A solution that worked for me was Tools> Android > Restart Adb Server as @chlochlofasho mentioned.

我在VS2015年遇到过类似的问题。我的一个解决方案是工具> Android >重新启动Adb服务器,@chlochlofasho提到。

Another time, what worked was simply: Cleaning sln, rebuilding sln, and then just restarting VS

另一次,有效的方法很简单:清理sln,重建sln,然后重新启动VS