# KotlinMultiplatformAndroidTestOnDevice

# KotlinMultiplatformAndroidTestOnDevice

<br />

```
@Incubating interface KotlinMultiplatformAndroidTestOnDevice
```

<br />

Known direct subclasses  
[KotlinMultiplatformAndroidTestOnDeviceCompilation](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KotlinMultiplatformAndroidTestOnDeviceCompilation)  

|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [KotlinMultiplatformAndroidTestOnDeviceCompilation](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KotlinMultiplatformAndroidTestOnDeviceCompilation) |   |

*** ** * ** ***

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                 ### Public functions                                                                                                                                                                                                                                                                                                                                                                                                                  ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `@`[Incubating](https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html)` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [emulatorControl](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KotlinMultiplatformAndroidTestOnDevice#emulatorControl(kotlin.Function1))`(action: @`[ExtensionFunctionType](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-extension-function-type/index.html)` `[EmulatorControl](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/EmulatorControl)`.() `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)`                                                                                                                                          |
| `@`[Incubating](https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html)` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [emulatorSnapshots](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KotlinMultiplatformAndroidTestOnDevice#emulatorSnapshots(kotlin.Function1))`(action: @`[ExtensionFunctionType](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-extension-function-type/index.html)` `[EmulatorSnapshots](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/EmulatorSnapshots)`.() `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)`                                                                                                                                  |
| `@`[Incubating](https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html)` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [installation](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KotlinMultiplatformAndroidTestOnDevice#installation(kotlin.Function1))`(action: @`[ExtensionFunctionType](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-extension-function-type/index.html)` `[Installation](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/Installation)`.() `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)` Specifies options for the[Android Debug Bridge (ADB)](https://developer.android.com/studio/command-line/adb.html), such as APK installation options. |
| `@`[Incubating](https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html)` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [managedDevices](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KotlinMultiplatformAndroidTestOnDevice#managedDevices(kotlin.Function1))`(action: @`[ExtensionFunctionType](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-extension-function-type/index.html)` `[ManagedDevices](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/ManagedDevices)`.() `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)` Configures Gradle Managed Devices for use in testing with the Unified test platform.                                                         |
| `@`[Incubating](https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html)` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [multidex](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KotlinMultiplatformAndroidTestOnDevice#multidex(kotlin.Function1))`(action: @`[ExtensionFunctionType](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-extension-function-type/index.html)` `[MultiDexConfig](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/MultiDexConfig)`.() `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)`                                                                                                                                                          |
| `@`[Incubating](https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html)` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [signing](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KotlinMultiplatformAndroidTestOnDevice#signing(kotlin.Function1))`(action: @`[ExtensionFunctionType](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-extension-function-type/index.html)` `[ApkSigningConfig](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/ApkSigningConfig)`.() `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)`                                                                                                                                                        |

|                                                                                                                                                                                                                                                                                       ### Public properties                                                                                                                                                                                                                                                                                        ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                                                                                                              | [animationsDisabled](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KotlinMultiplatformAndroidTestOnDevice#animationsDisabled()) Disables animations during instrumented tests you run from the command line.                                                             |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?`                                                                                                                                                                                             | [applicationId](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KotlinMultiplatformAndroidTestOnDevice#applicationId()) The test application id.                                                                                                                           |
| [EmulatorControl](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/EmulatorControl)                                                                                                                                                       | [emulatorControl](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KotlinMultiplatformAndroidTestOnDevice#emulatorControl()) Configures Android Emulator Grpc Access                                                                                                        |
| [EmulatorSnapshots](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/EmulatorSnapshots)                                                                                                                                                   | [emulatorSnapshots](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KotlinMultiplatformAndroidTestOnDevice#emulatorSnapshots()) Configures Android Test Retention.                                                                                                         |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                                                                                                              | [enableCoverage](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KotlinMultiplatformAndroidTestOnDevice#enableCoverage()) Specifies code coverage is enabled for module tests of type AndroidTest.                                                                         |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)                                                                                                                                                                                                | [execution](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KotlinMultiplatformAndroidTestOnDevice#execution()) Specifies whether to use on-device test orchestration.                                                                                                     |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`?`                                                                                                                                                                                           | [functionalTest](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KotlinMultiplatformAndroidTestOnDevice#functionalTest()) See[instrumentation](http://developer.android.com/guide/topics/manifest/instrumentation-element.html).                                           |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`?`                                                                                                                                                                                           | [handleProfiling](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KotlinMultiplatformAndroidTestOnDevice#handleProfiling()) See[instrumentation](http://developer.android.com/guide/topics/manifest/instrumentation-element.html).                                         |
| [Installation](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/Installation)                                                                                                                                                             | [installation](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KotlinMultiplatformAndroidTestOnDevice#installation()) Specifies options for the[Android Debug Bridge (ADB)](https://developer.android.com/studio/command-line/adb.html), such as APK installation options. |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?`                                                                                                                                                                                             | [instrumentationRunner](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KotlinMultiplatformAndroidTestOnDevice#instrumentationRunner()) Test instrumentation runner class name.                                                                                            |
| [MutableMap](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-map/index.html)`<`[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>` | [instrumentationRunnerArguments](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KotlinMultiplatformAndroidTestOnDevice#instrumentationRunnerArguments()) Test instrumentation runner custom arguments.                                                                    |
| [ManagedDevices](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/ManagedDevices)                                                                                                                                                         | [managedDevices](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KotlinMultiplatformAndroidTestOnDevice#managedDevices()) Configures Gradle Managed Devices for use in testing with the Unified test platform.                                                             |
| [MultiDexConfig](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/MultiDexConfig)                                                                                                                                                         | [multidex](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KotlinMultiplatformAndroidTestOnDevice#multidex())                                                                                                                                                              |
| [ApkSigningConfig](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/ApkSigningConfig)                                                                                                                                                     | [signing](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KotlinMultiplatformAndroidTestOnDevice#signing()) Encapsulates signing configurations that you can apply to test APK                                                                                             |

## Public functions

### emulatorControl

```
@Incubating
fun emulatorControl(action: @ExtensionFunctionType EmulatorControl.() -> Unit): Unit
```  

### emulatorSnapshots

```
@Incubating
fun emulatorSnapshots(action: @ExtensionFunctionType EmulatorSnapshots.() -> Unit): Unit
```  

### installation

```
@Incubating
fun installation(action: @ExtensionFunctionType Installation.() -> Unit): Unit
```

Specifies options for the[Android Debug Bridge (ADB)](https://developer.android.com/studio/command-line/adb.html), such as APK installation options.

For more information about the properties you can configure in this block, see[Installation](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/Installation).  

### managedDevices

```
@Incubating
fun managedDevices(action: @ExtensionFunctionType ManagedDevices.() -> Unit): Unit
```

Configures Gradle Managed Devices for use in testing with the Unified test platform.  

### multidex

```
@Incubating
fun multidex(action: @ExtensionFunctionType MultiDexConfig.() -> Unit): Unit
```  

### signing

```
@Incubating
fun signing(action: @ExtensionFunctionType ApkSigningConfig.() -> Unit): Unit
```

## Public properties

### animationsDisabled

```
var animationsDisabled: Boolean
```

Disables animations during instrumented tests you run from the command line.

If you set this property to`true`, running instrumented tests with Gradle from the command line executes`am instrument`with the`--no-window-animation`flag. By default, this property is set to`false`.

This property does not affect tests that you run using Android Studio. To learn more about running tests from the command line, see[Test from the Command Line](https://d.android.com/studio/test/command-line.html).  

### applicationId

```
var applicationId: String?
```

The test application id.  

### emulatorControl

```
val emulatorControl: EmulatorControl
```

Configures Android Emulator Grpc Access

Android Emulator Grpc Access will make it possible to interact with the emulator over gRPC  

```kotlin
emulatorControl {
  enable true
  secondsValid 180
  allowedEndpoints.addAll(
      "/android.emulation.control.EmulatorController/getStatus",
      "/android.emulation.control.EmulatorController/getVmState")
}
```  

### emulatorSnapshots

```
val emulatorSnapshots: EmulatorSnapshots
```

Configures Android Test Retention.

Android Test Retention automatically takes emulator snapshots on test failures. It can only work with Unified Test Platform (UTP).  

```kotlin
emulatorSnapshots {
  enableForTestFailures true
  maxSnapshotsForTestFailures 2
  compressSnapshots false
}
```  

### enableCoverage

```
var enableCoverage: Boolean
```

Specifies code coverage is enabled for module tests of type AndroidTest.

If enabled, prepares module class files for code coverage collection such as instrumenting dependent library classes and module classes. This allows for code coverage reports to be generated.  

### execution

```
var execution: String
```

Specifies whether to use on-device test orchestration.

If you want to[use Android Test Orchestrator](https://developer.android.com/training/testing/junit-runner.html#using-android-test-orchestrator)you need to specify`"ANDROID_TEST_ORCHESTRATOR"`, as shown below. By default, this property is set to`"HOST"`, which disables on-device orchestration.  

### functionalTest

```
var functionalTest: Boolean?
```

See[instrumentation](http://developer.android.com/guide/topics/manifest/instrumentation-element.html).  

### handleProfiling

```
var handleProfiling: Boolean?
```

See[instrumentation](http://developer.android.com/guide/topics/manifest/instrumentation-element.html).  

### installation

```
val installation: Installation
```

Specifies options for the[Android Debug Bridge (ADB)](https://developer.android.com/studio/command-line/adb.html), such as APK installation options.

For more information about the properties you can configure in this block, see[Installation](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/Installation).  

### instrumentationRunner

```
var instrumentationRunner: String?
```

Test instrumentation runner class name. This is a fully qualified class name of the runner See[instrumentation](http://developer.android.com/guide/topics/manifest/instrumentation-element.html).  

### instrumentationRunnerArguments

```
val instrumentationRunnerArguments: MutableMap<String, String>
```

Test instrumentation runner custom arguments.

e.g.`[key: "value"]`will give`adb shell am instrument -w -e key value com.example`...

See[instrumentation](http://developer.android.com/guide/topics/manifest/instrumentation-element.html).

Test runner arguments can also be specified from the command line:  

```kotlin
./gradlew connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.size=medium
./gradlew connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.foo=bar
```  

### managedDevices

```
val managedDevices: ManagedDevices
```

Configures Gradle Managed Devices for use in testing with the Unified test platform.  

### multidex

```
val multidex: MultiDexConfig
```  

### signing

```
val signing: ApkSigningConfig
```

Encapsulates signing configurations that you can apply to test APK

For more information about the properties you can configure in this block, see[ApkSigningConfig](https://developer.android.com/reference/tools/gradle-api/8.2/com/android/build/api/dsl/ApkSigningConfig).