The OS X Build Environment

What This Guide Covers #

This guide explains what packages, tools and settings are available in the Travis OS X CI environment (often referred to as the “CI environment”).

Overview #

Travis CI runs builds in virtual machines that are snapshotted before each build and rolled back at the end of it. This offers a number of benefits:

  • Host OS is not affected by test suites
  • No state persists between runs
  • Passwordless sudo is available
  • It is possible for test suites to install various services via brew and then customize the configuration of those services at the beginning of each build.

The environment available to test suites is known as the Travis CI environment.

Using OS X #

To use our OS X build infrastructure, add the following to your .travis.yml:

os: osx

OS X Version #

Travis CI uses OS X 10.13 and Xcode 9.4.1 by default . You can use another version of OS X (and Xcode) by specifying the corresponding osx_image key from the following table:

osx_image valueXcode versionXcode build versionOS X versionJDK
osx_image: xcode10 Xcode 10.0 10A255 OS X 10.13 10.0.2+13
osx_image: xcode9.4 Default Xcode 9.4.1 9F2000 OS X 10.13 10.0.1+10
osx_image: xcode9.3 Xcode 9.3 9E145 OS X 10.13 1.8.0_112-b16
osx_image: xcode9.2 Xcode 9.2 9C40b OS X 10.12 1.8.0_112-b16
osx_image: xcode9.1 Xcode 9.1 9B55 OS X 10.12 1.8.0_112-b16
osx_image: xcode9 Xcode 9.0 9A235 OS X 10.12 1.8.0_112-b16
osx_image: xcode8.3 Xcode 8.3.3 8E3004b OS X 10.12 1.8.0_112-b16
osx_image: xcode8 Xcode 8.0 8A218a OS X 10.11 1.8.0_92-b14
osx_image: xcode7.3 Xcode 7.3.1 7D1014 OS X 10.11 1.8.0_92-b14
osx_image: xcode6.4 Xcode 6.4 6E35b OS X 10.10 1.8.0_45-b14

Homebrew #

Homebrew is installed and updated every time the virtual machines are updated.

To speed up your build, try installing your packages without running brew update first, to see if the Homebrew database on the build image already has what you need.

A note on upgrading packages #

When upgrading a package with brew upgrade, the command will fail if the most up-to-date version of the package is already installed (so an upgrade didn’t occur).

Depending on how you are upgrading the package, it could cause the build to error:

$ brew upgrade xctool
Error: xctool-0.1.16 already installed
The command "brew upgrade xctool" failed and exited with 1 during .

Your build has been stopped.

Or it can result in the command not found:

xctool: command not found

This is intended behaviour from Homebrew’s side, but you can get around it by using brew bundle or by first checking if the command needs an upgrade with brew outdated

brew bundle #

brew bundle uses a Brewfile, similar to to a Ruby Gemfile to install multiple dependencies. By creating a Brewfile:

brew 'xctool'

You can then update and/or install all of the dependencies with the following command (which will not error if the package is already installed and up to date):

before_install:
  - brew update && brew bundle

brew outdated #

before_install:
  - brew update
  - brew outdated <package-name> || brew upgrade <package-name>

For example, if you always want the latest version of xctool, you can run this:

before_install:
  - brew update
  - brew outdated xctool || brew upgrade xctool

File System #

VMs running OS X use the default file system, HFS+. This file system is case-insensitive, and returns entities within a directory alphabetically.

JDK and OS X #

The JDK available in the OS X environment is tied to the Xcode version selected for your build, it is not set independently. To use a particular JDK for your build, be sure to select an OS X image which includes the version of Java that you need.

osx_image valueXcode versionOS X versionJDK
osx_image: xcode10 Xcode 10.0 OS X 10.13 10.0.2+13
osx_image: xcode9.4 Default Xcode 9.4.1 OS X 10.13 10.0.1+10
osx_image: xcode9.3 Xcode 9.3 OS X 10.13 1.8.0_112-b16
osx_image: xcode9.2 Xcode 9.2 OS X 10.12 1.8.0_112-b16
osx_image: xcode9.1 Xcode 9.1 OS X 10.12 1.8.0_112-b16
osx_image: xcode9 Xcode 9.0 OS X 10.12 1.8.0_112-b16
osx_image: xcode8.3 Xcode 8.3.3 OS X 10.12 1.8.0_112-b16
osx_image: xcode8 Xcode 8.0 OS X 10.11 1.8.0_92-b14
osx_image: xcode7.3 Xcode 7.3.1 OS X 10.11 1.8.0_92-b14
osx_image: xcode6.4 Xcode 6.4 OS X 10.10 1.8.0_45-b14

Compilers and Build toolchain #

  • automake 1.16.1
  • maven 3.5.3
  • mercurial 4.6.1
  • pkg-config 0.29.2
  • wget 1.19.5
  • xctool 0.3.4
  • cmake 3.11.3

