Googler | d1bd9d6 | 2017-09-13 21:21:50 +0200 | [diff] [blame] | 1 | --- |
| 2 | layout: documentation |
| 3 | title: Android and Bazel |
| 4 | --- |
| 5 | |
| 6 | # Android and Bazel |
| 7 | |
| 8 | This page contains resources that help you use Bazel with Android projects. It |
| 9 | links to a tutorial, build rules, and other information specific to building |
| 10 | Android projects with Bazel. |
| 11 | |
jingwen | 190e37b | 2018-11-07 07:53:19 -0800 | [diff] [blame] | 12 | ## Getting started |
Googler | d1bd9d6 | 2017-09-13 21:21:50 +0200 | [diff] [blame] | 13 | |
| 14 | The following resources will help you work with Bazel on Android projects: |
| 15 | |
jingwen | 66cb873 | 2018-04-12 19:00:34 -0700 | [diff] [blame] | 16 | * [Tutorial: Building an Android app](tutorial/android-app.html). This tutorial |
| 17 | is a good place to start learning about Bazel commands and concepts, and how |
| 18 | to build Android apps with Bazel. |
Michael Chinen | 7c204f6 | 2021-03-31 13:13:43 -0700 | [diff] [blame] | 19 | * [Codelab: Building Android Apps with Bazel](https://developer.android.com/codelabs/bazel-android-intro#0). |
Jingwen Chen | aceca06 | 2018-07-23 08:07:29 -0700 | [diff] [blame] | 20 | This codelab explains how to build Android apps with Bazel. |
jingwen | 190e37b | 2018-11-07 07:53:19 -0800 | [diff] [blame] | 21 | |
| 22 | ## Features |
| 23 | |
| 24 | Bazel has Android rules for building and testing Android apps, integrating with |
| 25 | the SDK/NDK, and creating emulator images. There are also Bazel plugins for |
| 26 | Android Studio and IntelliJ. |
| 27 | |
Jingwen Chen | 0f4544d | 2018-12-14 16:28:16 -0800 | [diff] [blame] | 28 | * [Android rules](be/android.html). The Build Encyclopedia describes the rules |
jingwen | 1d897e2 | 2019-07-26 07:20:10 -0700 | [diff] [blame] | 29 | for building and testing Android apps with Bazel. |
jingwen | 66cb873 | 2018-04-12 19:00:34 -0700 | [diff] [blame] | 30 | * [Integration with Android Studio](ide.html). Bazel is compatible with |
| 31 | Android Studio using the [Android Studio with Bazel](https://ij.bazel.build/) |
| 32 | plugin. |
jingwen | 190e37b | 2018-11-07 07:53:19 -0800 | [diff] [blame] | 33 | * [`mobile-install` for Android](mobile-install.html). Bazel's `mobile-install` |
| 34 | feature provides automated build-and-deploy functionality for building and |
| 35 | testing Android apps directly on Android devices and emulators. |
Jingwen Chen | 0f4544d | 2018-12-14 16:28:16 -0800 | [diff] [blame] | 36 | * [Android instrumentation testing](android-instrumentation-test.html) on |
| 37 | emulators and devices. |
| 38 | * [Android NDK integration](android-ndk.html). Bazel supports compiling to |
| 39 | native code through direct NDK integration and the C++ rules. |
jingwen | cf35463 | 2019-08-12 13:01:09 -0700 | [diff] [blame] | 40 | * [Android build performance](android-build-performance.html). This page |
| 41 | provides information on optimizing build performance for Android apps. |
jingwen | 190e37b | 2018-11-07 07:53:19 -0800 | [diff] [blame] | 42 | |
| 43 | ## Further reading |
| 44 | |
Googler | 78fd06f | 2019-10-28 14:59:19 -0700 | [diff] [blame] | 45 | * Integrating with dependencies from Google Maven and Maven Central with [rules_jvm_external](https://github.com/bazelbuild/rules_jvm_external). |
jingwen | 66cb873 | 2018-04-12 19:00:34 -0700 | [diff] [blame] | 46 | * Learn [How Android Builds Work in Bazel](https://blog.bazel.build/2018/02/14/how-android-builds-work-in-bazel.html). |