Build And Debug Xamarin iOS
Build And Debug Xamarin iOS Application On Windows Machine
Introduction
Xamarin is the great technology for cross-platform mobile application development. You can create, build, and debug iOS applications in Windows machines, using Visual Studio. In this article, I will explain what are the ways to debug and build Xamarin.iOS applications on Windows machines.
Xamarin and Microsoft are giving very great solutions for creating and debugging iOS applications. But, an iOS app cannot be created without Apple Compiler, and it cannot be deployed without Apple certificate and code-signing tools. Please read below where I have explained about software requirements and steps.
Software Requirement
You can install the following software on Windows and Mac machines.

Windows Machine
Xamarin is the great technology for cross-platform mobile application development. You can create, build, and debug iOS applications in Windows machines, using Visual Studio. In this article, I will explain what are the ways to debug and build Xamarin.iOS applications on Windows machines.
Xamarin and Microsoft are giving very great solutions for creating and debugging iOS applications. But, an iOS app cannot be created without Apple Compiler, and it cannot be deployed without Apple certificate and code-signing tools. Please read below where I have explained about software requirements and steps.
Software Requirement
You can install the following software on Windows and Mac machines.
Windows Machine
- Windows 7 or higher (7, 8, 8.1,10 +)
- Visual Studio 2013 professional or higher.
- Download updated Visual Studio from https://www.visualstudio.com/downloads/
- VS 2015 ++ included Xamarin .
- If VS 2013, download Xamarin for Visual Studio fromhttps://www.xamarin.com/download
Mac Machine
- A Mac running OS X El Capitan (10.11) or higher
- Xamarin Studio 5.10 or higher with Xamarin.iOS SDK
- Apple Xcode(7+) IDE and iOS SDK fromhttps://itunes.apple.com/us/app/xcode/id497799835?uo=8&at=11ld4k
It greatly helps if your machines are physically near to each other, because when you build and run on Windows, the iOS Simulator will load on your Mac.
Build and Debug iOS Applications
I have explained about basic Xamarin.Form application creation in my previous article. You can refer to and create basic Xamarin.iOS or Xamarin.Form application.
After creation, Visual Studio will prompt you to prepare your Mac to be the Xamarin build host, using the below 3 steps.
Mac Machine
Step 1
On the Mac Machine, select “System Preferences”.
Step 2In System Preferences, click on “Sharing”.
Step 3In Sharing, turn on the Remote Login and change "Allow access to All Users or Only these users" and add a user.
Windows Machine
Step 1In the Visual Studio, you can click on “Connection Indicator“.
Step 2Select your Mac name from Mac agent window and click on “Connect”.
Step 3Enter the Mac username and password and click on "Login".
After successful connection, the color of Connection indicator will change to green. If its connection is on low bandwidth, it will change to orange (it’s not recommended for debugging applications).
Your app will compile and execute, but you won’t see it running on Windows. Instead, you’ll see it on your Mac build host.
iOS Simulator Remoting
In Evolve 2016 Conference, Xamarin announced iOS Simulator remoting that will soon allow you to interact with apps running in Apple iOS simulator as if the simulator were running on your Windows machine.
For iOS Simulator remoting also, you need to follow all the above steps and below steps as well.
Windows Machine
Step 1Download the installer and install on your Windows computer.
Step 2After installation, in Visual Studio, go to Tools > Options > Xamarin > iOS Settings and tick the box for Remote Simulator to Windows.
Output
Now, build and run the solution and iOS simulator will open in Windows machine.
Issues and Resolution
- Issue 1
Error cannot resolve reference: C:/Program Files (x86)/Reference Assemblies/Microsoft/Framework/Xamarin.iOS/v1.0/Facades/System.IO.FileSystem.Watcher.dll I1Vector.iOS
Resolution
This issue happened because of different versions of Xamarin.iOS on Windows Machine and Mac machine. After updating xamarin.ios, this problem will get resolved.
How to Check xamarin.iOS Version Number ?
In Windows machine, go to Visual Studio >> Help >> About Microsoft Visual Studio.
In Mac machine, go to Xamarin Studio and select Xamarin Studio Menu >> Click About Xamarin Studio >> click Show details.
How to Update Xamarin.Ios in Mac and Windows?
Mac Machine
Go to Xamarin Studio and Click on “Check for Update” and Update.
Windows Machine
Go to Visual Studio >> Tools >> extensions and updates.
Sometimes, it won’t be available in update the list. if it’s not available, go to Control Panel >> Uninstall program >> Select a Visual studio, and click Change option and update . - Issue 2Mac Agent can't connect after the update.
Starting connecting to Mac machine. The Xcode license must be accepted in order to be connected and work on the Mac.Solution- Go to Xcode >> Preferences >> Location.
- Check if "Command Line Tool" set or Select XCode version.
- Run sudo xcodebuild -license in terminal.
- Xcode license must be accepted. Press Spacebar and press q.
- Issue 3
iOS simulator does not display on Windows.
Solution - Check Windows and Mac firewall rule or disable, and test the application.
- You need to make sure that Xcode is installed in Application Folder. If it’s not, you need to change the path of Apple SDK in Visual Studio.
Here is the article:
Build And Debug Xamarin iOS
Reviewed by Unknown
on
9:36 AM
Rating:
Nice blog thanks for sharing the valuable information.
ReplyDeleteHire Xamarin Developer