Languages #

  • go 1.10.3

Services #

  • postgis 2.4.4.4_1
  • postgresql 10.4

Runtimes #

Every worker has at least one version of Ruby, Java and Python to accommodate projects that may need one of those runtimes during the build.

Environment variables #

  • CI=true
  • TRAVIS=true
  • USER=travis (do not depend on this value)
  • HOME=/Users/travis (do not depend on this value)

Additionally, Travis CI sets environment variables you can use in your build, e.g. to tag the build, or to run post-build deployments.

  • TRAVIS_BRANCH:For builds not triggered by a pull request this is the name of the branch currently being built; whereas for builds triggered by a pull request this is the name of the branch targeted by the pull request (in many cases this will be master).
  • TRAVIS_BUILD_DIR: The absolute path to the directory where the repository being built has been copied on the worker.
  • TRAVIS_BUILD_ID: The id of the current build that Travis CI uses internally.
  • TRAVIS_BUILD_NUMBER: The number of the current build (for example, “4”).
  • TRAVIS_COMMIT: The commit that the current build is testing.
  • TRAVIS_COMMIT_RANGE: The range of commits that were included in the push or pull request. (Note that this is empty for builds triggered by the initial commit of a new branch.)
  • TRAVIS_JOB_ID: The id of the current job that Travis CI uses internally.
  • TRAVIS_JOB_NUMBER: The number of the current job (for example, “4.1”).
  • TRAVIS_PULL_REQUEST: The pull request number if the current job is a pull request, “false” if it’s not a pull request.
  • TRAVIS_SECURE_ENV_VARS: Whether or not secure environment vars are being used. This value is either “true” or “false”.
  • TRAVIS_REPO_SLUG: The slug (in form: owner_name/repo_name) of the repository currently being built. (for example, “travis-ci/travis-build”).
  • TRAVIS_OS_NAME: On multi-OS builds, this value indicates the platform the job is running on. Values are linux and osx currently, to be extended in the future.
  • TRAVIS_TAG: If the current build is for a git tag, this variable is set to the tag’s name.

Maven version #

Stock Apache Maven 3.5.3

Ruby versions/implementations #

  • system (depends on OS X version) – You need to use sudo to install gems with this ruby

  • ruby-1.9.3-p551
  • ruby-2.0.0-p643
  • ruby-2.0.0-p648 (default)
  • ruby-2.1.5
  • ruby-2.1.10
  • ruby-2.2.1
  • ruby-2.2.4
  • ruby-2.2.5
  • ruby-2.3.0
  • ruby-2.3.1
  • ruby-2.4.3
  • jruby-1.7.19
  • jruby-1.7.23
  • jruby-1.7.25
  • jruby-9.0.5.0
  • jruby-9.1.0.0

Rubies are built using RVM that is installed per-user.

Bundler version #

Recent 1.16.2 version (usually the most recent)

Gems in the global gem set #

  • bundler
  • rake
  • cocoapods
  • pyenv (via homebrew)
  • virtualenv (via pip)
  • numpy (via pip)
  • scipy (via pip)
  • tox (via pip)

Xcode version #

Xcode 9.4.1 is installed with all available simulators and SDKs. Command Line Tools are also installed.

Xcode 10.0 #

Xcode 10.0 is available by adding osx_image: xcode10 to your .travis.yml.

Our Xcode 10.0 images have the following SDKs preinstalled:

  • macosx10.14

  • iphoneos12.0

  • iphonesimulator12.0

  • appletvos12.0

  • appletvsimulator12.0

  • watchos5.0

  • watchsimulator5.0

The Xcode 10.0 image also comes with the following simulators:

  • iOS 8.1

  • iOS 8.2

  • iOS 8.3

  • iOS 8.4

  • iOS 9.0

  • iOS 9.1

  • iOS 9.2

  • iOS 9.3

  • iOS 10.0

  • iOS 10.1

  • iOS 10.2

  • iOS 10.3

  • iOS 11.0

  • iOS 11.1

  • iOS 11.2

  • iOS 11.3

  • iOS 11.4

  • iOS 12.0

  • tvOS 9.0

  • tvOS 9.1

  • tvOS 9.2

  • tvOS 10.0

  • tvOS 10.1

  • tvOS 10.2

  • tvOS 11.0

  • tvOS 11.1

  • tvOS 11.2

  • tvOS 11.3

  • tvOS 11.4

  • tvOS 12.0

  • watchOS 2.0

  • watchOS 2.1

  • watchOS 2.2

  • watchOS 3.2

  • watchOS 4.0

  • watchOS 4.1

  • watchOS 4.2

  • watchOS 5.0

Xcode 9.4 #

