blob: 86069620065df83fe372664b1a1dbe6a0f84d0f4 [file] [log] [blame] [view]
michaeldo8cccf2142017-03-06 22:12:021# Checking out and building Chromium for iOS
2
3There are instructions for other platforms linked from the
4[get the code](../get_the_code.md) page.
5
6## Instructions for Google Employees
7
8Are you a Google employee? See
9[go/building-chrome](https://goto.google.com/building-chrome) instead.
10
11[TOC]
12
13## System requirements
14
Sylvain Defresne991d8e22023-11-29 17:15:3015* A 64-bit Mac capable of running the required version of Xcode.
16* [Xcode](https://developer.apple.com/xcode) 15.0 or higher.
17
18Note: after installing Xcode, you need to launch it and to let it install
19the iOS simulator. This is required as part of the build, see [this discussion](
20https://groups.google.com/a/chromium.org/g/chromium-dev/c/98d6MyLoYHM/m/A_HyOGxPAgAJ)
21on chromium-dev.
michaeldo8cccf2142017-03-06 22:12:0222
23## Install `depot_tools`
24
25Clone the `depot_tools` repository:
26
27```shell
28$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
29```
30
31Add `depot_tools` to the end of your PATH (you will probably want to put this
32in your `~/.bashrc` or `~/.zshrc`). Assuming you cloned `depot_tools` to
33`/path/to/depot_tools`:
34
35```shell
36$ export PATH="$PATH:/path/to/depot_tools"
37```
38
39## Get the code
40
41Create a `chromium` directory for the checkout and change to it (you can call
42this whatever you like and put it wherever you like, as
43long as the full path has no spaces):
44
45```shell
46$ mkdir chromium && cd chromium
47```
48
49Run the `fetch` tool from `depot_tools` to check out the code and its
50dependencies.
51
52```shell
53$ fetch ios
54```
55
56If you don't want the full repo history, you can save a lot of time by
57adding the `--no-history` flag to `fetch`.
58
59Expect the command to take 30 minutes on even a fast connection, and many
60hours on slower ones.
61
62When `fetch` completes, it will have created a hidden `.gclient` file and a
63directory called `src` in the working directory. The remaining instructions
64assume you have switched to the `src` directory:
65
66```shell
67$ cd src
68```
69
70*Optional*: You can also [install API
71keys](https://www.chromium.org/developers/how-tos/api-keys) if you want your
72build to talk to some Google services, but this is not necessary for most
73development and testing purposes.
74
75## Setting up the build
76
77Since the iOS build is a bit more complicated than a desktop build, we provide
78`ios/build/tools/setup-gn.py`, which will create four appropriately configured
79build directories under `out` for Release and Debug device and simulator
Sylvain Defresnefc11bcd2020-06-26 13:42:0080builds, and generates an appropriate Xcode project (`out/build/all.xcodeproj`)
81as well.
michaeldo8cccf2142017-03-06 22:12:0282
Sylvain Defresnefc11bcd2020-06-26 13:42:0083More information about [developing with Xcode](xcode_tips.md). *Xcode project
84is an artifact, any changes made in the project itself will be ignored.*
Mike Doughertyd8947a592020-05-07 19:43:4685
michaeldo8cccf2142017-03-06 22:12:0286You can customize the build by editing the file `$HOME/.setup-gn` (create it if
87it does not exist). Look at `src/ios/build/tools/setup-gn.config` for
88available configuration options.
89
90From this point, you can either build from Xcode or from the command line using
Dirk Pranke8bd55f22018-10-24 21:22:1091`autoninja`. `setup-gn.py` creates sub-directories named
michaeldo8cccf2142017-03-06 22:12:0292`out/${configuration}-${platform}`, so for a `Debug` build for simulator use:
93
94```shell
Dirk Pranke8bd55f22018-10-24 21:22:1095$ autoninja -C out/Debug-iphonesimulator gn_all
michaeldo8cccf2142017-03-06 22:12:0296```
97
Dirk Pranke8bd55f22018-10-24 21:22:1098(`autoninja` is a wrapper that automatically provides optimal values for the
99arguments passed to `ninja`.)
100
Mike Doughertyd8947a592020-05-07 19:43:46101Note: The `setup-gn.py` script needs to run every time one of the `BUILD.gn`
102files is updated (either by you or after rebasing). If you forget to run it,
103the list of targets and files in the Xcode solution may be stale. You can run
104the script directly or use either `gclient sync` or `gclient runhooks` which
105will run `setup-gn.py` for you as part of the update hooks.
michaeldo8cccf2142017-03-06 22:12:02106
Sylvain Defresne9932328e2020-07-09 10:44:40107You can add a custom hook to `.gclient` file to configure `setup-gn.py` to
108be run as part of `gclient runhooks`. In that case, your `.gclient` file
109would look like this:
110
111```
112solutions = [
113 {
114 "name" : "src",
115 "url" : "https://chromium.googlesource.com/chromium/src.git",
116 "deps_file" : "DEPS",
117 "managed" : False,
118 "custom_deps" : {},
119 "custom_vars" : {},
120 "custom_hooks": [{
121 "name": "setup_gn",
122 "pattern": ".",
123 "action": [
Takuto Ikutad36eb352022-03-01 01:39:48124 "python3",
Sylvain Defresne9932328e2020-07-09 10:44:40125 "src/ios/build/tools/setup-gn.py",
126 ]
127 }],
128 "safesync_url": "",
129 },
130]
131target_os = ["ios"]
132target_os_only = True
133```
134
michaeldo8cccf2142017-03-06 22:12:02135You can also follow the manual instructions on the
136[Mac page](../mac_build_instructions.md), but make sure you set the
137GN arg `target_os="ios"`.
138
Andrew Williams54da9cc2024-01-09 17:32:23139### Faster builds
140
141This section contains some things you can change to speed up your builds,
142sorted so that the things that make the biggest difference are first.
143
144#### Use Reclient
145
146Google employees should use Reclient, a distributed compilation system. Detailed
147information is available internally but the relevant gn arg is:
148* `use_remoteexec = true`
149
150Google employees can visit
151[go/building-chrome-mac#using-remote-execution](https://goto.google.com/building-chrome-mac#using-remote-execution)
152for more information. For external contributors, Reclient does not support iOS
153builds.
154
michaeldo8cccf2142017-03-06 22:12:02155## Building for device
156
157To be able to build and run Chromium and the tests for devices, you need to
158have an Apple developer account (a free one will work) and the appropriate
159provisioning profiles, then configure the build to use them.
160
161### Code signing identity
162
163Please refer to the Apple documentation on how to get a code signing identity
164and certificates. You can check that you have a code signing identity correctly
165installed by running the following command.
166
167```shell
168$ xcrun security find-identity -v -p codesigning
169 1) 0123456789ABCDEF0123456789ABCDEF01234567 "iPhone Developer: [email protected] (XXXXXXXXXX)"
170 1 valid identities found
171```
172
173If the command output says you have zero valid identities, then you do not
174have a code signing identity installed and need to get one from Apple. If
175you have more than one identity, the build system may select the wrong one
176automatically, and you can use the `ios_code_signing_identity` gn variable
177to control which one to use by setting it to the identity hash, e.g. to
178`"0123456789ABCDEF0123456789ABCDEF01234567"`.
179
180### Mobile provisioning profiles
181
182Once you have the code signing identity, you need to decide on a prefix
183for the application bundle identifier. This is controlled by the gn variable
184`ios_app_bundle_id_prefix` and usually corresponds to a reversed domain name
185(the default value is `"org.chromium"`).
186
187You then need to request provisioning profiles from Apple for your devices
188for the following bundle identifiers to build and run Chromium with these
189application extensions:
190
Javier Ernesto Flores Roblese68ab7e52021-01-20 18:14:34191- `${prefix}.chrome.ios.dev`
192- `${prefix}.chrome.ios.dev.ContentTodayExtension`
193- `${prefix}.chrome.ios.dev.CredentialProviderExtension`
Sylvain Defresnec2117082021-10-29 10:05:48194- `${prefix}.chrome.ios.dev.IntentsExtension`
Henrique Ferreirodbd08652023-11-09 10:24:54195- `${prefix}.chrome.ios.dev.OpenExtension`
Javier Ernesto Flores Roblese68ab7e52021-01-20 18:14:34196- `${prefix}.chrome.ios.dev.ShareExtension`
197- `${prefix}.chrome.ios.dev.TodayExtension`
198- `${prefix}.chrome.ios.dev.WidgetKitExtension`
michaeldo8cccf2142017-03-06 22:12:02199
200All these certificates need to have the "App Groups"
201(`com.apple.security.application-groups`) capability enabled for
202the following groups:
203
204- `group.${prefix}.chrome`
205- `group.${prefix}.common`
206
207The `group.${prefix}.chrome` is only shared by Chromium and its extensions
208to share files and configurations while the `group.${prefix}.common` is shared
209with Chromium and other applications from the same organisation and can be used
210to send commands to Chromium.
211
Henrique Ferreiro4607b3c2024-01-12 22:55:14212`${prefix}.chrome.ios.dev` and
213`${prefix}.chrome.ios.dev.CredentialProviderExtension` need the AutoFill
Takuto Ikutad36eb352022-03-01 01:39:48214Credential Provider Entitlement, which corresponds to the key
Henrique Ferreiroc1952db2024-03-27 23:50:03215`com.apple.developer.authentication-services.autofill-credential-provider`.
216
217`${prefix}.chrome.ios.dev` additionally needs the
218`com.apple.developer.kernel.extended-virtual-addressing` entitlement when
219running on a real device.
Javier Ernesto Flores Roblese68ab7e52021-01-20 18:14:34220
michaeldo8cccf2142017-03-06 22:12:02221### Mobile provisioning profiles for tests
222
Justin Cohena819c112019-08-17 02:19:19223In addition to that, you need a different provisioning profile for each
michaeldo8cccf2142017-03-06 22:12:02224test application. Those provisioning profile will have a bundle identifier
225matching the following pattern `${prefix}.gtest.${test-suite-name}` where
226`${test-suite-name}` is the name of the test suite with underscores changed
Tiago Vignatticdb9de42023-06-28 16:15:54227to dashes (e.g. `base_unittests` app will use `${prefix}.gtest.base-unittests`
michaeldo8cccf2142017-03-06 22:12:02228as bundle identifier).
229
230To be able to run the EarlGrey tests on a device, you'll need two provisioning
231profiles for EarlGrey and OCHamcrest frameworks:
232
233- `${prefix}.test.OCHamcrest`
234- `${prefix}.test.EarlGrey`
235
236In addition to that, then you'll need one additional provisioning profile for
Justin Cohena819c112019-08-17 02:19:19237the XCTest module too. It must match the pattern:
238`${prefix}.gtest.${test-suite-name}-module`.
michaeldo8cccf2142017-03-06 22:12:02239
240### Other applications
241
242Other applications like `ios_web_shell` usually will require mobile provisioning
243profiles with bundle identifiers that may usually match the following pattern
244`${prefix}.${application-name}` and may require specific capabilities.
245
246Generally, if the mobile provisioning profile is missing then the code signing
247step will fail and will print the bundle identifier of the bundle that could not
248be signed on the command line, e.g.:
249
250```shell
Dirk Pranke8bd55f22018-10-24 21:22:10251$ autoninja -C out/Debug-iphoneos ios_web_shell
michaeldo8cccf2142017-03-06 22:12:02252ninja: Entering directory `out/Debug-iphoneos'
253FAILED: ios_web_shell.app/ios_web_shell ios_web_shell.app/_CodeSignature/CodeResources ios_web_shell.app/embedded.mobileprovision
254python ../../build/config/ios/codesign.py code-sign-bundle -t=iphoneos -i=0123456789ABCDEF0123456789ABCDEF01234567 -e=../../build/config/ios/entitlements.plist -b=obj/ios/web/shell/ios_web_shell ios_web_shell.app
255Error: no mobile provisioning profile found for "org.chromium.ios-web-shell".
256ninja: build stopped: subcommand failed.
257```
258
259Here, the build is failing because there are no mobile provisioning profiles
260installed that could sign the `ios_web_shell.app` bundle with the identity
261`0123456789ABCDEF0123456789ABCDEF01234567`. To fix the build, you'll need to
262request such a mobile provisioning profile from Apple.
263
264You can inspect the file passed via the `-e` flag to the `codesign.py` script
Quinten Yearsley317532d2021-10-20 17:10:31265to check which capabilities are required for the mobile provisioning profile
michaeldo8cccf2142017-03-06 22:12:02266(e.g. `src/build/config/ios/entitlements.plist` for the above build error,
267remember that the paths are relative to the build directory, not to the source
268directory).
269
270If the required capabilities are not enabled on the mobile provisioning profile,
271then it will be impossible to install the application on a device (Xcode will
272display an error stating that "The application was signed with invalid
273entitlements").
274
Dave Tapuskafeb0745b2023-02-07 21:47:47275## Building Blink for iOS
276
277The iOS build supports compiling the blink web platform. To compile blink
278set a gn arg in your `.setup-gn` file. Note the blink web platform is
279experimental code and should only be used for analysis.
280
281```
282[gn_args]
283use_blink = true
284```
285Note that only certain targets support blink. `content_shell` being the
286most useful.
287
288```shell
289$ autoninja -C out/Debug-iphonesimulator content_shell
290```
291
Mark Cogan0abda9652020-04-15 11:22:07292## Running apps from the command line
michaeldo8cccf2142017-03-06 22:12:02293
294Any target that is built and runs on the bots (see [below](#Troubleshooting))
295should run successfully in a local build. To run in the simulator from the
296command line, you can use `iossim`. For example, to run a debug build of
297`Chromium`:
298
299```shell
Tiago Vignatti9d51edea2024-01-13 00:11:49300$ out/Debug-iphonesimulator/iossim -i out/Debug-iphonesimulator/Chromium.app
michaeldo8cccf2142017-03-06 22:12:02301```
302
Antonio Gomes627d0de32023-02-20 17:30:48303From Xcode 9 on, `iossim` no longer automatically launches the Simulator. This must now
Mike Pinkerton90553fe2017-12-13 16:40:30304be done manually from within Xcode (`Xcode > Open Developer Tool > Simulator`), and
305also must be done *after* running `iossim`.
306
Vaclav Brozek09fe5ec2017-07-18 11:13:16307### Passing arguments
308
309Arguments needed to be passed to the test application through `iossim`, such as
310`--gtest_filter=SomeTest.FooBar` should be passed through the `-c` flag:
311
312```shell
Tiago Vignatti9d51edea2024-01-13 00:11:49313$ out/Debug-iphonesimulator/iossim -i \
Vaclav Brozek09fe5ec2017-07-18 11:13:16314 -c "--gtest_filter=SomeTest.FooBar --gtest_repeat=3" \
315 out/Debug-iphonesimulator/base_unittests.app
316```
317
Mike Baxleycb99a9f2017-07-12 15:16:11318### Running EarlGrey tests
319
320EarlGrey tests are run differently than other test targets, as there is an
321XCTest bundle that is injected into the target application. Therefore you must
322also pass in the test bundle:
323
324```shell
Tiago Vignatti9d51edea2024-01-13 00:11:49325$ out/Debug-iphonesimulator/iossim -i \
Mike Baxleycb99a9f2017-07-12 15:16:11326 out/Debug-iphonesimulator/ios_chrome_ui_egtests.app \
327 out/Debug-iphonesimulator/ios_chrome_ui_egtests.app/PlugIns/ios_chrome_ui_egtests_module.xctest
328```
329
Gyuyoung Kim9497f0eb2023-09-19 05:32:04330### Running Web Tests on Blink for iOS
331
332The current Blink for iOS only supports running Web Tests on the simulator
333environment now. Before you run the web tests, you need to build the blink_tests
334target to get content_shell and all of the other needed binaries for the
335simulator test environment.
336
337```shell
338$ autoninja -C out/Debug-iphonesimulator blink_tests
339```
340
341When the blink_tests target is complete you can then run the test runner script
342(third_party/blink/tools/run_web_tests.py) as below. See [Web Tests](https://chromium.googlesource.com/chromium/src/+/HEAD/docs/testing/web_tests.md) document
343for more information.
344
345```shell
346$ third_party/blink/tools/run_web_tests.py -t Debug-iphonesimulator \
347 --platform ios
348```
349
Sylvain Defresned019a702018-02-01 10:11:51350### Running on specific simulator
351
352By default, `iossim` will pick an arbitrary simulator to run the tests. If
353you want to run them on a specific simulator, you can use `-d` to pick the
354simulated device and `-s` to select the iOS version.
355
356For example, to run the tests on a simulated iPhone 6s running iOS 10.0,
357you would invoke `iossim` like this.
358
359```shell
Tiago Vignatti9d51edea2024-01-13 00:11:49360$ out/Debug-iphonesimulator/iossim -i -d 'iPhone 6s' -s '10.0' \
Sylvain Defresned019a702018-02-01 10:11:51361 out/Debug-iphonesimulator/base_unittests.app
362```
363
364Please note that by default only a subset of simulator devices are installed
365with Xcode. You may have to install additional simulators in Xcode (or even
366an older version of Xcode) to be able to run on a specific configuration.
367
368Go to "Preferences > Components" tab in Xcode to install other simulator images
369(this is the location the setting is in Xcode 9.2; it may be different in other
370version of the tool).
371
Tiago Vignattie1599c52023-04-21 07:14:46372### Remote debugging with DevTools (on Blink for iOS)
373
374Developers are able to remotely use DevTools in a host machine (e.g. Mac) and
375inspect `content_shell` for development.
376
377On the simulator, one just needs to pass the `--remote-debugging-port=9222`
378argument for `content_shell` and in the host machine access it via
379`chrome://inspect`. It is possible to change the default port listening (9222)
380and configure another one via the "Configure…" button and then "Target
381discovery settings" dialog.
382
383To use DevTools in the remote device it is necessary to also pass the remote
384debugging address argument to `content-shell` so any address could bind for
385debugging: ` --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222`.
386Then in the host machine one needs to configure the IP address of the device in
387the "Target discovery settings" dialog e.g. `192.168.0.102:9222`.
388
michaeldo8cccf2142017-03-06 22:12:02389## Update your checkout
390
391To update an existing checkout, you can run
392
393```shell
394$ git rebase-update
395$ gclient sync
396```
397
398The first command updates the primary Chromium source repository and rebases
399any of your local branches on top of tip-of-tree (aka the Git branch
Andrew Williamsbbc1a1e2021-07-21 01:51:22400`origin/main`). If you don't want to use this script, you can also just use
michaeldo8cccf2142017-03-06 22:12:02401`git pull` or other common Git commands to update the repo.
402
403The second command syncs dependencies to the appropriate versions and re-runs
404hooks as needed.
405
406## Tips, tricks, and troubleshooting
407
Mark Cogan0abda9652020-04-15 11:22:07408Remember that the XCode project you interact with while working on Chromium is a
409build artifact, generated from the `BUILD.gn` files. Do not use it to add new
410files; instead see the procedures for [working with
411files](working_with_files.md).
412
michaeldo8cccf2142017-03-06 22:12:02413If you have problems building, join us in `#chromium` on `irc.freenode.net` and
414ask there. As mentioned above, be sure that the
415[waterfall](https://build.chromium.org/buildbot/waterfall/) is green and the tree
416is open before checking out. This will increase your chances of success.
417
Sylvain Defresne01e2ded2020-12-02 11:18:30418### Debugging
419
Takuto Ikuta7478af722024-05-27 07:23:19420To help with deterministic builds, and to work with reclient, the path to source
Sylvain Defresne01e2ded2020-12-02 11:18:30421files in debugging symbols are relative to source directory. To allow Xcode
422to find the source files, you need to ensure to have an `~/.lldbinit-Xcode`
423file with the following lines into it (substitute {SRC} for your actual path
424to the root of Chromium's sources):
425
426```
427script sys.path[:0] = ['{SRC}/tools/lldb']
428script import lldbinit
429```
430
431This will also allow you to see the content of some of Chromium types in the
Jan Wilken Dörrie85285b02021-03-11 23:38:47432debugger like `std::u16string`, ... If you want to use `lldb` directly, name
Sylvain Defresne01e2ded2020-12-02 11:18:30433the file `~/.lldbinit` instead of `~/.lldbinit-Xcode`.
434
Sylvain Defresne1d01bff02021-01-29 01:13:10435Note: if you are using `ios/build/tools/setup-gn.py` to generate the Xcode
436project, the script also generate an `.lldbinit` file next to the project and
437configure Xcode to use that file instead of the global one.
438
Sylvain Defresne7080fe3b2020-11-16 15:57:51439### Changing the version of Xcode
440
441To change the version of Xcode used to build Chromium on iOS, please follow
442the steps below:
443
4441. Launch the new version of Xcode.app.
445
446 This is required as Xcode may need to install some components into
447 the system before the new version can be used from the command-line.
448
4491. Reboot your computer.
450
451 This is required as some of Xcode components are daemons that are not
452 automatically stopped when updating Xcode, and command-line tools will
453 fail if the daemon version is incompatible (usually `actool` fails).
454
4551. Run `gn gen`.
456
457 This is required as the `ninja` files generated by `gn` encodes some
458 information about Xcode (notably the path to the SDK, ...) that will
459 change with each version. It is not possible to have `ninja` re-run
460 `gn gen` automatically when those changes unfortunately.
461
462 If you have a downstream chekout, run `gclient runhooks` instead of
463 `gn gen` as it will ensure that `gn gen` will be run automatically
464 for all possible combination of target and configuration from within
465 Xcode.
466
467If you skip some of those steps, the build may occasionally succeed, but
468it has been observed in the past that those steps are required in the
469vast majority of the situation. Please save yourself some painful build
470debugging and follow them.
471
472If you use `xcode-select` to switch between multiple version of Xcode,
473you will have to follow the same steps.
474
Bruce Dawson425d4ab2023-06-25 01:36:15475### Improving performance of git commands
michaeldo8cccf2142017-03-06 22:12:02476
ishermance1d9d82017-05-12 23:10:04477#### Increase the vnode cache size
478
michaeldo8cccf2142017-03-06 22:12:02479`git status` is used frequently to determine the status of your checkout. Due
480to the large number of files in Chromium's checkout, `git status` performance
481can be quite variable. Increasing the system's vnode cache appears to help.
482By default, this command:
483
484```shell
485$ sysctl -a | egrep kern\..*vnodes
486```
487
488Outputs `kern.maxvnodes: 263168` (263168 is 257 * 1024). To increase this
489setting:
490
491```shell
492$ sudo sysctl kern.maxvnodes=$((512*1024))
493```
494
495Higher values may be appropriate if you routinely move between different
496Chromium checkouts. This setting will reset on reboot, the startup setting can
497be set in `/etc/sysctl.conf`:
498
499```shell
500$ echo kern.maxvnodes=$((512*1024)) | sudo tee -a /etc/sysctl.conf
501```
502
503Or edit the file directly.
504
ishermance1d9d82017-05-12 23:10:04505#### Configure git to use an untracked cache
506
Bruce Dawson2154274a2023-06-17 22:24:29507Try running
ishermance1d9d82017-05-12 23:10:04508
509```shell
510$ git update-index --test-untracked-cache
511```
512
513If the output ends with `OK`, then the following may also improve performance of
514`git status`:
515
516```shell
517$ git config core.untrackedCache true
518```
519
Tiago Vignatti760b0c02023-05-29 19:45:24520#### Configure git to use fsmonitor
521
Bruce Dawson2154274a2023-06-17 22:24:29522You can significantly speed up git by using [fsmonitor.](https://github.blog/2022-06-29-improve-git-monorepo-performance-with-a-file-system-monitor/)
523You should enable fsmonitor in large repos, such as Chromium and v8. Enabling
Avi Drissman9908ae442023-09-29 16:31:11524it globally will launch many processes and probably isn't worthwhile. Be sure
525you have at least version 2.43 (fsmonitor on the Mac is broken before then). The
Bruce Dawson2154274a2023-06-17 22:24:29526command to enable fsmonitor in the current repo is:
Tiago Vignatti760b0c02023-05-29 19:45:24527
528```shell
529$ git config core.fsmonitor true
530```
531
michaeldo8cccf2142017-03-06 22:12:02532### Xcode license agreement
533
534If you're getting the error
535
536> Agreeing to the Xcode/iOS license requires admin privileges, please re-run as
537> root via sudo.
538
539the Xcode license hasn't been accepted yet which (contrary to the message) any
540user can do by running:
541
542```shell
543$ xcodebuild -license
544```
545
546Only accepting for all users of the machine requires root:
547
548```shell
549$ sudo xcodebuild -license
550```