For Developers‎ > ‎How-Tos‎ > ‎

Build Instructions (iOS)

Note: Upstreaming of iOS code is still a work in progress, and is proceeding in conjunction with the layered components refactoring. In particular, note that it is not currently possible to build the actual browser binary, only unit tests and libraries. Unless you are actively working on upstreaming iOS code into the Chromium repository, or are working on making a layered component that supports iOS, these instructions are not likely to be interesting at this point.

Prerequisites

  • A Mac with a version of OS X capable of running the latest version of Xcode.
  • The latest version of XCode, including the current iOS SDK.
  • Install gclient, which is part of the depot_tools package (download). gclient is a wrapper around svn/git that we use to manage our working copies.

Setting Up

In the directory where you are going to check out the code, create a file called chromium.gyp_env with the following contents:

{
  'GYP_DEFINES': 'OS=ios', # use space to delimit additional defines.
  'GYP_GENERATOR_FLAGS': 'xcode_project_version=3.2',
  'GYP_GENERATORS': 'ninja',
}

Also, you should install API keys.

Getting the Code

Check out the code, following the iOS specific instructions.

In particular, add the bold lines below after "gclient config" step.

solutions = [
    // All the solution details here
]
target_os = ['ios']
target_os_only = True

Building

Build the target you are interested in. The recommended way to build is to use ninja.

ninja -C out/Debug All
ninja -C out/Debug-iphoneos All

If you want to build using Xcode, you should first change GYP_GENERATORS to "xcode", and re-run "gclient sync". Since Xcode 5 has difficulty opening Chromium projects, you may want to use xcodebuild. Example command lines, depending on the target, device, and configuration you want to build:

xcodebuild -project build/all.xcodeproj -target "All" -configuration Debug -sdk iphonesimulator build
xcodebuild -project base/base.xcodeproj -target "base" -configuration Release -sdk iphoneos build

You should always be able to build all:All, since targets are added there for iOS only after they compile.

Running

Any *_unittests target that runs on the bots (see below) should run successfully in a local build. Nothing else runs yet—see the highlighted note at the top of this page.

Check the bots periodically for updates; more targets (new components) will come on line over time.

Troubleshooting

If your build fails, check the iOS columns of the Mac waterfall (the last two) to see if the bots are green. In general they should be, since failures on those bots will close the tree.
Comments