Installing Xamarin.iOS on Windows
- PDF for offline use
- 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 Visual Studio 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 2013 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
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.
Xamarin can be installed as part of your Visual Studio 2017 installation. To achieve this, do the following:
- Download Visual Studio from the Visual Studio site. Xamarin is supported in all versions of Visual Studio 2017.
- Double-click the downloaded package to start installation.
- Select the Mobile development with .NET workload from the installation screen:
- Once Visual Studio 2017 has installed, select the Launch button to start Visual Studio 2017.
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:
- 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.
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:
Visual Studio 2013, and 2015
In versions earlier than Visual Studio 2017, the Solution Platforms button may need to be added to the Standard toolbar. This allows an iOS Device or the iOS Simulator to be selected when debugging. Follow the instructions below to set this up
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.