To learn more about using JavaScript in LeanFT, see Setting up and working with the JavaScript SDK.
For JavaScript code samples, see Code Samples - JavaScript.

Lab

Mobile. Lab

new Lab()

The Mobile Center lab, where you manage users, applications, and devices.

Methods

getConfig() → {Promise.<Mobile.MobileCenterConfiguration>}

Returns the MobileCenter connection configuration.
Returns:
a promise that is fulfilled with the Mobile Center connection configuration.
Type
Promise.<Mobile.MobileCenterConfiguration>

getDeviceList() → {Promise.<Array.<Mobile.DeviceInfo>>}

Returns an array of device information describing all the devices in the Mobile Center lab. The device information can be passed to the lockDeviceByInfo function in order to lock the appropriate device.
Returns:
a promise that is fulfilled with an array of device information describing all the devices in the Mobile Center lab.
Type
Promise.<Array.<Mobile.DeviceInfo>>

getDevicesWithOpenViewers() → {Promise.<Mobile.DeviceTO>}

Returns a list of all devices with an open viewer.
Returns:
a promise that is fulfilled with the list of all devices with an open viewer.
Type
Promise.<Mobile.DeviceTO>

lockDevice(description, appsToInstallopt, deviceSourceopt) → {Promise.<Mobile.DeviceTO>}

Obtains a device from the Mobile Center lab and locks it, so that only LeanFT can perform actions on it.
Parameters:
Name Type Attributes Description
description Mobile.Device The description of the device.
appsToInstall Array.<Mobile.Application> <optional>
An Application array of applications to install on the device.
deviceSource Array.<Mobile.Device.DeviceSource> <optional>
The source location of the device. You can use the DeviceSource object or just pass 'mobile_center', 'amazon_device_farm' or 'any' as a string.
Returns:
a promise that is fulfilled with the locked device.
Type
Promise.<Mobile.DeviceTO>

lockDeviceById(deviceID) → {Promise.<Mobile.DeviceTO>}

Obtains a device from the Mobile Center lab by deviceID and locks it, so that only LeanFT can perform actions on it.
Parameters:
Name Type Description
deviceID string The device ID used by Mobile Center.
Returns:
a promise that is fulfilled with the locked device.
Type
Promise.<Mobile.DeviceTO>

lockDeviceByInfo(deviceInfo) → {Promise.<Mobile.DeviceTO>}

Obtains a device from the Mobile Center lab by device information and locks it, so that only LeanFT can perform actions on it.
Note: The device information is the structure returned by the getDeviceList function.
Parameters:
Name Type Description
deviceInfo Mobile.DeviceInfo The device information of the device to lock.
Returns:
a promise that is fulfilled with the locked device.
Type
Promise.<Mobile.DeviceTO>

lockDeviceByName(deviceName) → {Promise.<Mobile.DeviceTO>}

Obtains a device from the Mobile Center lab by device name and locks it, so that only LeanFT can perform actions on it.
Parameters:
Name Type Description
deviceName string The logical name that Mobile Center uses to identify the device.
Returns:
a promise that is fulfilled with the locked device.
Type
Promise.<Mobile.DeviceTO>