diff options
author | jingwen <jingwen@google.com> | 2018-08-14 15:32:49 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-08-14 15:34:29 -0700 |
commit | 2734ceb1f890d1e953acd13d4dbe6c26c0c5d2e2 (patch) | |
tree | eec862affefed48ff813dc558a29355cf70c28da /site/docs/android-instrumentation-test.md | |
parent | 2c13e3f3912914bd9a453e2abe6bb517bfb20cc2 (diff) |
Add note about requiring an <instrumentation> tag in a test app's AndroidManifest.xml
RELNOTES: None.
PiperOrigin-RevId: 208725953
Diffstat (limited to 'site/docs/android-instrumentation-test.md')
-rw-r--r-- | site/docs/android-instrumentation-test.md | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/site/docs/android-instrumentation-test.md b/site/docs/android-instrumentation-test.md index 7344ef3356..c023623a3e 100644 --- a/site/docs/android-instrumentation-test.md +++ b/site/docs/android-instrumentation-test.md @@ -170,6 +170,36 @@ The main attributes of the rule `android_instrumentation_test` are: run the tests. See the [section on choosing an Android device](#choosing-an-android_device) for more information. +The test app's `AndroidManifest.xml` must include +[an `<instrumentation>` tag](https://developer.android.com/studio/test/#configure_instrumentation_manifest_settings). +This tag must specify the attributes for the **package of the target app** and +the **fully qualified class name of the instrumentation test runner**, +`android.support.test.runner.AndroidJUnitRunner`. + +Here is an example `AndroidTestManifest.xml` for the test app: + +```xml +<?xml version="1.0" encoding="UTF-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + package="com.example.android.app.test" + android:versionCode="1" + android:versionName="1.0"> + + <instrumentation + android:name="android.support.test.runner.AndroidJUnitRunner" + android:targetPackage="com.example.android.app" /> + + <uses-sdk + android:minSdkVersion="16" + android:targetSdkVersion="27" /> + + <application > + <!-- ... --> + </application> +</manifest> +``` + ## `WORKSPACE` dependencies In order to use this rule, your project needs to depend on these external |