Saturday, October 7, 2017

Deploy VSTS/TFS build agent with Xcode capability on a Mac

Make sure you have an updated version of Xcode.

Begin by opening a Terminal prompt and install the package manager Homebrew.

/usr/bin/ruby -e "$(curl -fsSL"

Install OpenSSL.

brew update
brew install openssl
mkdir -p /usr/local/lib/
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/

Install git.

brew install git

Restart Terminal and cd into the dir where you will create your agent dir.

mkdir myagent && cd myagent
tar zxvf ~/Downloads/vsts-agent-osx.10.11-x64-2.123.0.tar.gz

Download the patched version of System.Net.Http from Without this you won't be able to connect to VSTS/TFS.
tar -xzvf build.tar bin/Unix.AnyCPU.Release/System.Net.Http/System.Net.Http.dll

Make a backup of myagent/bin/System.Net.Http.dll before replacing it with the patched version.

Create a Personal Access Token by following
Create a folder named LaunchAgents in /Users/[logged in user]/Library.

Configure the agent.


Accept terms: Y
Server URL: https://[your account]
<enter> (PAT)
PAT: [your PAT]
<enter> (default agent pool)
pool name: []
<enter> (_work working folder)

Install and run the agent as a launchd service.

./ install

./ start


No comments: