aboutsummaryrefslogtreecommitdiffhomepage
path: root/site/versions
diff options
context:
space:
mode:
authorGravatar Alex Humesky <ahumesky@google.com>2017-01-06 19:03:10 +0000
committerGravatar Marcel Hlopko <hlopko@google.com>2017-01-09 10:13:58 +0000
commit105e661bbc08aac35213200a40f0fba4f8832151 (patch)
tree4decf65f269bd6a18b3a1b1b195adfbe39285b0f /site/versions
parentcc1b9b3404bd974a0dc55b923830d9e4bf4a7790 (diff)
Updates Android flag documentation.
-- PiperOrigin-RevId: 143792017 MOS_MIGRATED_REVID=143792017
Diffstat (limited to 'site/versions')
-rw-r--r--site/versions/master/docs/bazel-user-manual.html102
1 files changed, 94 insertions, 8 deletions
diff --git a/site/versions/master/docs/bazel-user-manual.html b/site/versions/master/docs/bazel-user-manual.html
index 109a7ade8d..5716b56fea 100644
--- a/site/versions/master/docs/bazel-user-manual.html
+++ b/site/versions/master/docs/bazel-user-manual.html
@@ -1520,6 +1520,38 @@ the compilation of binaries during the build.
used to build host tools.
</p>
+<h4 id='flag--fat_apk_cpu'><code class='flag'>--fat_apk_cpu <var>cpu[,cpu]*</var></code></h4>
+<p>
+ The CPUs to build C/C++ libraries for in the transitive <code>deps</code> of
+ <code>android_binary</code>
+
+ rules. Other C/C++ rules are not affected. For example, if a <code>cc_library</code>
+ appears in the transitive <code>deps</code> of an <code>android_binary</code> rule and a
+ <code>cc_binary</code> rule, the <code>cc_library</code> will be built at least twice:
+ once for each CPU specified with <code class='flag'>--fat_apk_cpu</code> for the
+ <code>android_binary</code> rule, and once for the CPU specified with
+ <code class='flag'>--cpu</code> for the <code>cc_binary</code> rule.
+
+<p>
+The default is <code>armeabi-v7a</code>.
+</p>
+ <p>
+ One <code>.so</code> file will be created and packaged in the APK for
+ each CPU specified with <code class='flag'>--fat_apk_cpu</code>. The name of the <code>.so</code>
+ file will be the name of the <code>android_binary</code> rule prefixed with "lib", e.g., if the name
+ of the <code>android_binary</code> is "foo", then the file will be <code>libfoo.so</code>.
+ </p>
+
+ <p>
+ Note that an Android-compatible crosstool must be selected.
+ If an <code>android_ndk_repository</code> rule is defined in the
+ WORKSPACE file, an Android-compatible crosstool is automatically selected.
+ Otherwise, the crostool can be selected using the
+ <a href='#flag--android_crosstool_top'><code class='flag'>--android_crosstool_top</code></a>
+ or <a href='#flag--crosstool_top'><code class='flag'>--crosstool_top</code></a> flags.
+ </p>
+</p>
+
<h4 id='flag--experimental_skip_static_outputs'><code class='flag'>--experimental_skip_static_outputs</code></h4>
<p>
The <code class='flag'>--experimental_skip_static_outputs</code> option causes all
@@ -1670,6 +1702,14 @@ the compilation of binaries during the build.
is to enable cross-compilation.
</p>
+<h4 id='flag--android_crosstool_top'><code class='flag'>--android_crosstool_top <var>label</var></code></h4>
+<p>
+ The crosstool to use for compiling C/C++ rules in the transitive <code>deps</code> of
+ <code>android_binary</code> rules. This is useful if other targets in the
+ build require a different crosstool. The default is to use the crosstool
+ generated by the <code>android_ndk_repository</code> rule in the WORKSPACE file.
+ See also <a href='#flag--fat_apk_cpu'><code class='flag'>--fat_apk_cpu</code></a>.
+</p>
<h4 id='flag--compiler'><code class='flag'>--compiler <var>version</var></code></h4>
<p>
This option specifies the C/C++ compiler version (e.g. <code>gcc-4.1.0</code>)
@@ -1698,6 +1738,16 @@ the compilation of binaries during the build.
glibc version, and target CPU are allowed.
</p>
+<h4 id='flag--android_sdk'><code class='flag'>--android_sdk <var>label</var></code></h4>
+<p>
+ This option specifies the Android SDK/platform toolchain
+ and Android runtime library that will be used to build any Android-related
+ rule.
+
+ The Android SDK will be automatically selected if an <code>android_sdk_repository</code>
+ rule is defined in the WORKSPACE file.
+</p>
+
<h4 id='flag--java_toolchain'><code class='flag'>--java_toolchain <var>label</var></code></h4>
<p>
This option specifies the label of the java_toolchain used to compile Java
@@ -3042,6 +3092,9 @@ in an environment closer to the current shell environment. Note that none of the
<p>
The <code>mobile-install</code> command installs apps to mobile devices.
Currently only Android devices running ART are supported.
+
+ See <a href="mobile-install.html">bazel mobile-install</a>
+ for more information.
</p>
<p>
Note that this command does not install the same thing that
@@ -3061,26 +3114,59 @@ in an environment closer to the current shell environment. Note that none of the
things change, this option must be omitted. Contrary to the spirit of Bazel
and due to limitations of the Android platform, it is the
<b>responsibility of the user</b> to know when this command is good enough and
- when a full install is needed. We are working to come up with a better
- solution.
+ when a full install is needed.
+
+ If you are using a device with Marshmallow or later, consider the
+ <a href='#flag--split_apks'><code class='flag'>--split_apks</code></a> flag.
+</p>
+<h4 id='flag--split_apks'><code class='flag'>--split_apks</code></h4>
+<p>
+ Whether to use split apks to install and update the application on the device.
+ Works only with devices with Marshmallow or later. Note that the
+ <a href='#flag--incremental'><code class='flag'>--incremental</code></a> flag
+ is not necessary when using <code class='flag'>--split_apks</code>.
</p>
-<h4 id='flag--adb'><code class='flag'>--adb</code></h4>
+<h4 id='flag--start_app'><code class='flag'>--start_app</code></h4>
<p>
- Indicates the <code>adb</code> binary to be used. When unspecified, the binary
- in the repository is used.
+ Starts the app in a clean state after installing. Equivalent to
+ <code>--start=COLD</code>.
</p>
-<h4 id='flag--adb_arg'><code class='flag'>--adb_arg</code></h4>
+<h4 id='flag--start'><code class='flag'>--start (NO|COLD|WARM)</code></h4>
+<p>
+ How the app should be started after installing it. Set to <code>WARM</code> to
+ preserve and restore application state on incremental installs. Set to
+ <code>COLD</code> to start the app from a clean state after install. Defaults
+ <code>NO</code> which does not start the app.
+</p>
+<h4 id='flag--adb'><code class='flag'>--adb <var>path</var></code></h4>
+<p>
+ Indicates the <code>adb</code> binary to be used.
+
+ The default is to use the adb in the Android SDK specified by
+ <a href='#flag--android_sdk'><code class='flag'>--android_sdk</code></a>.
+
+</p>
+<h4 id='flag--adb_arg'><code class='flag'>--adb_arg <var>arg</var></code></h4>
<p>
Extra arguments to <code>adb</code>. These come before the subcommand in the
command line and are typically used to specify which device to install to.
- Example:
+ For example, to select the Android device or emulator to use:
<pre>% bazel mobile-install --adb_arg=-s --adb_arg=deadbeef
</pre>
will invoke <code>adb</code> as
<pre>
adb -s deadbeef install ...
</pre>
-
+</p>
+<h4 id='flag--adb_jobs'><code class='flag'>--adb_jobs <var>number</var></code></h4>
+<p>
+ The number of instances of adb to use in parallel to update files on the
+ device.
+</p>
+<h4 id='flag--incremental_install_verbosity'><code class='flag'>--incremental_install_verbosity <var>number</var></code></h4>
+<p>
+ The verbosity for incremental install. Set to 1 for debug logging to be
+ printed to the console.
</p>
<h3 id='analyze-profile'>The <code>analyze-profile</code> command</h3>