Tuesday, September 15, 2015

Run Visual Studio Emulator for Android on Visual Studio 2013 Ultimate

Trying my hand at some Android programming as I work through the Xamarin courseware.  Man I did not realize how bad the Android emulators are.  Fortunately, MS comes to the rescue with a port of its fine xde which I have used for my WP8 programming.

I decided to install the emulator after trying to get the existing emulators to run.  I have VS 2013 SP4 running.  I am not ready to upgrade to 2015 since I am in the middle of a project and can't stop to upgrade. 

Problem:  

We have a work dev image which is being actively used by our staff.  We are in the midst of testing and release for our crossplatform application.  We are not ready to go to Visual Studio 2015.  We would however like to get the Android emulator for VS working with our current dev install.  We are tired of the Android emulator which is slow and GenyMotion was an extra solution to maintain.  Since we are already familiar with the Windows Phone emulator we wanted to go with the MS Android Emulator.

Challenge:

Option 1: Not an option now
There are any number of blogs that tell you just to upgrade to VS 15 and be done.

Option 2:  Fail
Install the standalone emulator (link??) .   I did attempt this but I could not get Visual Studio to recognize the emulator and debug against it.

Option 3: Solution
I attempted to do a side by side install of VS 13/15.  This did the trick.  Note this was not a full install of VS 2015 we just added the bare bones to get us the emulator and what was needed to run it.  If you do full install to include all the 3rd party cross platform packages (Xamarin).  You will bork your existing VS 2013 install.

Solution:

What needs to be done:
  1. Get an image of VS 2015.  We used VS 2015 Ultimate.
  2. Run up the installer and make the following selections. 
    • Microsoft Web Developer Tools
    • Windows 8.1 and Windows Phone 8.0/8.1 Tools > Emulators for Windows Phone 8.1
    • Microsoft Visual Studio Emulator for Android
  3. The next step is to start up Visual Studio 2015 and let the tool prompt you for Extensions and updates to your new install.
  4. The notifications window will prompt you with a list of options, look for Hyper-V Android Emulator Launch.  Double click on the link. 
  5. Visual Studio Gallery will now be started, select the Hyper-V Android Emulator Launch option. 

  6. Let the install run it will require you to restart VS. 
  7. Now run up your VS 2013 install.  You will now have a new option on the menu.  

  8. This icon is the emulator option.  Once selected the emulator is started in a separate window.
  9. Please note that when you run up your Android project the Launch menu will not display the emulator until it is turned.  Once it is run up then you see the emulator listed in the launch debug menu
     

  10. Now I can run up my sample Android app and debug with VS 2013 against the Android emulator.
     


Source

  1. https://www.visualstudio.com/en-us/features/msft-android-emulator-vs.aspx
  2. https://canbilgin.wordpress.com/2015/02/17/android-emulator-launcher-for-visual-studio-2013/
  3. https://visualstudiogallery.msdn.microsoft.com/4201105a-fb80-48c0-ad42-b163802c9f61
  4. http://stackoverflow.com/questions/28239195/debugging-cordova-app-android-with-visual-studio-2015-new-emulator
  5. http://stackoverflow.com/questions/28253436/visual-studio-emulator-for-android-in-visual-studio-2013
  6. http://stackoverflow.com/questions/31613607/visual-studio-2015-emulator-for-android-not-working-xde-exe-exit-code-3
  7. http://developer.xamarin.com/guides/android/getting_started/installation/android-player/
  8. https://msdn.microsoft.com/en-us/library/dn757059(v=vs.120).aspx

No comments:

Post a Comment