OLD | NEW |
1 ### Build Instructions (iOS) | 1 ### Build Instructions (iOS) |
2 | 2 |
3 **Note:** Upstreaming of iOS code is still a work in progress. In particular, | 3 **Note:** Upstreaming of iOS code is still a work in progress. In particular, |
4 note that **it is not currently possible to build an actual Chromium app.** | 4 note that **it is not currently possible to build an actual Chromium app.** |
5 Currently, the buildable binaries are ios\_web\_shell (a minimal wrapper around | 5 Currently, the buildable binaries are ios\_web\_shell (a minimal wrapper around |
6 the web layer), and various unit tests. | 6 the web layer), and various unit tests. |
7 | 7 |
8 Prerequisites | 8 Prerequisites |
9 ------------- | 9 ------------- |
10 | 10 |
11 - A Mac with a version of OS X capable of running the latest version | 11 - A Mac with a version of OS X capable of running the latest version |
12 of Xcode. | 12 of Xcode. |
13 - The latest version of [Xcode](https://developer.apple.com/xcode/), | 13 - The latest version of [Xcode](https://developer.apple.com/xcode/), |
14 including the current iOS SDK. | 14 including the current iOS SDK. |
15 - The current version of the JDK (required for the closure compiler). | 15 - The current version of the JDK (required for the closure compiler). |
16 - [depot\_tools](http://dev.chromium.org/developers/how-tos/install-depot-tool
s). | 16 - [depot\_tools](http://dev.chromium.org/developers/how-tos/install-depot-tool
s). |
17 | 17 |
18 Setting Up | 18 Setting Up |
19 ---------- | 19 ---------- |
20 | 20 |
21 In the directory where you are going to check out the code, create a | 21 In the directory where you are going to check out the code, create a |
22 `chromium.gyp_env` to set the build to use iOS targets (and to use | 22 `chromium.gyp_env` to set the build to use iOS targets (and to use |
23 hybrid builds; see Building below): | 23 hybrid builds; see [Building](#Building) below): |
24 | 24 |
25 `echo "{ 'GYP_DEFINES': 'OS=ios','GYP_GENERATORS': | 25 ```shell |
26 'ninja,xcode-ninja', }" > chromium.gyp_env` | 26 cat > chromium.gyp_env <<EOF |
| 27 { |
| 28 "GYP_DEFINES": "OS=ios", |
| 29 "GYP_GENERATORS": "ninja,xcode-ninja", |
| 30 } |
| 31 EOF |
| 32 ``` |
27 | 33 |
28 If you aren't set up to sign iOS build products via a developer account, | 34 If you aren't set up to sign iOS build products via a developer account, |
29 you should instead use: | 35 you should instead use: |
30 | 36 |
31 `echo "{ 'GYP_DEFINES': 'OS=ios chromium_ios_signing=0', 'GYP_GENERATORS': 'ninj
a,xcode-ninja', }" > chromium.gyp_env` | 37 ```shell |
| 38 cat > chromium.gyp_env <<EOF |
| 39 { |
| 40 "GYP_DEFINES": "OS=ios chromium_ios_signing=0", |
| 41 "GYP_GENERATORS": "ninja,xcode-ninja", |
| 42 } |
| 43 EOF |
| 44 ``` |
32 | 45 |
33 Also, you should [install API | 46 Also, you should [install API |
34 keys](https://www.chromium.org/developers/how-tos/api-keys). | 47 keys](https://www.chromium.org/developers/how-tos/api-keys). |
35 | 48 |
36 Getting the Code | 49 Getting the Code |
37 ---------------- | 50 ---------------- |
38 | 51 |
39 Next, [check out the | 52 Next, [check out the |
40 code](https://www.chromium.org/developers/how-tos/get-the-code), with | 53 code](https://www.chromium.org/developers/how-tos/get-the-code), with: |
41 | 54 |
42 `fetch ios` | 55 ```shell |
| 56 fetch ios |
| 57 ``` |
43 | 58 |
44 Building | 59 Building |
45 -------- | 60 -------- |
46 | 61 |
47 Build the target you are interested in. The instructions above select | 62 Build the target you are interested in. The instructions above select |
48 the ninja/Xcode hybrid mode, which uses ninja to do the actual build, | 63 the ninja/Xcode hybrid mode, which uses ninja to do the actual build, |
49 but provides a wrapper Xcode project that can be used to build targets | 64 but provides a wrapper Xcode project that can be used to build targets |
50 and navigate the source. (The Xcode project just shells out to ninja to | 65 and navigate the source. (The Xcode project just shells out to ninja to |
51 do the builds, so you can't actually inspect/change target-level | 66 do the builds, so you can't actually inspect/change target-level |
52 settings from within Xcode; this mode avoids generating a large tree of | 67 settings from within Xcode; this mode avoids generating a large tree of |
53 Xcode projects, which leads to performance issues in Xcode). To build | 68 Xcode projects, which leads to performance issues in Xcode). To build |
54 with ninja (simulator and device, respectively): | 69 with ninja (simulator and device, respectively): |
55 | 70 |
56 `ninja -C out/Debug-iphonesimulator All` | 71 ```shell |
| 72 ninja -C out/Debug-iphonesimulator All |
| 73 ninja -C out/Debug-iphoneos All |
| 74 ``` |
57 | 75 |
58 `ninja -C out/Debug-iphoneos All` | 76 To build with Xcode, open `build/all.ninja.xcworkspace`, and choose the |
59 | |
60 To build with Xcode, open build/all.ninja.xcworkspace, and choose the | |
61 target you want to build. | 77 target you want to build. |
62 | 78 |
63 You should always be able to build all:All, since targets are added | 79 You should always be able to build All, since targets are added there for iOS |
64 there for iOS only when they compile. | 80 only when they compile. |
65 | 81 |
66 Running | 82 Running |
67 ------- | 83 ------- |
68 | 84 |
69 Any target that is built and runs on the bots (see below) should run | 85 Any target that is built and runs on the bots (see [below](#Troubleshooting)) |
70 successfully in a local build. As of the time of writing, this is only | 86 should run successfully in a local build. As of the time of writing, this is |
71 ios\_web\_shell and unit test targets—see the note at the top of this | 87 only ios\_web\_shell and unit test targets—see the note at the top of this |
72 page. Check the bots periodically for updates; more targets (new | 88 page. Check the bots periodically for updates; more targets (new components) |
73 components) will come on line over time. | 89 will come on line over time. |
74 | 90 |
75 To run in the simulator from the command line, you can use `iossim`. For | 91 To run in the simulator from the command line, you can use `iossim`. For |
76 example, to run a debug build of web\_shell: | 92 example, to run a debug build of ios\_web\_shell: |
77 | 93 |
78 `out/Debug-iphonesimulator/iossim out/Debug-iphonesimulator/ios_web_shell.app` | 94 ```shell |
| 95 out/Debug-iphonesimulator/iossim out/Debug-iphonesimulator/ios_web_shell.app |
| 96 ``` |
79 | 97 |
80 **Converting an existing Mac checkout into an iOS checkout** | 98 Converting an existing Mac checkout into an iOS checkout |
| 99 -------------------------------------------------------- |
81 | 100 |
82 If you want to convert your Mac checkout into an iOS checkout, you can | 101 If you want to convert your Mac checkout into an iOS checkout, you can |
83 follow the next steps: | 102 follow those steps: |
84 | 103 |
85 1- Add 'target\_os = [ "ios" ]' to the bottom of your chromium/.gclient | 104 1. Add `target_os = [ "ios" ]` to the bottom of your `chromium/.gclient` |
86 file. | 105 file. |
87 | 106 |
88 2- Make sure you have the following in your chromium/chromium.gyp\_env | 107 2. Make sure you have the following in your `chromium/chromium.gyp_env` |
89 file (removing the `chromium_ios_signing=0` if you want to make | 108 file (removing the `chromium_ios_signing=0` if you want to make |
90 developer-signed builds): | 109 developer-signed builds): |
91 | 110 |
92 `{ | 111 ```json |
93 "GYP\_DEFINES" : "OS=ios chromium\_ios\_signing=0", | 112 { |
94 "GYP\_GENERATORS" : "ninja,xcode-ninja", | 113 "GYP_DEFINES" : "OS=ios chromium_ios_signing=0", |
95 }` | 114 "GYP_GENERATORS" : "ninja,xcode-ninja", |
| 115 } |
| 116 ``` |
96 | 117 |
97 Then make sure you sync again to get all the new files like the | 118 Then make sure you sync again to get all the new files like the following. At |
98 following. At the end it will run gyp\_chromium which will regenerate | 119 the end it will run `build/gyp_chromium` which will regenerate all the build |
99 all the build files according to the new settings. | 120 files according to the new settings. |
100 | 121 |
101 `gclient sync` | 122 ```shell |
| 123 gclient sync |
| 124 ``` |
102 | 125 |
103 Troubleshooting | 126 Troubleshooting |
104 --------------- | 127 --------------- |
105 | 128 |
106 If your build fails, check the iOS columns of [the Mac | 129 If your build fails, check the iOS columns of [the Mac |
107 waterfall](http://build.chromium.org/p/chromium.mac/console) (the last | 130 waterfall](http://build.chromium.org/p/chromium.mac/console) (the last |
108 two) to see if the bots are green. In general they should be, since | 131 two) to see if the bots are green. In general they should be, since |
109 failures on those bots will close the tree. | 132 failures on those bots will close the tree. |
OLD | NEW |