James Montemagno
James Montemagno

Live, Love, Bike, and Code.

Live, Love, Bike, and Code

Share


Tags


James Montemagno

Setting up Visual Studio 2017 for Xamarin Development

Visual Studio 2017 was just released yesterday, and it is awesome! You can re-live all the keynote and demo deep dives on Channel 9. There are tons of new features and a huge revamp to installation but things to me still aren’t absolutely perfect in the setup of how I like to develop. So in the spirit of my Cycle 8 and Cycle 9 installation guides I am proud to bring you the ultimate VS 2017 Setup Guide for Xamarin!

Installation

The installation is brand new and pretty awesome. You now pick “workloads” of development that you want to install and it will take care of the rest. It is highly configurable, but the default for me of installing tons of stuff was super fast and installed in under 30 minutes! If you just do the core VS 2017 install it will be installed in under 5 minutes! That is crazy. For Xamarin development there is literally a Xamarin checkbox under mobile, it is the first choice and really the only choice you need:

Some other work loads I recommend are pointed out including:

Additional Configuration for iOS

Since the Xamarin documentation is amazing on this go read it here.

Additional Configuration for Android

There are a few tweaks here that I must make to be happy for Android development. While the installer is nearly perfect, here is my recommendation.

1.) Install the latest JDK 1.8 x64 (currently 8u121)

Installing the x64 version on Windows is extremely important because it is needed for custom controls in the Android designer and also for the Xamarin.Forms Previewer to work. If you don’t have a x64 machine know that these are a few of the restrictions that may not work on your machine.

You will then need to set the path in the tools-options menu:

2.) Update Android SDKs & Emulators

This is just good to know in general because you will need to update things every once in a while, but from Tools -> Android, you are able to get to the Android SDK and Emulators, let’s start with SDK Manager.

The installer sets us up for success with SDK 23 and the build tools needed, but I like to install the latest and greatest for API 24 and optionally you can pick SDK Platform 25:

The first 3 are really important and you will want to grab those to compile with the latest and greatest.

Android Emulators

This actually gets its own section because it is a bit complicated. We now install the default Google Emulators, both Arm and x86. The latter, x86 are extremely fast, but require you to turn off Hyper-V and ensure that you have the Intel Hardware Accelerated Execution Manager (Intel HAXM) installed. So first, go turn off Hyper-V and then install Haxm and you will be nice and happy.

I then recommend going to the Android Emulator Manager and creating a new emulator with my preferred options:

I hear you yelling right now, JAMES I NEED MY HYPER-V!!!!!! Alright fine, then don’t install HAXM and install the Hyper-V VS Emulators for Android! Now there are some things to know with these. First, they are pretty nice and fast emulators. Second, you aren’t going to get the latest and greatest as they haven’t been updated in a while. Third, if you are running a Skylake or newer processor you need to turn on compatibility mode or your app will fail to debug. Lastly, there are no google play services or maps on them unless you hack around it and install gapps with this awesome guide.

Creating your first app!

It is time! Let’s create a new app with File -> new project, which will reveal all the Xamarin templates for mobile development:

If you are creating a solo iOS/Android/tvOS app with high fidelity UIs for each platform then head to those sections, if you want a cross platform solution or a Xamarin.Forms solution and project then head to Cross-Platform to discover the new Cross Platform App Template.

This will bring up a wizard to guide you through creating your first Blank app for Xamarin Native or Xamarin.Forms! 

There you have it! You should be all setup for success and building mobile apps in no time. Be sure to checkout the Xamarin blog on all the new stuff in VS 2017.

Copyright © James Montemagno 2017 All rights reserved. Privacy Policy

View Comments