For Developers‎ > ‎How-Tos‎ > ‎

Get the Code: Checkout, Build, Run & Submit

Welcome to Chromium! If you're here, you want to learn how to check out the Chromium repository and contribute changes to the Chromium project. This guide will show you how to do that. 
If you want to know how to go from checking the code out to making a small change and sending it out for review, here is a very detailed guide that explains all those steps.

Getting Started

Chromium supports building on Windows, Mac and Linux. You can also build the mobile versions, iOS (from Mac) and Android (from Linux). 

There are two main components to your build environment:

  1. depot_tools - this is our bootstrapped collection of utils that will help you checkout, compile, run and submit changes to the code
  2. src - a git repo; your local git copy of the chromium code. This will need to be updated regularly as other users submit changes.

Set up your environment

Firstcheck out and install the depot_tools package.

Now, create a chromium directory for the checkout.
$ mkdir ~/chromium && cd $_

Mobile builds have their setup documented elsewhere:

Check out the source code.

The checkout will be from 6GB to 22GB, depending on your choices.

You can fetch one of two targets: chromium or blink. Either choice will clone both the Chromium and Blink repos, but there's a small difference.
  • fetch chromium will use the Blink version that's rolled into Chromium via DEPS (usually a few hours old). This choice is easier if working only on Chromium.
  • fetch blink will always retrieve the latest Blink (ToT) version, and is useful if working on Blink
Either choice, the fetch will consume ~22GB of disk space.  However, if you choose to clone without git history, the checkout will total ~6.5GB. 
Use --no-history with fetch to create shallow clones. Use if you don't need repo history or want a faster clone. Later,  git fetch --unshallow will deepen these shallow clones.

Regardless, --nohooks is recommended for your initial fetch. 

$ fetch --nohooks chromium     # Optionally, --no-history

$ fetch --nohooks blink        # Optionally, --no-history

The fetch can take > 30 min on the fastest connections, and many hours on a slow connection.

Install any necessary dependencies

If you're on Linux:
$ ./build/

If you're on Mac, you need Xcode 5+ to build. (See MacBuildInstructions for more info).

If you're on Windows, you need Visual Studio 2013 in order to build (see Build Instructions (Windows) for more info; for Googlers, runhooks will install it automatically).

Optional: install API keys which allow your build to use certain Google services.

Run post-sync hooks

Finally, runhooks to run any post-sync scripts

$ gclient runhooks

Navigate the codebase

For navigating the codebase, we recommend either browsing the repo or using the code search tool, but there are other ways to browse the Chromium code.

Update the checkout

When changes have landed in the source repository and you want to pull those changes into your local checkout, run the following two commands in the root of your src/ checkout:

$ git rebase-update
$ gclient sync

The first updates the primary Chromium source repository (and rebases your local development branches on top of tip-of-tree), and the second updates all of the dependencies specified in the DEPS file. You can read more about our helpful Git tools here, and do a tutorial of all of them here.

Building Chromium

If you've checked out the code, you should see the following files and folders in the directory where you ran fetch:
  • .gclient This file (generated by fetch) defines the configuration of your checkout. It contains the location of the repository, as well as some other useful configuration
  • .gclient_entries This file (also generated by fetch) contains the repository and version information for each of Chromium's sub-repositories (dependencies)
  • src/ Contains the Chromium codebase (an explanation of the directory structure)
    • out/ Contains the generated output from builds
      • Debug/ One of the default build folders; builds the debug build
      • Release/ One of the default build folders; builds the release build

GYP build (recommended for non-Linux builds)

GYP (Generate-Your-Project) is our current build system, it works for all targets and platforms. The build configurations for GYP are stored in  *.gyp or *.gypi files.

Generating the build files

If you've changed (or updated and have changes to) any *.gyp or *.gypi files, you'll need to re-generate the build files:
$ ./build/gyp_chromium -Dcomponent=shared_library
By default, this will add the build files to the out/ directory, but you can specify a different directory if you wish, e.g.:
$ ./build/gyp_chromium -Goutput_dir=out_cros
Each generator output directory will have its own Debug and Release subdirectories. For a full list of parameters GYP supports, run ./build/gyp_chromium --help .

Specifying build parameters

You can specify custom build parameters that affect the target or speed of your build. For more info, see GYP build parameters.

Building Chrome

You can then build Chromium (the chrome target) using:

$ ninja -C out/Debug chrome
For a release build, replace out/Debug with out/Release .

