| Index: docs/android_build_instructions.md
|
| diff --git a/docs/android_build_instructions.md b/docs/android_build_instructions.md
|
| index b188f4b03bddad730d6acb0a035d57266b07bd9d..cc9d42a177b7393724ce11506cb66d54cb863982 100644
|
| --- a/docs/android_build_instructions.md
|
| +++ b/docs/android_build_instructions.md
|
| @@ -1,99 +1,96 @@
|
| # Android Build Instructions
|
|
|
| +**See also [the old version of this page](old_android_build_instructions.md).**
|
| +
|
| +Google employee? See [go/building-chrome](https://goto.google.com/building-chrome) instead.
|
| +
|
| [TOC]
|
|
|
| -## Prerequisites
|
| +## System requirements
|
|
|
| -A Linux build machine capable of building [Chrome for
|
| -Linux](https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_instructions_prerequisites.md).
|
| -Other (Mac/Windows) platforms are not supported for Android.
|
| +* A 64-bit Intel machine running Linux with at least 8GB of RAM. More
|
| + than 16GB is highly recommended.
|
| +* At least 100GB of free disk space.
|
| +* You must have Git and Python installed already.
|
|
|
| -## Getting the code
|
| +Most development is done on Ubuntu. Other distros may or may not work;
|
| +see the [linux instructions](linux_build_instructions.md) for some suggestions.
|
|
|
| -First, check out and install the [depot\_tools
|
| -package](https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up).
|
| +Building the Android client on Windows or Mac is not supported and doesn't work.
|
|
|
| -Then, if you have no existing checkout, create your source directory and
|
| -get the code:
|
| +## Install `depot_tools`
|
|
|
| -```shell
|
| -mkdir ~/chromium && cd ~/chromium
|
| -fetch --nohooks android # This will take 30 minutes on a fast connection
|
| -```
|
| +Clone the depot_tools repository:
|
|
|
| -If you have an existing Linux checkout, you can add Android support by
|
| -appending `target_os = ['android']` to your .gclient file (in the
|
| -directory above src):
|
| + $ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
|
|
| -```shell
|
| -cat > .gclient <<EOF
|
| - solutions = [ ...existing stuff in here... ]
|
| - target_os = [ 'android' ] # Add this to get Android stuff checked out.
|
| -EOF
|
| -```
|
| +Add 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:
|
|
|
| -Then run gclient sync to get the Android stuff checked out:
|
| + $ export PATH=$PATH:/path/to/depot_tools
|
|
|
| -```shell
|
| -gclient sync
|
| -```
|
| +## Get the code
|
|
|
| -## (Optional) Check out LKGR
|
| +Create a 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):
|
|
|
| -If you want a single build of Chromium in a known good state, sync to
|
| -the LKGR ("last known good revision"). You can find it
|
| -[here](http://chromium-status.appspot.com/lkgr), and the last 100
|
| -[here](http://chromium-status.appspot.com/revisions). Run:
|
| + $ mkdir ~/chromium && cd ~/chromium
|
| + $ fetch --nohooks android
|
|
|
| -```shell
|
| -gclient sync --nohooks -r <lkgr-sha1>
|
| -```
|
| +If you don't want the full repo history, you can save a lot of time by
|
| +adding the `--no-history` flag to fetch.
|
|
|
| -This is not needed for a typical developer workflow; only for one-time
|
| -builds of Chromium.
|
| +Expect the command to take 30 minutes on even a fast connection, and many
|
| +hours on slower ones.
|
|
|
| -## Configure GN
|
| +If you've already installed the build dependencies on the machine (from another
|
| +checkout, for example), you can omit the `--nohooks` flag and fetch
|
| +will automatically execute `gclient runhooks` at the end.
|
|
|
| -Create a build directory and set the build flags with:
|
| +When fetch completes, it will have created a directory called `src`.
|
| +The remaining instructions assume you are now in that directory:
|
|
|
| -```shell
|
| -gn args out/Default
|
| -```
|
| + $ cd src
|
|
|
| - You can replace out/Default with another name you choose inside the out
|
| -directory.
|
| +### Converting an existing Linux checkout
|
|
|
| -Also be aware that some scripts (e.g. tombstones.py, adb_gdb.py)
|
| -require you to set `CHROMIUM_OUTPUT_DIR=out/Default`.
|
| +If you have an existing Linux checkout, you can add Android support by
|
| +appending `target_os = ['android']` to your .gclient file (in the
|
| +directory above src):
|
|
|
| -This command will bring up your editor with the GN build args. In this
|
| -file add:
|
| + $ echo "target_os = [ 'android' ]" >> ../.gclient
|
|
|
| -```
|
| -target_os = "android"
|
| -target_cpu = "arm" # (default)
|
| -is_debug = true # (default)
|
| -
|
| -# Other args you may want to set:
|
| -is_component_build = true
|
| -is_clang = true
|
| -symbol_level = 1 # Faster build with fewer symbols. -g1 rather than -g2
|
| -enable_incremental_javac = true # Much faster; experimental
|
| -```
|
| +Then run gclient sync to pull the new Android dependencies:
|
|
|
| -You can also specify `target_cpu` values of "x86" and "mipsel". Re-run
|
| -gn args on that directory to edit the flags in the future. See the [GN
|
| -build
|
| -configuration](https://www.chromium.org/developers/gn-build-configuration)
|
| -page for other flags you may want to set.
|
| + gclient sync
|
|
|
| -### Install build dependencies
|
| +(This is actually the difference between `fetch android` and `fetch chromium`).
|
|
|
| -Update the system packages required to build by running:
|
| +### Install additional build dependencies
|
|
|
| -```shell
|
| -./build/install-build-deps-android.sh
|
| -```
|
| +Once you have checked out the code, run
|
| +
|
| + build/install-build-deps-android.sh
|
| +
|
| +to get all of the dependencies you need to build on Linux *plus* all of the
|
| +Android-specific dependencies (you need some of the regular Linux dependencies
|
| +because an Android build builds a bunch of the Linux tools and utilities).
|
| +
|
| +### Run the hooks
|
| +
|
| +Once you've run `install-build-deps` at least once, you can now run the
|
| +chromium-specific hooks, which will download additional binaries and other
|
| +things you might need:
|
| +
|
| + $ gclient runhooks
|
| +
|
| +*Optional*: You can also [install API keys](https://www.chromium.org/developers/how-tos/api-keys)
|
| +if you want to talk to some of the Google services, but this is not necessary
|
| +for most development and testing purposes.
|
| +
|
| +### Configure the JDK
|
|
|
| Make also sure that OpenJDK 1.7 is selected as default:
|
|
|
| @@ -104,13 +101,40 @@ Make also sure that OpenJDK 1.7 is selected as default:
|
| `sudo update-alternatives --config jar`
|
| `sudo update-alternatives --config jarsigner`
|
|
|
| -### Synchronize sub-directories.
|
| +## Setting up the Build
|
|
|
| -```shell
|
| -gclient sync
|
| -```
|
| +Chromium uses [Ninja](https://ninja-build.org) as its main build tool, and
|
| +a tool called [GN](../tools/gn/docs/quick_start.md) to generate
|
| +the .ninja files to do the build. To create a build directory configured
|
| +to build Android, run:
|
| +
|
| + $ gn gen '--args="target_os="android"' out/Default
|
| +
|
| +* You only have to do run this command once, it will self-update the build
|
| + files as needed after that.
|
| +* You can replace `out/Default` with another directory name, but we recommend
|
| + it should still be a subdirectory of `out`.
|
| +* To specify build parameters for GN builds, including release settings,
|
| + see [GN build configuration](https://www.chromium.org/developers/gn-build-configuration).
|
| + The default will be a debug component build matching the current host
|
| + operating system and CPU.
|
| +* For more info on GN, run `gn help` on the command line or read the
|
| + [quick start guide](../tools/gn/docs/quick_start.md).
|
| +
|
| +Also be aware that some scripts (e.g. tombstones.py, adb_gdb.py)
|
| +require you to set `CHROMIUM_OUTPUT_DIR=out/Default`.
|
| +
|
| +## Build Chromium
|
| +
|
| +Build Chromium with Ninja using the command:
|
| +
|
| + $ ninja -C out/Default chrome_public_apk
|
|
|
| -## Build and install the APKs
|
| +You can get a list of all of the other build targets from GN by running
|
| +`gn ls out/Default` from the command line. To compile one, pass to Ninja
|
| +the GN label with no preceding "//" (so for `//chrome/test:unit_tests`
|
| +use ninja -C out/Default chrome/test:unit_tests`).
|
| +## Installing and Running Chromium on a device
|
|
|
| If the `adb_install_apk.py` script below fails, make sure aapt is in
|
| your PATH. If not, add aapt's path to your PATH environment variable (it
|
| @@ -290,9 +314,9 @@ To uninstall:
|
| out/Default/bin/install_chrome_public_apk_incremental -v --uninstall
|
| ```
|
|
|
| -### Miscellaneous
|
| +## Tips, tricks, and troubleshooting
|
|
|
| -#### Rebuilding libchrome.so for a particular release
|
| +### Rebuilding libchrome.so for a particular release
|
|
|
| These instructions are only necessary for Chrome 51 and earlier.
|
|
|
|
|