depot_tools
depot_tools
repository:depot_tools
to the end of your PATH (you will probably want to put this in your ~/.bashrc
or ~/.zshrc
). Assuming you cloned depot_tools
to /path/to/depot_tools
:chromium
directory for the checkout and change to it (you can call this whatever you like and put it wherever you like, as long as the full path has no spaces):fetch
tool from depot_tools
to check out the code and its dependencies.--no-history
flag to fetch
.fetch
completes, it will have created a hidden .gclient
file and a directory called src
in the working directory. The remaining instructions assume you have switched to the src
directory:ios/build/tools/setup-gn.py
, which will create four appropriately configured build directories under out
for Release and Debug device and simulator builds, and generates an appropriate Xcode project (out/build/all.xcodeproj
) as well.$HOME/.setup-gn
(create it if it does not exist). Look at src/ios/build/tools/setup-gn.config
for available configuration options.autoninja
. setup-gn.py
creates sub-directories named out/${configuration}-${platform}
, so for a Debug
build for simulator use:autoninja
is a wrapper that automatically provides optimal values for the arguments passed to ninja
.)setup-gn.py
script needs to run every time one of the BUILD.gn
files is updated (either by you or after rebasing). If you forget to run it, the list of targets and files in the Xcode solution may be stale. You can run the script directly or use either gclient sync
or gclient runhooks
which will run setup-gn.py
for you as part of the update hooks..gclient
file to configure setup-gn.py
to be run as part of gclient runhooks
. In that case, your .gclient
file would look like this:target_os='ios'
.ios_code_signing_identity
gn variable to control which one to use by setting it to the identity hash, e.g. to '0123456789ABCDEF0123456789ABCDEF01234567'
.ios_app_bundle_id_prefix
and usually corresponds to a reversed domain name (the default value is 'org.chromium'
).${prefix}.chrome.ios.dev
${prefix}.chrome.ios.dev.ContentTodayExtension
${prefix}.chrome.ios.dev.CredentialProviderExtension
${prefix}.chrome.ios.dev.SearchTodayExtension
${prefix}.chrome.ios.dev.ShareExtension
${prefix}.chrome.ios.dev.TodayExtension
${prefix}.chrome.ios.dev.WidgetKitExtension
com.apple.security.application-groups
) capability enabled for the following groups:group.${prefix}.chrome
group.${prefix}.common
group.${prefix}.chrome
is only shared by Chromium and its extensions to share files and configurations while the group.${prefix}.common
is shared with Chromium and other applications from the same organisation and can be used to send commands to Chromium.${prefix}.chrome.ios.dev.CredentialProviderExtension
needs the AutoFill Credential Provider Entitlement, which corresponds to the key com.apple.developer.authentication-services.autofill-credential-provider
Please refer to Apple's documentation on how to set this up.${prefix}.gtest.${test-suite-name}
where ${test-suite-name}
is the name of the test suite with underscores changed to dashes (e.g. base_unittests
app will use ${prefix}.gest.base-unittests
as bundle identifier).${prefix}.test.OCHamcrest
${prefix}.test.EarlGrey
${prefix}.gtest.${test-suite-name}-module
.ios_web_shell
usually will require mobile provisioning profiles with bundle identifiers that may usually match the following pattern ${prefix}.${application-name}
and may require specific capabilities.ios_web_shell.app
bundle with the identity 0123456789ABCDEF0123456789ABCDEF01234567
. To fix the build, you'll need to request such a mobile provisioning profile from Apple.-e
flag to the codesign.py
script to check which capabilites are required for the mobile provisioning profile (e.g. src/build/config/ios/entitlements.plist
for the above build error, remember that the paths are relative to the build directory, not to the source directory).iossim
. For example, to run a debug build of Chromium
:iossim
no longer automatically launches the Simulator. This must now be done manually from within Xcode (Xcode > Open Developer Tool > Simulator
), and also must be done after running iossim
.iossim
, such as --gtest_filter=SomeTest.FooBar
should be passed through the -c
flag:iossim
will pick an arbitrary simulator to run the tests. If you want to run them on a specific simulator, you can use -d
to pick the simulated device and -s
to select the iOS version.iossim
like this.origin/master
). If you don't want to use this script, you can also just use git pull
or other common Git commands to update the repo.BUILD.gn
files. Do not use it to add new files; instead see the procedures for working with files.#chromium
on irc.freenode.net
and ask there. As mentioned above, be sure that the waterfall is green and the tree is open before checking out. This will increase your chances of success.~/.lldbinit-Xcode
file with the following lines into it (substitute {SRC} for your actual path to the root of Chromium's sources):std::u16string
, .. If you want to use lldb
directly, name the file ~/.lldbinit
instead of ~/.lldbinit-Xcode
.ios/build/tools/setup-gn.py
to generate the Xcode project, the script also generate an .lldbinit
file next to the project and configure Xcode to use that file instead of the global one.actool
fails).gn gen
.ninja
files generated by gn
encodes some information about Xcode (notably the path to the SDK, ..) that will change with each version. It is not possible to have ninja
re-run gn gen
automatically when those changes unfortunately.gclient runhooks
instead of gn gen
as it will ensure that gn gen
will be run automatically for all possible combination of target and configuration from within Xcode.xcode-select
to switch between multiple version of Xcode, you will have to follow the same steps.git status
git status
is used frequently to determine the status of your checkout. Due to the large number of files in Chromium‘s checkout, git status
performance can be quite variable. Increasing the system’s vnode cache appears to help. By default, this command:kern.maxvnodes: 263168
(263168 is 257 * 1024). To increase this setting:/etc/sysctl.conf
:git --version
reports 2.8 or higher, try runningOK
, then the following may also improve performance of git status
:git --version
reports 2.6 or higher, but below 2.8, you can instead run