4

I downloaded "Visual Studio 2015 Preview" with "Visual Studio Emulator for Android".

Emulator is working good with Apache Cordova App (that can be created from 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:

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.

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

Update1: adb.exe doesn't see VS Android emulator. Why - that's the question.

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.

arhipov slava
  • 63
  • 1
  • 2
  • 6

3 Answers3

9

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 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.

Prem
  • 110
  • 4
  • 1
    You're my hero :) After command "adb connect :5555" adb devices began to see emulator. And Visual Studio began to see "VS Emulator Android Device - 480x800 (x86 - 169.254.220.177:5555)". Thank you again, you saved my day) But the question is - why by default adb devices don't see VS emulator) – arhipov slava Nov 20 '14 at 10:07
  • Unfortunately there isn't enough information to tell what happened here. If the adb connect failed, you should've received an error dialog. Given that you didn't see that, it is most likely a bug. We will continue to monitor and see for this problem and address it if we can reproduce it. – Prem Dec 01 '14 at 22:12
  • 1
    I get "already connect to " when manually running adb, but my vs session never connects to remote debugger. The app deploys and starts but debugger never attaches and build just sits there hung. – Aaron Stainback Feb 23 '15 at 04:24
7

make sure HKLM\Software\Wow6432Node\Android SDK Tools\Path is correct

avestnik
  • 150
  • 4
  • 8
4

You can update the registry manually:

  1. In regedit, navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node.
  2. Create a new key named Android SDK Tools.
  3. Navigate to that key.
  4. 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.
  5. then restart the emulator.

Now, You will see VS emulator by using "adb devices".

aaron9012
  • 41
  • 1