blob: d0bc14aba971038a94ae82ce4fb2e842159d183b [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 Defresne09a1b992025-01-08 15:02:3915<!-- LINT.IfChange -->
Sylvain Defresne1a98f762025-01-07 14:08:5016
Sylvain Defresne991d8e22023-11-29 17:15:3017* A 64-bit Mac capable of running the required version of Xcode.
Justin Cohen9a1c7772024-10-01 21:37:4118* [Xcode](https://developer.apple.com/xcode) 16.0 or higher.
Sylvain Defresne991d8e22023-11-29 17:15:3019
Sylvain Defresne09a1b992025-01-08 15:02:3920<!-- LINT.ThenChange(//ios/build/chrome_build.gni) -->
21
Sylvain Defresne991d8e22023-11-29 17:15:3022Note: after installing Xcode, you need to launch it and to let it install
23the iOS simulator. This is required as part of the build, see [this discussion](
24https://groups.google.com/a/chromium.org/g/chromium-dev/c/98d6MyLoYHM/m/A_HyOGxPAgAJ)
25on chromium-dev.
michaeldo8cccf2142017-03-06 22:12:0226
27## Install `depot_tools`
28
29Clone the `depot_tools` repository:
30
31```shell
32$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
33```
34
35Add `depot_tools` to the end of your PATH (you will probably want to put this
36in your `~/.bashrc` or `~/.zshrc`). Assuming you cloned `depot_tools` to
37`/path/to/depot_tools`:
38
39```shell
40$ export PATH="$PATH:/path/to/depot_tools"
41```
42
43## Get the code
44
45Create a `chromium` directory for the checkout and change to it (you can call
46this whatever you like and put it wherever you like, as
47long as the full path has no spaces):
48
49```shell
50$ mkdir chromium && cd chromium
51```
52
53Run the `fetch` tool from `depot_tools` to check out the code and its
54dependencies.
55
56```shell
57$ fetch ios
58```
59
60If you don't want the full repo history, you can save a lot of time by
61adding the `--no-history` flag to `fetch`.
62
63Expect the command to take 30 minutes on even a fast connection, and many
64hours on slower ones.
65
66When `fetch` completes, it will have created a hidden `.gclient` file and a
67directory called `src` in the working directory. The remaining instructions
68assume you have switched to the `src` directory:
69
70```shell
71$ cd src
72```
73
74*Optional*: You can also [install API
75keys](https://www.chromium.org/developers/how-tos/api-keys) if you want your
76build to talk to some Google services, but this is not necessary for most
77development and testing purposes.
78
79## Setting up the build
80
81Since the iOS build is a bit more complicated than a desktop build, we provide
82`ios/build/tools/setup-gn.py`, which will create four appropriately configured
83build directories under `out` for Release and Debug device and simulator
Sylvain Defresnefc11bcd2020-06-26 13:42:0084builds, and generates an appropriate Xcode project (`out/build/all.xcodeproj`)
85as well.
michaeldo8cccf2142017-03-06 22:12:0286
Sylvain Defresnefc11bcd2020-06-26 13:42:0087More information about [developing with Xcode](xcode_tips.md). *Xcode project
88is an artifact, any changes made in the project itself will be ignored.*
Mike Doughertyd8947a592020-05-07 19:43:4689
Raphael Kubo da costa47cb1072024-12-11 18:37:2990You can customize the build by editing a file called `.setup-gn` (create it if
91it does not exist). It can be stored in two locations:
92
93* `$HOME/.setup-gn` (the settings will be applied to all Chromium checkouts).
94* The directory above `src/` (i.e. the directory containing your `.gclient`)
95 for checkout-specific settings.
96
97Look at `src/ios/build/tools/setup-gn.config` for available configuration
98options.
michaeldo8cccf2142017-03-06 22:12:0299
100From this point, you can either build from Xcode or from the command line using
Dirk Pranke8bd55f22018-10-24 21:22:10101`autoninja`. `setup-gn.py` creates sub-directories named
michaeldo8cccf2142017-03-06 22:12:02102`out/${configuration}-${platform}`, so for a `Debug` build for simulator use:
103
104```shell
Dirk Pranke8bd55f22018-10-24 21:22:10105$ autoninja -C out/Debug-iphonesimulator gn_all
michaeldo8cccf2142017-03-06 22:12:02106```
107
Dirk Pranke8bd55f22018-10-24 21:22:10108(`autoninja` is a wrapper that automatically provides optimal values for the
109arguments passed to `ninja`.)
110
Mike Doughertyd8947a592020-05-07 19:43:46111Note: The `setup-gn.py` script needs to run every time one of the `BUILD.gn`
112files is updated (either by you or after rebasing). If you forget to run it,
113the list of targets and files in the Xcode solution may be stale. You can run
114the script directly or use either `gclient sync` or `gclient runhooks` which
115will run `setup-gn.py` for you as part of the update hooks.
michaeldo8cccf2142017-03-06 22:12:02116
Sylvain Defresne9932328e2020-07-09 10:44:40117You can add a custom hook to `.gclient` file to configure `setup-gn.py` to
118be run as part of `gclient runhooks`. In that case, your `.gclient` file
119would look like this:
120
121```
122solutions = [
123 {
124 "name" : "src",
125 "url" : "https://chromium.googlesource.com/chromium/src.git",
126 "deps_file" : "DEPS",
127 "managed" : False,
128 "custom_deps" : {},
129 "custom_vars" : {},
130 "custom_hooks": [{
131 "name": "setup_gn",
132 "pattern": ".",
133 "action": [
Takuto Ikutad36eb352022-03-01 01:39:48134 "python3",
Sylvain Defresne9932328e2020-07-09 10:44:40135 "src/ios/build/tools/setup-gn.py",
136 ]
137 }],
138 "safesync_url": "",
139 },
140]
141target_os = ["ios"]
142target_os_only = True
143```
144
michaeldo8cccf2142017-03-06 22:12:02145You can also follow the manual instructions on the
146[Mac page](../mac_build_instructions.md), but make sure you set the
147GN arg `target_os="ios"`.
148
Andrew Williams54da9cc2024-01-09 17:32:23149### Faster builds
150
151This section contains some things you can change to speed up your builds,
152sorted so that the things that make the biggest difference are first.
153
154#### Use Reclient
155
156Google employees should use Reclient, a distributed compilation system. Detailed
157information is available internally but the relevant gn arg is:
158* `use_remoteexec = true`
159
160Google employees can visit
161[go/building-chrome-mac#using-remote-execution](https://goto.google.com/building-chrome-mac#using-remote-execution)
162for more information. For external contributors, Reclient does not support iOS
163builds.
164
michaeldo8cccf2142017-03-06 22:12:02165## Building for device
166
167To be able to build and run Chromium and the tests for devices, you need to
168have an Apple developer account (a free one will work) and the appropriate
169provisioning profiles, then configure the build to use them.
170
171### Code signing identity
172
173Please refer to the Apple documentation on how to get a code signing identity
174and certificates. You can check that you have a code signing identity correctly
175installed by running the following command.
176
177```shell
178$ xcrun security find-identity -v -p codesigning
179 1) 0123456789ABCDEF0123456789ABCDEF01234567 "iPhone Developer: someone@example.com (XXXXXXXXXX)"
180 1 valid identities found
181```
182
183If the command output says you have zero valid identities, then you do not
184have a code signing identity installed and need to get one from Apple. If
185you have more than one identity, the build system may select the wrong one
186automatically, and you can use the `ios_code_signing_identity` gn variable
187to control which one to use by setting it to the identity hash, e.g. to
188`"0123456789ABCDEF0123456789ABCDEF01234567"`.
189
190### Mobile provisioning profiles
191
192Once you have the code signing identity, you need to decide on a prefix
193for the application bundle identifier. This is controlled by the gn variable
194`ios_app_bundle_id_prefix` and usually corresponds to a reversed domain name
195(the default value is `"org.chromium"`).
196
197You then need to request provisioning profiles from Apple for your devices
198for the following bundle identifiers to build and run Chromium with these
199application extensions:
200
Javier Ernesto Flores Roblese68ab7e52021-01-20 18:14:34201- `${prefix}.chrome.ios.dev`
202- `${prefix}.chrome.ios.dev.ContentTodayExtension`
203- `${prefix}.chrome.ios.dev.CredentialProviderExtension`
Sylvain Defresnec2117082021-10-29 10:05:48204- `${prefix}.chrome.ios.dev.IntentsExtension`
Henrique Ferreirodbd08652023-11-09 10:24:54205- `${prefix}.chrome.ios.dev.OpenExtension`
Javier Ernesto Flores Roblese68ab7e52021-01-20 18:14:34206- `${prefix}.chrome.ios.dev.ShareExtension`
207- `${prefix}.chrome.ios.dev.TodayExtension`
208- `${prefix}.chrome.ios.dev.WidgetKitExtension`
michaeldo8cccf2142017-03-06 22:12:02209
210All these certificates need to have the "App Groups"
211(`com.apple.security.application-groups`) capability enabled for
212the following groups:
213
214- `group.${prefix}.chrome`
215- `group.${prefix}.common`
216
217The `group.${prefix}.chrome` is only shared by Chromium and its extensions
218to share files and configurations while the `group.${prefix}.common` is shared
219with Chromium and other applications from the same organisation and can be used
220to send commands to Chromium.
221
Henrique Ferreiro4607b3c2024-01-12 22:55:14222`${prefix}.chrome.ios.dev` and
223`${prefix}.chrome.ios.dev.CredentialProviderExtension` need the AutoFill
Takuto Ikutad36eb352022-03-01 01:39:48224Credential Provider Entitlement, which corresponds to the key
Henrique Ferreiroc1952db2024-03-27 23:50:03225`com.apple.developer.authentication-services.autofill-credential-provider`.
226
227`${prefix}.chrome.ios.dev` additionally needs the
228`com.apple.developer.kernel.extended-virtual-addressing` entitlement when
229running on a real device.
Javier Ernesto Flores Roblese68ab7e52021-01-20 18:14:34230
michaeldo8cccf2142017-03-06 22:12:02231### Mobile provisioning profiles for tests
232
Justin Cohena819c112019-08-17 02:19:19233In addition to that, you need a different provisioning profile for each
michaeldo8cccf2142017-03-06 22:12:02234test application. Those provisioning profile will have a bundle identifier
235matching the following pattern `${prefix}.gtest.${test-suite-name}` where
236`${test-suite-name}` is the name of the test suite with underscores changed
Tiago Vignatticdb9de42023-06-28 16:15:54237to dashes (e.g. `base_unittests` app will use `${prefix}.gtest.base-unittests`
michaeldo8cccf2142017-03-06 22:12:02238as bundle identifier).
239
240To be able to run the EarlGrey tests on a device, you'll need two provisioning
241profiles for EarlGrey and OCHamcrest frameworks:
242
243- `${prefix}.test.OCHamcrest`
244- `${prefix}.test.EarlGrey`
245
246In addition to that, then you'll need one additional provisioning profile for
Justin Cohena819c112019-08-17 02:19:19247the XCTest module too. It must match the pattern:
248`${prefix}.gtest.${test-suite-name}-module`.
michaeldo8cccf2142017-03-06 22:12:02249
250### Other applications
251
252Other applications like `ios_web_shell` usually will require mobile provisioning
253profiles with bundle identifiers that may usually match the following pattern
254`${prefix}.${application-name}` and may require specific capabilities.
255
256Generally, if the mobile provisioning profile is missing then the code signing
257step will fail and will print the bundle identifier of the bundle that could not
258be signed on the command line, e.g.:
259
260```shell
Dirk Pranke8bd55f22018-10-24 21:22:10261$ autoninja -C out/Debug-iphoneos ios_web_shell
michaeldo8cccf2142017-03-06 22:12:02262ninja: Entering directory `out/Debug-iphoneos'
263FAILED: ios_web_shell.app/ios_web_shell ios_web_shell.app/_CodeSignature/CodeResources ios_web_shell.app/embedded.mobileprovision
Rohit Raobc93a31b2024-08-12 14:28:08264python ../../build/config/apple/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
michaeldo8cccf2142017-03-06 22:12:02265Error: no mobile provisioning profile found for "org.chromium.ios-web-shell".
266ninja: build stopped: subcommand failed.
267```
268
269Here, the build is failing because there are no mobile provisioning profiles
270installed that could sign the `ios_web_shell.app` bundle with the identity
271`0123456789ABCDEF0123456789ABCDEF01234567`. To fix the build, you'll need to
272request such a mobile provisioning profile from Apple.
273
274You can inspect the file passed via the `-e` flag to the `codesign.py` script
Quinten Yearsley317532d2021-10-20 17:10:31275to check which capabilities are required for the mobile provisioning profile
michaeldo8cccf2142017-03-06 22:12:02276(e.g. `src/build/config/ios/entitlements.plist` for the above build error,
277remember that the paths are relative to the build directory, not to the source
278directory).
279
280If the required capabilities are not enabled on the mobile provisioning profile,
281then it will be impossible to install the application on a device (Xcode will
282display an error stating that "The application was signed with invalid
283entitlements").
284
Dave Tapuskafeb0745b2023-02-07 21:47:47285## Building Blink for iOS
286
287The iOS build supports compiling the blink web platform. To compile blink
288set a gn arg in your `.setup-gn` file. Note the blink web platform is
289experimental code and should only be used for analysis.
290
291```
292[gn_args]
293use_blink = true
294```
295Note that only certain targets support blink. `content_shell` being the
296most useful.
297
298```shell
299$ autoninja -C out/Debug-iphonesimulator content_shell
300```
301
Mark Cogan0abda9652020-04-15 11:22:07302## Running apps from the command line
michaeldo8cccf2142017-03-06 22:12:02303
304Any target that is built and runs on the bots (see [below](#Troubleshooting))
305should run successfully in a local build. To run in the simulator from the
306command line, you can use `iossim`. For example, to run a debug build of
307`Chromium`:
308
309```shell
Tiago Vignatti9d51edea2024-01-13 00:11:49310$ out/Debug-iphonesimulator/iossim -i out/Debug-iphonesimulator/Chromium.app
michaeldo8cccf2142017-03-06 22:12:02311```
312
Antonio Gomes627d0de32023-02-20 17:30:48313From Xcode 9 on, `iossim` no longer automatically launches the Simulator. This must now
Mike Pinkerton90553fe2017-12-13 16:40:30314be done manually from within Xcode (`Xcode > Open Developer Tool > Simulator`), and
315also must be done *after* running `iossim`.
316
Vaclav Brozek09fe5ec2017-07-18 11:13:16317### Passing arguments
318
319Arguments needed to be passed to the test application through `iossim`, such as
320`--gtest_filter=SomeTest.FooBar` should be passed through the `-c` flag:
321
322```shell
Tiago Vignatti9d51edea2024-01-13 00:11:49323$ out/Debug-iphonesimulator/iossim -i \
Vaclav Brozek09fe5ec2017-07-18 11:13:16324 -c "--gtest_filter=SomeTest.FooBar --gtest_repeat=3" \
325 out/Debug-iphonesimulator/base_unittests.app
326```
327
Mike Baxleycb99a9f2017-07-12 15:16:11328### Running EarlGrey tests
329
330EarlGrey tests are run differently than other test targets, as there is an
331XCTest bundle that is injected into the target application. Therefore you must
332also pass in the test bundle:
333
334```shell
Tiago Vignatti9d51edea2024-01-13 00:11:49335$ out/Debug-iphonesimulator/iossim -i \
Mike Baxleycb99a9f2017-07-12 15:16:11336 out/Debug-iphonesimulator/ios_chrome_ui_egtests.app \
337 out/Debug-iphonesimulator/ios_chrome_ui_egtests.app/PlugIns/ios_chrome_ui_egtests_module.xctest
338```
339
Gyuyoung Kim9497f0eb2023-09-19 05:32:04340### Running Web Tests on Blink for iOS
341
342The current Blink for iOS only supports running Web Tests on the simulator
343environment now. Before you run the web tests, you need to build the blink_tests
344target to get content_shell and all of the other needed binaries for the
345simulator test environment.
346
347```shell
348$ autoninja -C out/Debug-iphonesimulator blink_tests
349```
350
351When the blink_tests target is complete you can then run the test runner script
352(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
353for more information.
354
355```shell
356$ third_party/blink/tools/run_web_tests.py -t Debug-iphonesimulator \
357 --platform ios
358```
359
Sylvain Defresned019a702018-02-01 10:11:51360### Running on specific simulator
361
362By default, `iossim` will pick an arbitrary simulator to run the tests. If
363you want to run them on a specific simulator, you can use `-d` to pick the
364simulated device and `-s` to select the iOS version.
365
366For example, to run the tests on a simulated iPhone 6s running iOS 10.0,
367you would invoke `iossim` like this.
368
369```shell
Tiago Vignatti9d51edea2024-01-13 00:11:49370$ out/Debug-iphonesimulator/iossim -i -d 'iPhone 6s' -s '10.0' \
Sylvain Defresned019a702018-02-01 10:11:51371 out/Debug-iphonesimulator/base_unittests.app
372```
373
374Please note that by default only a subset of simulator devices are installed
375with Xcode. You may have to install additional simulators in Xcode (or even
376an older version of Xcode) to be able to run on a specific configuration.
377
378Go to "Preferences > Components" tab in Xcode to install other simulator images
379(this is the location the setting is in Xcode 9.2; it may be different in other
380version of the tool).
381
Tiago Vignattie1599c52023-04-21 07:14:46382### Remote debugging with DevTools (on Blink for iOS)
383
384Developers are able to remotely use DevTools in a host machine (e.g. Mac) and
385inspect `content_shell` for development.
386
387On the simulator, one just needs to pass the `--remote-debugging-port=9222`
388argument for `content_shell` and in the host machine access it via
389`chrome://inspect`. It is possible to change the default port listening (9222)
390and configure another one via the "Configure…" button and then "Target
391discovery settings" dialog.
392
393To use DevTools in the remote device it is necessary to also pass the remote
394debugging address argument to `content-shell` so any address could bind for
395debugging: ` --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222`.
396Then in the host machine one needs to configure the IP address of the device in
397the "Target discovery settings" dialog e.g. `192.168.0.102:9222`.
398
michaeldo8cccf2142017-03-06 22:12:02399## Update your checkout
400
401To update an existing checkout, you can run
402
403```shell
404$ git rebase-update
405$ gclient sync
406```
407
408The first command updates the primary Chromium source repository and rebases
409any of your local branches on top of tip-of-tree (aka the Git branch
Andrew Williamsbbc1a1e2021-07-21 01:51:22410`origin/main`). If you don't want to use this script, you can also just use
michaeldo8cccf2142017-03-06 22:12:02411`git pull` or other common Git commands to update the repo.
412
413The second command syncs dependencies to the appropriate versions and re-runs
414hooks as needed.
415
416## Tips, tricks, and troubleshooting
417
Mark Cogan0abda9652020-04-15 11:22:07418Remember that the XCode project you interact with while working on Chromium is a
419build artifact, generated from the `BUILD.gn` files. Do not use it to add new
420files; instead see the procedures for [working with
421files](working_with_files.md).
422
michaeldo8cccf2142017-03-06 22:12:02423If you have problems building, join us in `#chromium` on `irc.freenode.net` and
424ask there. As mentioned above, be sure that the
425[waterfall](https://build.chromium.org/buildbot/waterfall/) is green and the tree
426is open before checking out. This will increase your chances of success.
427
Sylvain Defresne01e2ded2020-12-02 11:18:30428### Debugging
429
Takuto Ikuta7478af722024-05-27 07:23:19430To help with deterministic builds, and to work with reclient, the path to source
Sylvain Defresne01e2ded2020-12-02 11:18:30431files in debugging symbols are relative to source directory. To allow Xcode
432to find the source files, you need to ensure to have an `~/.lldbinit-Xcode`
433file with the following lines into it (substitute {SRC} for your actual path
434to the root of Chromium's sources):
435
436```
437script sys.path[:0] = ['{SRC}/tools/lldb']
438script import lldbinit
439```
440
441This will also allow you to see the content of some of Chromium types in the
Jan Wilken Dörrie85285b02021-03-11 23:38:47442debugger like `std::u16string`, ... If you want to use `lldb` directly, name
Sylvain Defresne01e2ded2020-12-02 11:18:30443the file `~/.lldbinit` instead of `~/.lldbinit-Xcode`.
444
Sylvain Defresne1d01bff02021-01-29 01:13:10445Note: if you are using `ios/build/tools/setup-gn.py` to generate the Xcode
446project, the script also generate an `.lldbinit` file next to the project and
447configure Xcode to use that file instead of the global one.
448
Sylvain Defresne7080fe3b2020-11-16 15:57:51449### Changing the version of Xcode
450
451To change the version of Xcode used to build Chromium on iOS, please follow
452the steps below:
453
4541. Launch the new version of Xcode.app.
455
456 This is required as Xcode may need to install some components into
457 the system before the new version can be used from the command-line.
458
4591. Reboot your computer.
460
461 This is required as some of Xcode components are daemons that are not
462 automatically stopped when updating Xcode, and command-line tools will
463 fail if the daemon version is incompatible (usually `actool` fails).
464
4651. Run `gn gen`.
466
467 This is required as the `ninja` files generated by `gn` encodes some
468 information about Xcode (notably the path to the SDK, ...) that will
469 change with each version. It is not possible to have `ninja` re-run
470 `gn gen` automatically when those changes unfortunately.
471
472 If you have a downstream chekout, run `gclient runhooks` instead of
473 `gn gen` as it will ensure that `gn gen` will be run automatically
474 for all possible combination of target and configuration from within
475 Xcode.
476
477If you skip some of those steps, the build may occasionally succeed, but
478it has been observed in the past that those steps are required in the
479vast majority of the situation. Please save yourself some painful build
480debugging and follow them.
481
482If you use `xcode-select` to switch between multiple version of Xcode,
483you will have to follow the same steps.
484
Bruce Dawson425d4ab2023-06-25 01:36:15485### Improving performance of git commands
michaeldo8cccf2142017-03-06 22:12:02486
ishermance1d9d82017-05-12 23:10:04487#### Increase the vnode cache size
488
michaeldo8cccf2142017-03-06 22:12:02489`git status` is used frequently to determine the status of your checkout. Due
490to the large number of files in Chromium's checkout, `git status` performance
491can be quite variable. Increasing the system's vnode cache appears to help.
492By default, this command:
493
494```shell
495$ sysctl -a | egrep kern\..*vnodes
496```
497
498Outputs `kern.maxvnodes: 263168` (263168 is 257 * 1024). To increase this
499setting:
500
501```shell
502$ sudo sysctl kern.maxvnodes=$((512*1024))
503```
504
505Higher values may be appropriate if you routinely move between different
506Chromium checkouts. This setting will reset on reboot, the startup setting can
507be set in `/etc/sysctl.conf`:
508
509```shell
510$ echo kern.maxvnodes=$((512*1024)) | sudo tee -a /etc/sysctl.conf
511```
512
513Or edit the file directly.
514
ishermance1d9d82017-05-12 23:10:04515#### Configure git to use an untracked cache
516
Bruce Dawson2154274a2023-06-17 22:24:29517Try running
ishermance1d9d82017-05-12 23:10:04518
519```shell
520$ git update-index --test-untracked-cache
521```
522
523If the output ends with `OK`, then the following may also improve performance of
524`git status`:
525
526```shell
527$ git config core.untrackedCache true
528```
529
Tiago Vignatti760b0c02023-05-29 19:45:24530#### Configure git to use fsmonitor
531
Bruce Dawson2154274a2023-06-17 22:24:29532You can significantly speed up git by using [fsmonitor.](https://github.blog/2022-06-29-improve-git-monorepo-performance-with-a-file-system-monitor/)
533You should enable fsmonitor in large repos, such as Chromium and v8. Enabling
Avi Drissman9908ae442023-09-29 16:31:11534it globally will launch many processes and probably isn't worthwhile. Be sure
535you have at least version 2.43 (fsmonitor on the Mac is broken before then). The
Bruce Dawson2154274a2023-06-17 22:24:29536command to enable fsmonitor in the current repo is:
Tiago Vignatti760b0c02023-05-29 19:45:24537
538```shell
539$ git config core.fsmonitor true
540```
541
michaeldo8cccf2142017-03-06 22:12:02542### Xcode license agreement
543
544If you're getting the error
545
546> Agreeing to the Xcode/iOS license requires admin privileges, please re-run as
547> root via sudo.
548
549the Xcode license hasn't been accepted yet which (contrary to the message) any
550user can do by running:
551
552```shell
553$ xcodebuild -license
554```
555
556Only accepting for all users of the machine requires root:
557
558```shell
559$ sudo xcodebuild -license
560```