I downloaded "Visual Studio 2015 Preview" with "Visual Studio Emulator for Android".
我用“Visual Studio Emulator for Android”下载了“Visual Studio 2015预览版”。
Emulator is working good with Apache Cordova App (that can be created from File -> New -> Project -> "Apache Cordova Blank App").
模拟器适用于Apache Cordova App(可以从File - > New - > Project - >“Apache Cordova Blank App”创建)。
But when I try to debug simple x86 android c++ app (that can be created File -> New -> Project -> "Native Activity Application Android"), Visual Studio Android Emulator is launched successfully, and after that Visual Studio give an error:
但是当我尝试调试简单的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 ==========
I've checked:
- Android Emulator has ip address 169.254.191.177 - I can see it in emulator settings.
- "ping 169.254.191.177" - is working;
- "telnet 169.254.191.177 5555" - is working too.
Android模拟器的IP地址为169.254.191.177 - 我可以在模拟器设置中看到它。
“ping 169.254.191.177” - 正在运作;
“telnet 169.254.191.177 5555” - 也在运作。
Some details:
- In VS2015 in upper combobox I select "VS Emulator Android Phone (x86 - offline)"
- I compiled c++ app in x86 architecture
- I have Windows 8.1
- Official AndroidSDK emulators works correctly with Visual Studio 2015 c++ debugging
在VS2015的上部组合框我选择“VS Emulator Android Phone(x86 - 离线)”
我在x86架构中编译了c ++ app
我有Windows 8.1
官方AndroidSDK模拟器可与Visual Studio 2015 c ++调试一起正常运行
Update1: adb.exe doesn't see VS Android emulator. Why - that's the question.
Update1:adb.exe没有看到VS Android模拟器。为什么 - 这就是问题所在。
Update2: "adb devices" began to see VS emulator only after command "adb connect 169.254.191.177:5555". Why by default adb don't see VS emulator - that's the question.
Update2:“adb devices”仅在命令“adb connect 169.254.191.177:5555”后才开始看到VS模拟器。为什么默认情况下adb看不到VS模拟器 - 这就是问题所在。
3 个解决方案
#1
8
Do you see any error message in the beginning regarding ADB? Considering that it is working on cordova, try rebooting once to make sure there is no one-off problems. If that doesn't work, you can manually connect adb using
您是否在开始时看到有关ADB的任何错误消息?考虑到它正在使用cordova,请尝试重新启动一次,以确保没有一次性问题。如果这不起作用,您可以使用手动连接adb
adb connect <ip>:5555
And then try the project again.
然后再次尝试该项目。
Also, make sure you have all the pre-requisite installed in your machine. When you create a new project, it will open a web page listing the pre-requisites.
此外,请确保已在计算机中安装了所有必备软件。创建新项目时,它将打开一个列出先决条件的网页。
#2
7
make sure HKLM\Software\Wow6432Node\Android SDK Tools\Path is correct
确保HKLM \ Software \ Wow6432Node \ Android SDK Tools \ Path正确无误
#3
4
You can update the registry manually:
您可以手动更新注册表:
- In regedit, navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node.
- Create a new key named Android SDK Tools.
- Navigate to that key.
- Create a new string value named Path. Set its value to the location of your Android SDK, which will be like C:\Users\YourName\AppData\Local\Android\sdk.
- then restart the emulator.
在regedit中,导航到HKEY_LOCAL_MACHINE \ SOFTWARE \ Wow6432Node。
创建一个名为Android SDK Tools的新密钥。
导航到该密钥。
创建一个名为Path的新字符串值。将其值设置为Android SDK的位置,类似于C:\ Users \ YourName \ AppData \ Local \ Android \ sdk。
然后重启模拟器。
Now, You will see VS emulator by using "adb devices".
现在,您将通过使用“adb devices”看到VS模拟器。
#1
8
Do you see any error message in the beginning regarding ADB? Considering that it is working on cordova, try rebooting once to make sure there is no one-off problems. If that doesn't work, you can manually connect adb using
您是否在开始时看到有关ADB的任何错误消息?考虑到它正在使用cordova,请尝试重新启动一次,以确保没有一次性问题。如果这不起作用,您可以使用手动连接adb
adb connect <ip>:5555
And then try the project again.
然后再次尝试该项目。
Also, make sure you have all the pre-requisite installed in your machine. When you create a new project, it will open a web page listing the pre-requisites.
此外,请确保已在计算机中安装了所有必备软件。创建新项目时,它将打开一个列出先决条件的网页。
#2
7
make sure HKLM\Software\Wow6432Node\Android SDK Tools\Path is correct
确保HKLM \ Software \ Wow6432Node \ Android SDK Tools \ Path正确无误
#3
4
You can update the registry manually:
您可以手动更新注册表:
- In regedit, navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node.
- Create a new key named Android SDK Tools.
- Navigate to that key.
- Create a new string value named Path. Set its value to the location of your Android SDK, which will be like C:\Users\YourName\AppData\Local\Android\sdk.
- then restart the emulator.
在regedit中,导航到HKEY_LOCAL_MACHINE \ SOFTWARE \ Wow6432Node。
创建一个名为Android SDK Tools的新密钥。
导航到该密钥。
创建一个名为Path的新字符串值。将其值设置为Android SDK的位置,类似于C:\ Users \ YourName \ AppData \ Local \ Android \ sdk。
然后重启模拟器。
Now, You will see VS emulator by using "adb devices".
现在,您将通过使用“adb devices”看到VS模拟器。