Installing Xamarin.iOS on Windows
- PDF for offline use:
- Xamarin University:
- Related Articles:
Let us know how you feel about this.
last updated: 2016-12
This article shows how to set up Xamarin.iOS for Visual Studio. It covers the installation process for the Xamarin extension for Visual Studio, and discusses connecting to the Apple SDK installed on the Mac.
- Configuring The Mac
- Windows Installation
- Installation Complete
Xamarin.iOS for Visual Studio allows iOS applications to be written and tested on Windows computers, with a networked Mac providing the build and deployment service.
Developing for iOS inside Visual Studio provides the ability to:
- Create cross-platform solutions for iOS, Android, and Windows applications.
- Use Visual Studio tools (such as Resharper and Team Foundation Server ) for all your cross-platform projects, including iOS source code.
- Work with a familiar IDE, while taking advantage of Xamarin.iOS bindings of all Apple’s APIs
Xamarin.iOS for Visual Studio supports configurations where Visual Studio is running inside a Windows virtual machine on a Mac (using Parallels or VMWare), or when it is on a separate machine that is visible on the same network as a Mac. Regardless of which configuration works best for you, Visual Studio will connect to the Mac promptly and securely using SSH.
This article covers the steps to install and configure the Xamarin.iOS tools on both the Mac and Windows machine, as well as the steps to connect to the Mac host so that developers can build, debug, and deploy Xamarin.iOS applications using Visual Studio.
The diagram below shows a simple overview of the Xamarin.iOS development workflow:
Visual Studio actually launches a separate MSBuild process to build the projects. This process creates a new connection to the Mac, meaning there are actually two SSH connections from Windows to Mac when VS builds. Building from the command-line only creates the one MSBuild process. For the simplicity of this diagram, all the connections are simply represented by one arrow.
Xamarin.iOS for Visual Studio accomplishes an amazing feat: it lets developers create, build, and debug iOS applications on a Windows computer using the Visual Studio IDE. It cannot do this alone – iOS applications cannot be created without Apple’s compiler, and they cannot be deployed without Apple’s certificates and code-signing tools. This means that a Xamarin.iOS for Visual Studio installation requires a connection to a networked Mac OS X computer in order to perform these tasks. Once configured, Xamarin’s tools will make the process as seamless as possible.
The system requirements are:
- Windows 7 or higher.
- Visual Studio 2012 Professional or higher a. If you have an Enterprise license, you will need to install Visual Studio Enterprise.
- Xamarin for Visual Studio.
The Xamarin plug-in cannot be used with Express editions of Visual Studio due to lack of plug-in support. Xamarin is supported in Visual Studio Community.
- A Mac running OS X El Capitan (10.11) or higher (although the latest stable version is recommended).
- Xamarin iOS SDK.
Apple’s Xcode(7+) IDE and iOS SDK (although the latest stable versionm from the Mac App Store is recommended).
The Windows computer must be able to reach the Mac via the network.
Apple Developer Account
To deploy applications to a device or to submit them to the App Store, an Apple Developer account is required. The relevant developer certificates and provisioning profiles must be created and installed on the networked Mac before Xamarin.iOS for Visual Studio can work. See the Device Provisioning article for steps to obtain a development certificate and to provision a device.
Features and limitations
Xamarin.iOS for Visual Studio enables the creation, editing, building, and deployment of Xamarin.iOS projects from Windows. This includes the following features:
- Create new iOS projects.
- Edit iOS projects and cross-platform solutions that also include Xamarin.Android and Windows Phone projects.
- Compile iOS projects and cross-platform solutions that also include Xamarin.Android and Windows Phone projects.
- Storyboard and .xib support using the iOS Designer.
- Deploy and debug iOS applications, where the app itself runs in a simulator on the network-connected Mac, or on a device connected to the Mac.
iOS simulator on Windows – For more information on using the iOS simulator on Windows, refer to this guide.
Configuring The Mac
The simplest way to install Xamarin.iOS on your Mac is via the Xamarin Unified Installer, which will also install the necessary prerequisites. Follow these instructions to install Xamarin.iOS tools on your Mac host and to activate your Xamarin license.
Once the software is installed, follow the steps in the next section to configure Xamarin.iOS on OS X to allow Xamarin for Visual Studio to connect to it.
To access communication between the Xamarin extension for Visual Studio and your Mac, you will need to allow Remote Login on your Mac. Follow the steps below to set this up:
Open Spotlight (Cmd-Space) and search for Remote Login and then select the Sharing result. This will open the System Preferences at the Sharing panel.
Tick the Remote Login option in the Service list on the left in order to allow Xamarin for Visual Studio to connect to the Mac.
Make sure that Remote Login is set to allow access for All users, or that your Mac username or group is included in the list of allowed users in the list on the right.
The Mac should now be discoverable by Visual Studio if it's on the same network.
In addition to this, if you have the OS X firewall set to block signed applications by default, you may need to allow mono-sgen to receive incoming connections. An alert dialog will appear to prompt you if this is the case.
iOS Developer Setup
For iOS development, it is important that the Mac machine is configured with the relevant signing identities. This allows you to correctly sign your apps so that they can be distributed either via the App Store or Ad Hoc. Follow the link below for instructions on setting up a Mac for iOS development with Xamarin:
Once your Mac is configured, it’s time to set up your Windows computer.
Visual Studio 2015 provides an option to install Xamarin's tools for VS during setup. Refer to Microsoft's Install Xamarin with Visual Studio guide for more information on how to do this.
For information on installing Xamarin on VS2017, refer to this FAQ.
To install the tools for other versions of Visual Studio the Xamarin Universal Installer, which is found here, provides the simplest way to install Xamarin's software on your Windows machine.
The installer includes a Xamarin Bonjour Service (Apple’s network discovery protocol), which is installed at the end of the process. Installing the Xamarin Bonjour Service requires Administrator rights, so expect to be prompted twice to allow installation as an Administrator.
Note: on Windows 8 you must run the installer as an Administrator. The simplest way to do this is start a Command Prompt by right-clicking on cmd.exe and choosing to Run as Administrator... and execute the installer MSI on the command line:
Be sure the file name is correct.
This does not apply to Windows 8.1.
The Xamarin Universal Installer will guide you through the necessary steps to install Xamarin Software which, amongst others, includes the following:
- Xamarin for Visual Studio (This can also be installed as part of Visual Studio 2015)
The Xamarin downloads page can also be used to download the current version, and previous versions, of Xamarin.iOS for Visual Studio.
Using a Windows Virtual Machine
Xamarin.iOS for Visual Studio can be run inside a Windows virtual machine on OS X, using applications such as Parallels or VMWare.
Parallels and Retina Macbook Pros
When using a Windows Virtual Machine inside Parallels 10 on a Macbook Pro with Retina Display, you should check the Video Hardware Settings to ensure Enable Retina resolution is not checked (in previous versions of Parallels you would select the Scaled option). If this is not set correctly some elements of the IDE will be poorly rendered and difficult to use.
After the installation process is complete, there are still a few more steps required to get everything working:
- Link Your Xamarin Account – This ensures that all features you are entitled to are enabled. You can create a new Xamarin Account if required.
- Connect Visual Studio to the Mac – Visual Studio must be connected to the Mac build host before it can build Xamarin.iOS projects.
- Configure the Visual Studio Toolbar – This will let you easily access Xamarin.iOS features in Visual Studio.
Linking to your Xamarin Account
Note: This is only applicable if you have a valid Xamarin license and you want to continue to use it. If you have a Professional or Enterprise MSDN subscription, ensure that you have logged in to Visual Studio. Logging in with your MSDN subscription will allow you access to the full suite of Xamarin Products. Alternatively, you can also take advantage of the Visual Studio Community Edition, which will allow you to develop with Xamarin for free. You do not need to log in to benefit from Xamarin in the Community Edition.
If you have an existing Xamarin license you must link your Xamarin account to Visual Studio by signing in to access all the features you are entitled to, and to activate your license. Follow the steps below to do this.
In Visual Studio, go to the Tools > Xamarin Account... menu item:
The Xamarin Account dialog will appear, click Log In to enter your Xamarin credentials:
Enter your Xamarin Account details and click Log In:
After a few seconds, your Xamarin subscription will be activated with the relevant subscription tier that you have purchased:
You'll now be returned to the Xamarin Account dialog screen indicating that your Xamarin Account has been successfully linked to Xamarin for Visual Studio:
Connecting to the Mac
A connection is made from Xamarin.iOS for Visual Studio to your Mac build host via an SSH connection between machines. This has completely replaced the Mac Build Host application, which is no longer installed on your machine. For more information on the connection, refer to the Connecting to Mac guide.
To connect your Mac, follow the steps below:
Browse to Tools > Options and under Xamarin select iOS Settings:
Providing the Mac has been correctly configured to allow Remote Login, you should be able to select your Mac in the list:
This will prompt for the administrative credentials of your Mac host:
When you have connected, it will display the 'Connection Successful' icon next to the machine name:
You will be reconnected each time you start Visual Studio.
Visual Studio Toolbar Configuration
When an iOS project is open the iOS Toolbar will be visible by default, and does not need to be configued.
The steps below can be used if the iOS toolbar does not appear, or incase you need to toggle it on or off for any reason.
To configure the toolbar first open the View > Toolbars menu and make sure the iOS entry is selected. Choose the menu item as shown in this screenshot—it should be ticked to indicate that the toolbar is visible:
Add the Solution Platforms button to the Standard toolbar, following the instructions below. This allows an iOS Device or the iOS Simulator to be selected when debugging.
Visual Studio 2012, 2013, and 2015
Click the menu button at the right side of the Standard bar:
The Standard and iOS toolbars should now resemble this screenshot:
Once the toolbar configuration is complete, you are ready to begin using Xamarin iOS for Visual Studio.
This article presented a step-by-step guide to installing, configuring, and using Xamarin iOS for Visual Studio.
It covered installing and configuring the prerequisite tools on Windows and Mac OS X.