Configuring Team Foundation Server for Xamarin
Step by step guide to required settings and configurations
- PDF for offline use
- Related Links:
Let us know how you feel about this
last updated: 2017-04
This guide will cover the settings and configurations necessary to use a self-hosted Team Foundation Server 2015 (TFS 2015) with Xamarin for the Continuous Integration (CI) of mobile apps.
As discussed in the document Introduction to CI, Continuous Integration (CI) is a software development practice where members of a team integrate their work frequently. Each integration is verified by an automated build (including running tests) to detect integration errors as quickly as possible.
Team Foundation Server 2015 (TFS 2015) is an Application Lifecycle Management (ALM) product used to support development practices. It provides the tools required to effectively manage software development projects throughout their complete lifecycle. With TFS2015, you can use any edition including TFS Express, and we'll cover the steps to configure TFS 2015here:
- Setting the required user rights.
- Connecting to TFS 2015 from Mac developers’ machines.
- Configuring the TFS 2015 machine to build Xamarin apps for Android and Windows.
- Connecting the TFS 2015 machine to a Mac build host to build Xamarin.iOS projects.
This configuration will also allow the TFS 2015 machine to be the build server for team projects hosted on VSTS. Details for how to make this connection are found on Deploy and configure a build server (MSDN).
The following diagram shows the layout and connections between hardware and software that we will be installing and configuring in this guide:
This configuration will support:
- iOS Debug/Build – Building and testing of iOS apps in Visual Studio from a Windows machine.
- Check In/Out – Allows developers in Visual Studio on Windows or Xamarin Studio on a Mac to check source code in and out of version control.
- Auto Build/Unit Testing – Provides automatic mobile app builds and running of unit tests on check in of new or modified source code to version control.
- Visual Studio with Xamarin (Windows only) - Install Visual Studio 2013 Professional or Ultimate, or any edition of Visual Studio 2015 or 2017. Configure Visual Studio with Xamarin for intended platform targets. See the Xamarin Installation Guide. Note that with Visual Studio 2015 and 2017, you can install Xamarin as part of Visual Studio setup.
- Xamarin Studio (Mac only) - Install Xamarin Studio, Xamarin.Android, and Xamarin.iOS.
Team Foundation Server Machine
- Team Foundation Server – Install and configure any edition of Team Foundation Server 2015 including TFS Express.
- Visual Studio with Xamarin – Install an edition of Visual Studio that matches the version installed on developer machines, along with Xamarin for all intended platforms.
- Appropriate Android SDK version – Depending on the projects you intend to build, you may need to install the Android SDK components for API levels beyond what is installed by default with Visual Studio. If not, you will encounter build errors on the server that will indicate the necessary API levels.
Mac OS X Build Host
- Xamarin Mac Agent – To build iOS apps from a Windows developer machine or the TFS 2015 server, you must have a Mac OS X build host machine on your local network. For more information, refer to the Xamarin Mac Agent guide
- Firewall Configuration for Xamarin Test Cloud - Internet access to the Test Cloud web servers is required. Firewalls should be configured to allow traffic to the Test Cloud servers at the IP addresses 22.214.171.124 and 126.96.36.199. The Test Cloud servers require ports 80 and 443.
Note: The Android SDK must be installed in a location that's accessible by the build agent account, such as C:\android-sdk, and not in another user's account. This will be covered in Configuring TFS 2015 to Build Android Apps.
Required User Rights
Before a user can create a new Team Project in Team Foundation Server they must be members of the team project and have administrator permissions for team project collections. For details, see Microsoft’s documentation, Add users to team projects and Add accounts to administer project collections.
With all the above steps completed for each member of the team that will be working on projects within the Team Collection, those members are now ready to connect to the TFS 2015 server.
Note: A team project in TFS 2015 refers to all the project's data that includes tasks, work items, version control, build definitions, test definitions, and so forth. App projects, on the other hand, as they appear inside an IDE like Visual Studio and Xamarin Studio, define the source files necessary to build an app package. App project files are themselves stored in the team project's version control repository.