Visual Studio 2015 Android模拟器问题

arh*_*ava 4 c++ android visual-studio android-emulator visual-studio-2015

我用"Visual Studio Emulator for Android"下载了"Visual Studio 2015预览版".

模拟器与Apache Cordova App(可以从File - > New - > Project - >"Apache Cordova Blank App"创建).

但是当我尝试调试简单的x86 android c ++应用程序(可以创建File - > New - > Project - >"Native Activity Application Android")时,Visual Studio Android Emulator成功启动,之后Visual Studio发出错误:

1>------ Deploy started: Project: Android.Packaging, Configuration: Debug x86 ------
1>Starting emulator...
1>Error installing the package. The device '169.254.191.177:5555' is invalid or not running.  Please switch to another device, or use the Android Virtual Device (AVD) Manager to start a compatible emulator, or connect a compatible Android device.
1>The device is invalid or is not running.
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
Run Code Online (Sandbox Code Playgroud)

我检查过:

  • Android模拟器的IP地址为169.254.191.177 - 我可以在模拟器设置中看到它.
  • "ping 169.254.191.177" - 正在运作;
  • "telnet 169.254.191.177 5555" - 也在运作.

一些细节:

  • 在VS2015的上部组合框我选择"VS Emulator Android Phone(x86 - 离线)"
  • 我在x86架构中编译了c ++ app
  • 我有Windows 8.1
  • 官方AndroidSDK模拟器可与Visual Studio 2015 c ++调试一起正常工作

Update1:​​adb.exe没有看到VS Android模拟器.为什么 - 这就是问题所在.

Update2:"adb devices"只在命令"adb connect 169.254.191.177:5555"后才开始看到VS模拟器.为什么默认情况下adb看不到VS模拟器 - 这就是问题所在.

小智 9

您是否在开始时看到有关ADB的任何错误消息?考虑到它正在使用cordova,尝试重新启动一次以确保没有一次性问题.如果这不起作用,您可以使用手动连接adb

adb connect <ip>:5555
Run Code Online (Sandbox Code Playgroud)

然后再次尝试该项目.

此外,请确保已在计算机中安装了所有必备软件.创建新项目时,它将打开一个列出先决条件的网页.


小智 7

确保HKLM\Software\Wow6432Node\Android SDK Tools\Path正确无误