Effective in 2026, to align with our trunk stable development model and ensure platform stability for the ecosystem, we will publish source code to AOSP in Q2 and Q4. For building and contributing to AOSP, we recommend utilizing android-latest-release instead of aosp-main. The android-latest-release manifest branch will always reference the most recent release pushed to AOSP. For more information, see Changes to AOSP.
Device allocation in Tradefed
Stay organized with collections
Save and categorize content based on your preferences.
When starting a test (for example, an instrumentation test), it might need a
device to be able to run properly. Or the test (such as some Java unit tests)
might not need a device at all. Still others or might even need multi-devices
(like phone + watch tests). In all those cases, the Device Manager is
responsible for allocating the required devices to the test so it runs
properly. We call this phase the device allocation or device selection step.
The allocation is driven by
DeviceSelectionOptions
that allow a test to declare any properties it needs from a device, including:
- Battery level
- Device type
- Product type
- Serial number
Use real devices
This is the default setting that will be allocated to all tests that don't
specify any device properties. A physical random device marked
AVAILABLE
will be picked and assigned to the test.
Use no devices
When no devices are needed by the test, it can specify --null-device or -n
on its command line, or <option name="null-device" value="true" /> in its
configuration XML. This allocates a stub placeholder NullDevice that
represents no device was allocated.
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-12-02 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-12-02 UTC."],[],[]]