Setup Xamarin for Windows

To build native iOS, Android, and Windows apps from a common C#/.NET code base using Xamarin, you need the following:

  • For working with Windows and Android apps: a Windows development machine with Visual Studio 2015 and Xamarin 4 installed (see note below).

  • For working with iOS apps: a Mac with OS X Yosemite (10.10.5) or above, with XCode and Xamarin installed.

System_CAPS_noteNote

As of March 31, 2016, all of Xamarin is included with all editions of Visual Studio at no extra cost and does not need a separate license. Xamarin Studio Community for Mac is also free for students, OSS developers, and small teams. Note that for existing installations of Visual Studio that are configured with earlier Xamarin licenses, you must update Xamarin to version 4.0.3.214 or higher. To do this, go to Tools > Options > Xamarin > Other, click the Check Now link, and download the 4.0.3.214 update. When you restart Visual Studio, go to Tools > Xamarin Account... and you should see updated status.

  1. Xamarin account: go to https://www.xamarin.com/ and click Sign In on the upper right of the page, then click Create a new account on the page that appears. Select an email address and password for your Xamarin account; you'll use these later on.  

  2. For Windows and Android:

    1. Recommended: a physical Windows machine (not a VM) running Windows 8 or later, which allows use of the fast, Hyper-V based Visual Studio Emulator for Android. (Did we mention that you need a physical machine and not a VM?)

    2. You can use a machine with Windows 7 or earlier, in which case you’ll use the Xamarin Player for Android as the emulator.

  3. For iOS:

    1. Mac or Mac mini with OS X Yosemite running OS X 10.10.5 or later (required for Xcode 7.1).

    2. A Mac is necessary only to compile and debug iOS apps, attach to the iOS simulator or tethered devices, and to use the storyboard designer for designing the user interface. Older models are entirely sufficient for this secondary role.

System_CAPS_tipTip

These instructions apply to Visual Studio 2015. To use Xamarin with Visual Studio 2013 (Update 2 is required), follow the instructions for direct Xamarin install (xamarin.com).

  1. Download and launch the installer for any edition of Visual Studio 2015 (Community, Professional, or Enterprise). Visual Studio 2015 Community is the free edition; the Professional and Enterprise editions can be used on a trial basis for 30 days after which you'll need to purchase a license.

    1. If you already have Visual Studio installed, open Control Panel > Programs and Features, choose the Visual Studio 2015 item, and click Change. When the installer opens, click Modify and skip to step 3 below.

  2. Within the installer, select a Custom install:

    Choosing the Custom option in Visual Studio installation
  3. Check the following boxes:

    1. Cross-Platform Mobile Development > C#/.NET (Xamarin). This will also automatically select various Android tools under Common Tools and Software Development Kits.

      Select the Xamarin option under Cross-Platform Mobile Development
    2. For Windows 8+: Cross-Platform Mobile Development > Microsoft Visual Studio Emulator for Android. Note: if you’re using a Windows 7 or earlier machine, or running Windows on a Mac, make sure this is unchecked. See “Note about emulators on Windows machines” after step 5.

    3. (Optional) If you plan on targeting Windows devices, also check Windows and Web Development > Universal Windows App Development Tools and/or Windows 8.1 and Windows Phone 8.0/8.1 Tools. These include options for installing emulators images that will take longer to download; you can always return to the Visual Studio installer to add them later.

  4. Click the Install button and let the process run. Again, this will take some time to complete, during which time you can continue with the Mac setup instructions and go through

  5. Once installation is complete, launch Visual Studio and sign in with your Microsoft account if prompted (this is the same account you use with Windows). Then check for Xamarin updates through Tools > Options > Xamarin or Tools > Options > Xamarin > Other, where you’ll find aCheck Now link:

    Checking for Xamarin updates in Visual Studio options
    System_CAPS_noteNote

    As noted earlier, be sure to update Xamarin to version 4.0.3.214 or higher to avoid issues with earlier Xamarin licenses.

  6. For Windows 7 and earlier, or running Windows on a Mac, used the Android SDK Emulator. See note below.

Note about emulators on Windows machines: Because CPUs support only one virtualization technology at a time, it’s best to have only one in use on a development machine. There are three main virtualizations technologies are Hyper-V (used by the Visual Studio Emulator for Android and the Windows Phone emulator), Virtual Box (used by Genymotion), and Intel HAXM (used by the Android SDK emulator). Because of various issues between Hyper-V and Virtual Box, it’s best to use emulators of only one type on any given machine, hence the recommendations above to use Hyper-V on Windows 8 and above machines, and Intel HAXM emulators on Windows 7 and earlier as well as when running Windows on a Mac.

No Comments

Add a Comment

As it will appear on the website

Not displayed

Your website