Starting March 27, 2025, we recommend using android-latest-release
instead of aosp-main
to build and contribute to AOSP. For more information, see Changes to AOSP.
Tradefed configuration object
Stay organized with collections
Save and categorize content based on your preferences.
Tradefed XML configuration
is parsed, and a Configuration
object is created from it that describes the
complete configuration.
The object is described by the
IConfiguration interface.
it will contain an instance of all the objects defined in the XML.
This example:
<configuration description="<description of the configuration>">
<!-- A build provider that takes local device information -->
<build_provider class="com.android.tradefed.build.BootstrapBuildProvider" />
<!-- Some target preparation, disabled by default -->
<target_preparer class="com.android.tradefed.targetprep.PreloadedClassesPreparer">
<option name="disable" value="true" />
</target_preparer>
<!-- One test running some unit tests -->
<test class="com.android.tradefed.testtype.HostTest">
<option name="class" value="com.android.tradefed.build.BuildInfoTest" />
</test>
</configuration>
Will result in:
IConfiguration#getBuildProvider()
to return a BootstrapBuildProvider
instance.
IConfiguration#getTargetPreparers()
to return a list of ITargetPreparer
containing an instance of PreloadedClassesPreparer
.
IConfiguration#getTests()
to return a list of IRemoteTest
containing an
instance of HostTest
.
Every single object in the configuration object can be mapped to the XML
definition, so understanding the XML definition usually helps to understand
what to expect from the configuration object.
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-06-18 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-06-18 UTC."],[],[],null,["# Tradefed configuration object\n\n[Tradefed XML configuration](/docs/core/tests/tradefed/architecture/xml-config)\nis parsed, and a `Configuration` object is created from it that describes the\ncomplete configuration.\n\nThe object is described by the\n[IConfiguration interface.](https://android.googlesource.com/platform/tools/tradefederation/+/refs/heads/android16-release/src/com/android/tradefed/config/IConfiguration.java)\nit will contain an instance of all the objects defined in the XML.\n\nThis example: \n\n \u003cconfiguration description=\"\u003cdescription of the configuration\u003e\"\u003e\n \u003c!-- A build provider that takes local device information --\u003e\n \u003cbuild_provider class=\"com.android.tradefed.build.BootstrapBuildProvider\" /\u003e\n\n \u003c!-- Some target preparation, disabled by default --\u003e\n \u003ctarget_preparer class=\"com.android.tradefed.targetprep.PreloadedClassesPreparer\"\u003e\n \u003coption name=\"disable\" value=\"true\" /\u003e\n \u003c/target_preparer\u003e\n\n \u003c!-- One test running some unit tests --\u003e\n \u003ctest class=\"com.android.tradefed.testtype.HostTest\"\u003e\n \u003coption name=\"class\" value=\"com.android.tradefed.build.BuildInfoTest\" /\u003e\n \u003c/test\u003e\n \u003c/configuration\u003e\n\nWill result in:\n\n- `IConfiguration#getBuildProvider()` to return a `BootstrapBuildProvider` instance.\n- `IConfiguration#getTargetPreparers()` to return a list of `ITargetPreparer` containing an instance of `PreloadedClassesPreparer`.\n- `IConfiguration#getTests()` to return a list of `IRemoteTest` containing an instance of `HostTest`.\n\nEvery single object in the configuration object can be mapped to the XML\ndefinition, so understanding the XML definition usually helps to understand\nwhat to expect from the configuration object."]]