Xcode 9.4.1 is available by adding osx_image: xcode9.4 to your .travis.yml.

Default when no other osx_image: is specified

Our Xcode 9.4.1 images have the following SDKs preinstalled:

  • macosx10.13

  • iphoneos11.4

  • iphonesimulator11.4

  • appletvos11.4

  • appletvsimulator11.4

  • watchos4.3

  • watchsimulator4.3

The Xcode 9.4.1 image also comes with the following simulators:

  • iOS 8.1

  • iOS 8.2

  • iOS 8.3

  • iOS 8.4

  • iOS 9.0

  • iOS 9.1

  • iOS 9.2

  • iOS 9.3

  • iOS 10.0

  • iOS 10.1

  • iOS 10.2

  • iOS 10.3

  • iOS 11.0

  • iOS 11.1

  • iOS 11.2

  • iOS 11.3

  • iOS 11.4

  • tvOS 9.0

  • tvOS 9.1

  • tvOS 9.2

  • tvOS 10.0

  • tvOS 10.1

  • tvOS 10.2

  • tvOS 11.0

  • tvOS 11.1

  • tvOS 11.2

  • tvOS 11.3

  • tvOS 11.4

  • watchOS 2.0

  • watchOS 2.1

  • watchOS 2.2

  • watchOS 3.2

  • watchOS 4.0

  • watchOS 4.1

  • watchOS 4.2

  • watchOS 4.3

Xcode 9.3 #

Xcode 9.3 is available by adding osx_image: xcode9.3 to your .travis.yml.

Our Xcode 9.3 images have the following SDKs preinstalled:

  • macosx10.13

  • iphoneos11.3

  • iphonesimulator11.3

  • appletvos11.2

  • appletvsimulator11.3

  • watchos4.3

  • watchsimulator4.3

The Xcode 9.3 image also comes with the following simulators:

  • iOS 8.1

  • iOS 8.2

  • iOS 8.3

  • iOS 8.4

  • iOS 9.0

  • iOS 9.1

  • iOS 9.2

  • iOS 9.3

  • iOS 10.0

  • iOS 10.1

  • iOS 10.2

  • iOS 10.3

  • iOS 11.0

  • iOS 11.1

  • iOS 11.2

  • iOS 11.3

  • tvOS 9.0

  • tvOS 9.1

  • tvOS 9.2

  • tvOS 10.0

  • tvOS 10.1

  • tvOS 10.2

  • tvOS 11.0

  • tvOS 11.1

  • tvOS 11.2

  • tvOS 11.3

  • watchOS 2.0

  • watchOS 2.1

  • watchOS 2.2

  • watchOS 3.2

  • watchOS 4.0

  • watchOS 4.1

  • watchOS 4.2

  • watchOS 4.3

Xcode 9.2 #

Xcode 9.2 is available by adding osx_image: xcode9.2 to your .travis.yml.

Our Xcode 9.2 images have the following SDKs preinstalled:

  • macosx10.13

  • iphoneos11.2

  • iphonesimulator11.2

  • appletvos11.2

  • appletvsimulator11.2

  • watchos4.2

  • watchsimulator4.2

The Xcode 9.2 image also comes with the following simulators:

  • iOS 8.1

  • iOS 8.2

  • iOS 8.3

  • iOS 8.4

  • iOS 9.0

  • iOS 9.1

  • iOS 9.2

  • iOS 9.3

  • iOS 10.0

  • iOS 10.1

  • iOS 10.2

  • iOS 10.3

  • iOS 11.0

  • iOS 11.1

  • iOS 11.2

  • tvOS 9.0

  • tvOS 9.1

  • tvOS 9.2

  • tvOS 10.0

  • tvOS 10.1

  • tvOS 10.2

  • tvOS 11.0

  • tvOS 11.1

  • tvOS 11.2

  • watchOS 2.0

  • watchOS 2.1

  • watchOS 2.2

  • watchOS 3.2

  • watchOS 4.0

  • watchOS 4.1

  • watchOS 4.2

Xcode 9.1 #

Xcode 9.1 is available by adding osx_image: xcode9.1 to your .travis.yml.

Our Xcode 9.1 images have the following SDKs preinstalled:

  • macosx10.13

  • iphoneos11.1

  • iphonesimulator11.1

  • appletvos11.1

  • appletvsimulator11.1

  • watchos4.1

  • watchsimulator4.1

The Xcode 9.1 image also comes with the following simulators:

  • iOS 8.1

  • iOS 8.2

  • iOS 8.3

  • iOS 8.4

  • iOS 9.0

  • iOS 9.1

  • iOS 9.2

  • iOS 9.3

  • iOS 10.0

  • iOS 10.1

  • iOS 10.2

  • iOS 10.3

  • iOS 11.0

  • iOS 11.1

  • tvOS 9.0

  • tvOS 9.1

  • tvOS 9.2

  • tvOS 10.0

  • tvOS 10.1

  • tvOS 10.2

  • tvOS 11.0

  • tvOS 11.1

  • watchOS 2.0

  • watchOS 2.1

  • watchOS 2.2

  • watchOS 3.2

  • watchOS 4.0

  • watchOS 4.1