GN build (recommended on Linux, works on Windows/Android, not done on Mac/iOS)

GN is our newer-style build system. The build configurations for GN are stored in  *.gn files. To create a GN build directory, generate one with:
$ gn gen out/Default
Do not use the GYP's out/Debug or out/Release directories, as they may conflict with GYP builds. To specify build parameters for GN, you can do so on the command line:
$ gn args out/Default
This will open an editor where you can change the build parameters, e.g.:
For a full list of arguments and their default values, run:
$ gn args --list out/Default
For more info on GN, run gn or append --help to any command. Also see the GN wiki page or the GN quick start guide for more details.

Building chrome

You can then build Chromium (the chrome target) using:

$ ninja -C out/Default chrome
You can replace out/Default with any GN directory you've set up. For a release build, run gn args out/Default and add the lines is_official_build=true and  is_debug=false .

For a full list of parameters to ninja and what they do, run ninja --help . You can also find more specific build instructions depending on your host and target platform:
ninja -C out/Debug chrome && out/Debug/chrome
Linux build instructions
ninja -C out/Debug chrome && out/Debug chrome
ChromeOS build instructions
ninja -C out\Debug chrome && out\Debug\chrome.exe
Windows build instructions
See build instructions.
Android build instructions
ninja -C out/Release chrome && out/Release/
Mac build instructions
See build instructions.
iOS build instructions


    You can build other targets, such as unit_tests, by changing the target:

    $ ninja -C out/Debug unit_tests

    Some commonly-compiled targets are chrome, unit_tests, browser_tests, components_unittests, content_browsertests, content_unittests, gpu_unittests, and net_unittests. You can find GN targets by running gn ls out/Default from the command line, and GYP targets by grepping .gyp/.gypi files for the string 'target_name':

    Running Chromium

    You can run chrome with:

    $ out/Debug/chrome

    You can also pass parameters, such as flags, on the command line:

    $ out/Debug/chrome --enable-app-info-dialog --show-app-list --user-data-dir=/tmp/profile

    For a full list of command-line flags, see the * files.

    Running tests

    You can run the unit tests, for example, with:

    $ out/Debug/unit_tests

    You can specify only a certain set of tests to run using --gtest_filter , e.g.:

    $ out/Debug/unit_tests --gtest_filter=PushClientTest.*

    You can find out more about GoogleTest on the GoogleTest wiki page.


    The best way to debug chrome depends on your platform:

    Submitting your code

    You can find detailed instructions on how to submit your code on the depot_tools manpage:

    Create a new review with:

    $ git cl upload

    This will upload your code to You should then add reviewers (see wiki page) and submit your code for review. You can also run your code on the trybots to see if it passes all the tests:

    $ git cl try

    For a full list of options, run git cl help , or for help with a particular command just append --help , e.g.  git cl upload --help .

    Keeping Multiple Changes

    You can use branches in your local repository to help separate multiple changes you are submitting to the Chromium code. For more help with branches, see the Working with Branches tutorial, or the Managing Multiple CLs and Managing Dependent CLs sections of the man page. You can also set up multiple working directories to have multiple directories that build Chrome all share the same git database.

    Changing the Repo

    Chromium uses branches and tags to separate the various versions and releases it manages (see Working with Release Branches). The repository also contains many sub-repositories that point to external repos using the DEPS files (see the Working with Nested Repositories tutorial). Although we would prefer if you commit changes using the process above, sometimes you do need to commit or revert changes manually. You can also find out more about merging changes into release branches on the git-drover tutorial page:

    Getting Help

    If you can't get chrome to build and you're not sure why, try the following:
    • Ensure your checkout has been properly updated ( git rebase-update )
    • Check you're on a stable, unmodified branch from master ( git map-branches )
    • Check you have no uncommitted changes ( git status )
    • Check you have all the dependencies installed: try run gclient --version and  ninja --version from your src/ directory
    • Join the #chromium IRC channel on (see the IRC page for more info)
    • E-mail with your question, after taking the time to write it carefully. Note that this is not a support channel for chrome itself, just a forum for developers. You can also join the chromium-dev Google Group, or any other relevant technical discussion groups.
    • If you think this is a serious problem that affects many users, file a new bug with the label 'Infra'. It will be looked at by our infrastructure team.
    • Check out the legacy documentation for this page, or the other developer documentation available in this wiki
    • If you work at Google, check out the Googler-specific Chrome documentation