Connecting the TFS Server to the Xamarin Mac Agent
Let us know how you feel about this.
Although many of the tasks associated with developing a mobile app with Xamarin can be performed on either Windows or OS X, building, testing, and creating iOS App Store Packages (.IPA files) for distribution require a Mac OS X machine. For Xamarin developers using Visual Studio and Team Foundation Server, this means you must have a Mac OS X machine on your local network with Xamarin.iOS installed, which will serve as the Xamarin.iOS build host.
The following steps will connect Visual Studio on the TFS machine to the Mac OS X build host. This typically needs to be done just once as Visual Studio will remember the connection across sessions. You can also use this same process for Visual Studio on any individual developer's machine.
- Open Spotlight (
Cmd-Space) and search for Remote Login then and 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.
Your Mac should now be discoverable by Visual Studio if it's on the same network.
- Log in to the TFS machine.
- Start Visual Studio, and select the Tools > Options... menu command.
Navigate to Xamarin > iOS Settings on the left side:
Click Find Mac Mac Agent, which brings up the Host Selection dialog:
Select your Mac from the list, and click Connect....
You will be prompted for the administrative credntials of your Mac host. Enter these:
The Xamarin Mac Agent should now be successfully connected to your Mac. A "connection successful" icon, similar to the one below will be shown when the connection has been made:
When you now build a Xamarin.iOS project from Visual Studio, including builds run on the TFS machine through continuous integration, the process is delegated to the Mac build ho st machine. Similarly, when you then launch a Xamarin.iOS app in Visual Studio for debugging, you can indicate whether to run in the iOS simulator or directly on a tethered device. Either way, you'll have full debugging capabilities in Visual Studio through the Mac host.