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 2024-08-28 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2024-08-28 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 2024-08-28 UTC."]]