# DeviceTestRunTaskAction

# DeviceTestRunTaskAction

<br />

```
@Incubating interface DeviceTestRunTaskAction<InputT : DeviceTestRunInput>
```

<br />

*** ** * ** ***

The Action for running the Test within the test Task.

This is the action to perform all of the test behavior for the given Custom Managed Device. This includes:

1. Setting up the device for testing

2. Installing all apks necessary for the test

3. Running the tests

4. Any clean up for the device.

This should be implemented for use with a Custom Managed Device Registration.  

|                                                                                                                                                                                                                 Parameters                                                                                                                                                                                                                  ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `<InputT : `[DeviceTestRunInput](https://developer.android.com/reference/tools/gradle-api/8.1/com/android/build/api/instrumentation/manageddevice/DeviceTestRunInput)`>` | The Custom Managed Device specific input to be passed in as part of the[DeviceTestRunParameters](https://developer.android.com/reference/tools/gradle-api/8.1/com/android/build/api/instrumentation/manageddevice/DeviceTestRunParameters)when the tests are run. |

## Summary

|                                                                                                                                                                                                                                                                                                                    ### Public functions                                                                                                                                                                                                                                                                                                                     ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `@`[Incubating](https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html)` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [runTests](https://developer.android.com/reference/tools/gradle-api/8.1/com/android/build/api/instrumentation/manageddevice/DeviceTestRunTaskAction#runTests(com.android.build.api.instrumentation.manageddevice.DeviceTestRunParameters))`(params: `[DeviceTestRunParameters](https://developer.android.com/reference/tools/gradle-api/8.1/com/android/build/api/instrumentation/manageddevice/DeviceTestRunParameters)`<InputT>)` Runs the tests with the given parameters. |

## Public functions

### runTests

```
@Incubating
fun runTests(params: DeviceTestRunParameters<InputT>): Boolean
```

Runs the tests with the given parameters.  

|                                                                                                             Parameters                                                                                                             ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------|
| `params: `[DeviceTestRunParameters](https://developer.android.com/reference/tools/gradle-api/8.1/com/android/build/api/instrumentation/manageddevice/DeviceTestRunParameters)`<InputT>` | All parameters required to run this test. |

|                                                                                   Returns                                                                                   ||
|------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | returns true if and only if all tests passed. Determines if the task succeeds or fails. |