List Devices
Use this method to discover the devices that the authenticated account can access. The result contains device records, not reservations. Create an allocation before starting a test.
This method can answer questions such as:
- Which devices belong to one pool?
- Is a known serial visible?
- Which Android or iOS devices match the test?
- What state and platform version does each visible device report?
SDK Method
Java | Node.js | Returns |
|---|---|---|
client.devices().list(request) | await client.devices().list(request?) | PageDto<Device> |
Node.js allows the request to be omitted. Java uses ListDevicesRequest.builder().build() for defaults.
Request Fields
Builder method | Type | Default | Description |
|---|---|---|---|
.page(value) | integer | 0 | Zero-based page index |
.size(value) | integer | 20 | Maximum records requested for the page |
.sortBy(value) | string | ID | Server-side sort field |
.direction(value) | SortDirection | DESC | ASC or DESC |
.addFilter(key, value, operation) | filter rule | None | Adds one server-side filter rule |
.filters(rules) | filter array | Empty | Replaces the complete filter list |
page(1) requests the second page, not the first.
Available Device Filters
Purpose | Node.js constant | Java constant | Value |
|---|---|---|---|
Devices in one pool | DeviceFilter.POOL_ID | DeviceFilter.POOL_ID | Pool id string |
Exact serial | DeviceFilter.SERIAL_NUMBER | DeviceFilter.SERIAL_NUMBER | Device serial |
Marketing name | DeviceFilter.MARKETING_NAME | DeviceFilter.MARKETING_NAME | Display name |
Manufacturer | DeviceFilter.MANUFACTURER | DeviceFilter.MENUFACTURER | Manufacturer name |
Model | DeviceFilter.MODEL_NAME | DeviceFilter.MODEL_NAME | Model name |
Platform | DeviceFilter.PLATFORM | DeviceFilter.PLATFORM | Platform string |
OS version | DeviceFilter.OS_VERSION | DeviceFilter.OS_VERSION | Version string |
Tag | DeviceFilter.TAGS | DeviceFilter.TAGS | Tag name |
Device state | DeviceFilter.STATE | DeviceFilter.STATE | One of the Device Park state constants below |
The Java MENUFACTURER spelling is part of the published enum. Use that exact spelling in Java; Node.js uses MANUFACTURER.
Available operations are EQUAL, NOT_EQUAL, GREATER_THAN and LESS_THAN. Use EQUAL for identifiers, platform, tags and other exact string matches.
Device State Values
Pass the API value in the Filter value column to DeviceFilter.STATE. The display status is the category normally shown in the Device Park interface; it is not the filter value.
Filter value | Display status | Meaning |
|---|---|---|
INIT | Offline | Device has connected and is initializing |
PREPARING | Preparing | Device is being prepared, updated or cleaned after a session |
WAIT_FOR_ACTION | Offline | Device is waiting for a required action, such as assigning an iOS certificate |
HEALTHY | Online | Device is operational and available for allocation |
ALLOCATED | Busy | Device is allocated but its session has not started |
RUNNING | Busy | Device has an active session |
OFFLINE | Offline | Device is not ready to accept a session or was not reported by its hub |
For example, use HEALTHY, not Online, to request allocatable devices:
DeviceFilterRequest filterRequest = DeviceFilterRequest.of(
DeviceFilter.STATE,
"HEALTHY",
SearchOperation.EQUAL
);
ListDevicesRequest request = ListDevicesRequest.builder()
.filters(Collections.singletonList(filterRequest))
.page(0)
.size(20)
.build();
PageDto<Device> devices = client.devices().list(request);Example Values for Device Fields
Device property filters use the values returned by the Device Park API. They are exact strings when used with EQUAL; preserve their spelling and case.
Filter | Example value | Matches |
|---|---|---|
SERIAL_NUMBER | 7TCASGP78XC6C64X | serial |
MARKETING_NAME | Redmi 13T Pro | marketName |
MANUFACTURER / Java MENUFACTURER | Xiaomi | manufacturer |
MODEL_NAME | 23078PND5G | model |
PLATFORM | android | platform |
OS_VERSION | 15 | Operating-system version |
TAGS | Your exact tag name | A tag assigned to the device |
POOL_ID | Your pool id | A pool containing the device |
Filter by Pool
You do not need to list every device and filter it in application code. Add DeviceFilter.POOL_ID to the Java or Node.js request:
import {
DeviceFilter,
type DeviceFilterRequest,
ListDevicesRequestBuilder,
SearchOperation
} from "@device-park/public-sdk";
const filterRequest: DeviceFilterRequest = {
key: DeviceFilter.POOL_ID,
value: "pool-123",
operation: SearchOperation.EQUAL
};
const devices = await client.devices().list(
new ListDevicesRequestBuilder()
.filters([filterRequest])
.page(0)
.size(10)
.build()
);Both SDKs send the filter as request query data:
filters[0].key=devicePools.id
filters[0].value=pool-123
filters[0].operation=EQUAL
sorting.page=0
sorting.size=10The list operation has no request body. OAuth authorization is added by the SDK client; callers do not supply request headers to list(...).
The equivalent Java request is:
DeviceFilterRequest filterRequest = DeviceFilterRequest.of(
DeviceFilter.POOL_ID,
"pool-123",
SearchOperation.EQUAL
);
ListDevicesRequest request = ListDevicesRequest.builder()
.filters(Collections.singletonList(filterRequest))
.page(0)
.size(10)
.build();
PageDto<Device> devices = client.devices().list(request);List Without Filters
PageDto<Device> devices = client.devices().list(
ListDevicesRequest.builder()
.page(0)
.size(20)
.build()
);
devices.data().forEach(device ->
System.out.println(device.serial() + " - " + device.state()));Response Model
The method returns PageDto<Device>.
Field | Type | Nullable | Meaning |
|---|---|---|---|
id | number | Yes | Internal device identifier |
serial | string | Yes | Identifier used for exact allocation and device lookup |
marketName | string | Yes | Customer-facing device name |
model | string | Yes | Hardware model |
manufacturer | string | Yes | Device manufacturer |
platform | string | Yes | Android or iOS platform value |
platformVersion | string | Yes | Operating-system version |
version | string | Yes | Additional server-provided version value |
state | string | Yes | Current Device Park state; see Device State Values |
isSimulator | boolean | Yes | Whether the record represents a simulator |
isPublic | boolean | Yes | Whether the device is publicly visible |
{
"size": 10,
"page": 0,
"totalPages": 1,
"totalElements": 1,
"data": [
{
"id": 19027,
"serial": "7TCASGP78XC6C64X",
"marketName": "Redmi 13T Pro",
"model": "23078PND5G",
"manufacturer": "Xiaomi",
"platform": "android",
"platformVersion": "15",
"version": "1.9",
"state": "HEALTHY",
"isSimulator": false,
"isPublic": false
}
]
}An empty data array is a successful response with no visible or matching devices. Confirm credentials, environment and filter values before treating it as an SDK failure.
Next Steps
- List pools