Stay organized with collections
Save and categorize content based on your preferences.
StaticTestData
@Incubating interface StaticTestData
Interface for retrieving all test data for a given test invocation for use by the DeviceTestRunTaskAction
.
This is supplied to the DeviceTestRunTaskAction
as a part of the DeviceTestRunParameters.testRunData
Summary
Public properties |
String |
The application ID of the test APK.
|
String |
The class name for the Test Instrumentation Runner.
|
Map<String, String> |
The arguments that should be passed to the InstrumentationRunner.
|
String |
The instrumentation target application id.
|
AndroidVersion |
The minimum SDK version required to test the given testApk .
|
File |
The APK containing the tests.
|
List<File?> |
List of the directories of all test sources in the testApk .
|
(<ERROR CLASS>) -> List<File> |
Returns the APK files to install based on given Device Configuration (such as abi and screen density).
|
String? |
The application ID of the APK under test.
|
String |
The description of the APK under test.
|
Public properties
testApk
val testApk: File
The APK containing the tests.
testedApkFinder
val testedApkFinder: (<ERROR CLASS>) -> List<File>
Returns the APK files to install based on given Device Configuration (such as abi and screen density).
If no such APK can be found, an empty list is returned.
testedApplicationId
val testedApplicationId: String?
The application ID of the APK under test.
This can be null if there is no such APK. For example, android-test in library module does not have a tested-application.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# StaticTestData\n==============\n\n\n```\n@Incubating interface StaticTestData\n```\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nInterface for retrieving all test data for a given test invocation for use by the [DeviceTestRunTaskAction](/reference/tools/gradle-api/8.1/com/android/build/api/instrumentation/manageddevice/DeviceTestRunTaskAction).\n\nThis is supplied to the [DeviceTestRunTaskAction](/reference/tools/gradle-api/8.1/com/android/build/api/instrumentation/manageddevice/DeviceTestRunTaskAction) as a part of the [DeviceTestRunParameters.testRunData](/reference/tools/gradle-api/8.1/com/android/build/api/instrumentation/manageddevice/DeviceTestRunParameters#testRunData())\n\nSummary\n-------\n\n| ### Public properties ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [applicationId](/reference/tools/gradle-api/8.1/com/android/build/api/instrumentation/manageddevice/StaticTestData#applicationId()) The application ID of the test APK. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [instrumentationRunner](/reference/tools/gradle-api/8.1/com/android/build/api/instrumentation/manageddevice/StaticTestData#instrumentationRunner()) The class name for the Test Instrumentation Runner. |\n| [Map](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html)`\u003c`[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`\u003e` | [instrumentationRunnerArguments](/reference/tools/gradle-api/8.1/com/android/build/api/instrumentation/manageddevice/StaticTestData#instrumentationRunnerArguments()) The arguments that should be passed to the InstrumentationRunner. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [instrumentationTargetPackageId](/reference/tools/gradle-api/8.1/com/android/build/api/instrumentation/manageddevice/StaticTestData#instrumentationTargetPackageId()) The instrumentation target application id. |\n| [AndroidVersion](/reference/tools/gradle-api/8.1/com/android/build/api/variant/AndroidVersion) | [minSdkVersion](/reference/tools/gradle-api/8.1/com/android/build/api/instrumentation/manageddevice/StaticTestData#minSdkVersion()) The minimum SDK version required to test the given [testApk](/reference/tools/gradle-api/8.1/com/android/build/api/instrumentation/manageddevice/StaticTestData#testApk()). |\n| [File](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/File.html) | [testApk](/reference/tools/gradle-api/8.1/com/android/build/api/instrumentation/manageddevice/StaticTestData#testApk()) The APK containing the tests. |\n| [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`\u003c`[File](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/File.html)`?\u003e` | [testDirectories](/reference/tools/gradle-api/8.1/com/android/build/api/instrumentation/manageddevice/StaticTestData#testDirectories()) List of the directories of all test sources in the [testApk](/reference/tools/gradle-api/8.1/com/android/build/api/instrumentation/manageddevice/StaticTestData#testApk()). |\n| `(`[\u003cERROR CLASS\u003e](/reference/tools/gradle-api/8.1/[JVM root]/\u003cERROR CLASS\u003e)`) `-\u003e` `[List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`\u003c`[File](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/File.html)`\u003e` | [testedApkFinder](/reference/tools/gradle-api/8.1/com/android/build/api/instrumentation/manageddevice/StaticTestData#testedApkFinder()) Returns the APK files to install based on given Device Configuration (such as abi and screen density). |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?` | [testedApplicationId](/reference/tools/gradle-api/8.1/com/android/build/api/instrumentation/manageddevice/StaticTestData#testedApplicationId()) The application ID of the APK under test. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [testedDescription](/reference/tools/gradle-api/8.1/com/android/build/api/instrumentation/manageddevice/StaticTestData#testedDescription()) The description of the APK under test. |\n\nPublic properties\n-----------------\n\n### applicationId\n\n```\nval applicationId: String\n```\n\nThe application ID of the test APK. \n\n### instrumentationRunner\n\n```\nval instrumentationRunner: String\n```\n\nThe class name for the Test Instrumentation Runner. \n\n### instrumentationRunnerArguments\n\n```\nval instrumentationRunnerArguments: Map\u003cString, String\u003e\n```\n\nThe arguments that should be passed to the InstrumentationRunner. \n\n### instrumentationTargetPackageId\n\n```\nval instrumentationTargetPackageId: String\n```\n\nThe instrumentation target application id.\n\nIf this is a self instrumenting test, then this value will be the same a [applicationId](/reference/tools/gradle-api/8.1/com/android/build/api/instrumentation/manageddevice/StaticTestData#applicationId()). Otherwise, the instrumentation target will be the same as [testedApplicationId](/reference/tools/gradle-api/8.1/com/android/build/api/instrumentation/manageddevice/StaticTestData#testedApplicationId()). \n\n### minSdkVersion\n\n```\nval minSdkVersion: AndroidVersion\n```\n\nThe minimum SDK version required to test the given [testApk](/reference/tools/gradle-api/8.1/com/android/build/api/instrumentation/manageddevice/StaticTestData#testApk()). \n\n### testApk\n\n```\nval testApk: File\n```\n\nThe APK containing the tests. \n\n### testDirectories\n\n```\nval testDirectories: List\u003cFile?\u003e\n```\n\nList of the directories of all test sources in the [testApk](/reference/tools/gradle-api/8.1/com/android/build/api/instrumentation/manageddevice/StaticTestData#testApk()). \n\n### testedApkFinder\n\n```\nval testedApkFinder: (\u003cERROR CLASS\u003e) -\u003e List\u003cFile\u003e\n```\n\nReturns the APK files to install based on given Device Configuration (such as abi and screen density).\n\nIf no such APK can be found, an empty list is returned. \n\n### testedApplicationId\n\n```\nval testedApplicationId: String?\n```\n\nThe application ID of the APK under test.\n\nThis can be null if there is no such APK. For example, android-test in library module does not have a tested-application. \n\n### testedDescription\n\n```\nval testedDescription: String\n```\n\nThe description of the APK under test."]]