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