List Devices
4 min
use this method to see the devices that your credentials are allowed to use the result helps you choose an exact device serial before creating an allocation before you begin install the sdk and create an authenticated client decide whether the test needs one exact device or any device from a pool use pagination when the account can access many devices sdk method java node js client devices() list(request) await client devices() list(request?) the request is optional in node js java uses listdevicesrequest builder() build() for default values examples pagedto\<device> devices = client devices() list( listdevicesrequest builder() page(0) size(20) build() ); devices data() foreach(device > system out println(device serial() + " " + device state()));import { listdevicesrequestbuilder } from "@devicepark/public sdk"; const devices = await client devices() list( new listdevicesrequestbuilder() page(0) size(20) build() ); for (const device of devices data) { console log(device serial, device state); } result pagedto\<device> contains pagination information and data important device fields field meaning serial device identifier used for an exact allocation marketname customer facing device name model hardware model manufacturer device manufacturer platform android or ios platformversion operating system version state current device park state issimulator whether the record represents a simulator ispublic whether the device is publicly visible an empty data array is a valid result confirm that the credentials belong to the correct environment and have device visibility listing a device does not reserve it the device state may change until an allocation is created next step use the selected serial in create allocation /allocations/create allocation if you already know the serial and need fresh details, use get device /devices/get device