Xcode 9.0 #

Xcode 9.0 is available by adding osx_image: xcode9 to your .travis.yml.

Our Xcode 9.0 images have the following SDKs preinstalled:

  • macosx10.13

  • iphoneos11.0

  • iphonesimulator11.0

  • appletvos11.0

  • appletvsimulator11.0

  • watchos4.0

  • watchsimulator4.0

The Xcode 9.0 image also comes with the following simulators:

  • iOS 8.1

  • iOS 8.2

  • iOS 8.3

  • iOS 8.4

  • iOS 9.0

  • iOS 9.1

  • iOS 9.2

  • iOS 9.3

  • iOS 10.0

  • iOS 10.1

  • iOS 10.2

  • iOS 10.3

  • iOS 11.0

  • tvOS 9.0

  • tvOS 9.1

  • tvOS 9.2

  • tvOS 10.0

  • tvOS 10.1

  • tvOS 10.2

  • tvOS 11.0

  • watchOS 2.0

  • watchOS 2.1

  • watchOS 2.2

  • watchOS 3.2

  • watchOS 4.0

Xcode 8.3 #

Xcode 8.3.3 is available by adding osx_image: xcode8.3 to your .travis.yml.

Our Xcode 8.3.3 images have the following SDKs preinstalled:

  • macosx10.12

  • iphoneos10.3

  • iphonesimulator10.3

  • appletvos10.2

  • appletvsimulator10.2

  • watchos3.2

  • watchsimulator3.2

The Xcode 8.3.3 image also comes with the following simulators:

  • iOS 8.1

  • iOS 8.2

  • iOS 8.3

  • iOS 8.4

  • iOS 9.0

  • iOS 9.1

  • iOS 9.2

  • iOS 9.3

  • iOS 10.0

  • iOS 10.1

  • iOS 10.2

  • iOS 10.3

  • tvOS 9.0

  • tvOS 9.1

  • tvOS 9.2

  • tvOS 10.0

  • tvOS 10.1

  • tvOS 10.2

  • watchOS 2.0

  • watchOS 2.1

  • watchOS 2.2

  • watchOS 3.2

Xcode 8 #

Xcode 8.0 is available by adding osx_image: xcode8 to your .travis.yml.

Our Xcode 8.0 images have the following SDKs preinstalled:

  • macosx10.11

  • iphoneos10.0

  • iphonesimulator10.0

  • appletvos10.0

  • appletvsimulator10.0

  • watchos3.0

  • watchsimulator3.0

  • iphoneos9.3

  • iphonesimulator9.3

  • appletvos9.2

  • appletvsimulator9.2

  • watchos2.2

  • watchsimulator2.2

The Xcode 8.0 image also comes with the following simulators:

  • iOS 10.0

  • watchOS 3.0

  • tvOS 10.0

  • iOS 8.1

  • iOS 8.2

  • iOS 8.3

  • iOS 8.4

  • iOS 9.0

  • iOS 9.1

  • iOS 9.2

  • iOS 9.3

  • watchOS 2.0

  • watchOS 2.1

  • watchOS 2.2

  • tvOS 9.0

  • tvOS 9.1

  • tvOS 9.2

Xcode 7.3 #

Xcode 7.3.1 is available by adding osx_image: xcode7.3 to your .travis.yml.

Our Xcode 7.3.1 images have the following SDKs preinstalled:

  • macosx10.11

  • iphoneos9.3

  • iphonesimulator9.3

  • appletvos9.2

  • appletvsimulator9.2

  • watchos2.2

  • watchsimulator2.2

The Xcode 7.3.1 image also comes with the following simulators:

  • iOS 8.1

  • iOS 8.2

  • iOS 8.3

  • iOS 8.4

  • iOS 9.0

  • iOS 9.1

  • iOS 9.2

  • iOS 9.3

  • watchOS 2.0

  • watchOS 2.1

  • watchOS 2.2

  • tvOS 9.0

  • tvOS 9.1

  • tvOS 9.2

Xcode 6.4 #

Xcode 6.4 is available by adding osx_image: xcode6.4 to your .travis.yml.

Our Xcode 6.4 images have the following SDKs preinstalled:

  • macosx10.9

  • macosx10.10

  • iphoneos8.4

  • iphonesimulator8.4

The Xcode 6.4 image also comes with the following simulators:

  • iOS 7.1

  • iOS 8.1

  • iOS 8.2

  • iOS 8.4