# AgpTestSuiteTarget

# AgpTestSuiteTarget

[View Source](https://cs.android.com/search?q=file:com/android/build/api/dsl/AgpTestSuiteTarget.kt+class:com.android.build.api.dsl.AgpTestSuiteTarget)  
Added in 8.12.0  

<br />

```
@Incubating
interface AgpTestSuiteTarget : TestSuiteTarget, Named
```

<br />

*** ** * ** ***

A test suite target is a collection of tests that run in a particular context. The context is defined by the devices they run on when dealing with a device test.

android { // ... other android configurations like compileSdk, defaultConfig, etc.  

```text
testOptions {
    managedDevices {
        localDevices {
            // First, define your individual managed devices
            create("pixel2api30") {
                device = "Pixel 2"
                apiLevel = 30
                systemImageSource = "aosp-atd" // or "google", "google-atd", "aosp"
            }
            create("pixel6api33") {
                device = "Pixel 6"
                apiLevel = 33
                systemImageSource = "google-atd"
            }
            create("largeScreenApi31") {
                device = "Nexus 10" // Example of a tablet
                apiLevel = 31
                systemImageSource = "aosp"
            }
        }

        groups {
            // Now, define your groups referencing the devices above
            create("phoneGroup") {
                // This group targets specific phone-like devices
                targetDevices.add(allDevices.getByName("pixel2api30"))
                targetDevices.add(allDevices.getByName("pixel6api33"))

                // You can also set properties for all devices in this group
                // if they are not already set on the individual device.
                // For example:
                // systemImageSource = "aosp-atd" // if all devices in this group should use this
            }

            create("tabletGroup") {
                // This group targets tablet-like devices
                targetDevices.add(devices.getByName("largeScreenApi31"))
            }

            create("allMyCiDevices") {
                // This group could target all devices you use for CI
                targetDevices.addAll(devices.getByName("pixel2api30"), devices.getByName("pixel6api33"), devices.getByName("largeScreenApi31"))
            }
        }
    }
}

testOptions {
    suites {
         create("someTestSuite") {
              targets {
                  create("tabletRun") {
                     targetDevices += "tabletGroup"
                  }
              }
         }
    }
}
```

}

## Summary

|                                                                                     ### Public properties                                                                                     |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)`<`[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>` | [targetDevices](https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/dsl/AgpTestSuiteTarget#targetDevices()) Defines which group of devices or devices to run the test suite tests against. |

|                                                                                                                                                                                                                                                                                                                                                                                                      ### Inherited functions                                                                                                                                                                                                                                                                                                                                                                                                      |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[org.gradle.api.Named](https://docs.gradle.org/current/javadoc/org/gradle/api/Named.html) |----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------| | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [getName](https://docs.gradle.org/current/javadoc/org/gradle/api/Named.html#getName--)`()` |                                                                                                                                                                                                                                                                                                                                                                 |
| From[org.gradle.testing.base.TestSuiteTarget](https://docs.gradle.org/current/javadoc/org/gradle/testing/base/TestSuiteTarget.html) |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------| | [Provider](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Provider.html)`<`[Directory](https://docs.gradle.org/current/javadoc/org/gradle/api/file/Directory.html)`>` | [getBinaryResultsDirectory](https://docs.gradle.org/current/javadoc/org/gradle/testing/base/TestSuiteTarget.html#getBinaryResultsDirectory--)`()` | |

## Public properties

### targetDevices

Added in 8.12.0  

```
val targetDevices: MutableList<String>
```

Defines which group of devices or devices to run the test suite tests against. If the test runs on the host machine, this list will be ignored.