Welcome to Clickpecker Device Manager’s documentation!¶
Launching¶
Use docker and docker-compose to launch the device manager:
docker-compose up -d --build
Device manager will be available from 127.0.0.1/5000.
Image building proccess may take a long time because of minicap and minitouch building.
API Reference¶
-
POST/acquire¶ Find device by the given filter and make it unavailable for other clients to acquire.
Request JSON Object: - filters (dict) – filters to find necessary device, see Filtering
Status Codes: - 200 OK – Device successfully acquired
- 400 Bad Request – Invalid request body
- 404 Not Found – No suitable device found
- 409 Conflict – All suitable devices are locked by another clients
- 500 Internal Server Error – Internal server error
Returns: JSON with device specifications (as in
list_devices()) or error descriptionUnsuccessfull response example:
HTTP/1.0 404 NOT FOUND Content-Length: 28 Content-Type: application/json { "error": "No such devices" }
-
POST/release¶ Release acquired device.
It’s highly recommended to store ADB ID of acquiring device and use it for releasing.
Request JSON Object: - filters (dict) – filters to find the necessary device, see Filtering
Status Codes: - 200 OK – Device successfully released (or not found / unplugged from host machine)
- 400 Bad Request – Invalid request body
- 500 Internal Server Error – Internal server error
-
GET/¶ Return list of available devices.
Example response:
HTTP/1.0 200 OK Content-Length: 200 Content-Type: application/json [ { "adb_id": "BL4B22D10786", "android_version": "4.4.4", "device_name": "D2203", "free": true, "minicap_port": 1111, "minitouch_port": 1112, "sdk_version": 19, "status": "device", "stf_address": null } ]
-
POST/¶ Return list of available devices.
Example response:
HTTP/1.0 200 OK Content-Length: 200 Content-Type: application/json [ { "adb_id": "BL4B22D10786", "android_version": "4.4.4", "device_name": "D2203", "free": true, "minicap_port": 1111, "minitouch_port": 1112, "sdk_version": 19, "status": "device", "stf_address": null } ]
Filtering¶
Clickpecker Device Manager allows to find specific device by filters.
POST request to /, /acquire, /release endpoints should contain
JSON object with "filters" object inside.
Example:
{
"filters": {
"android_version__gt": "4.2.0",
"android_version__le": "7.1.1"
}
}
This filter will find devices with Android version > 4.2.0 and <= 7.1.1.
Filters support all fields returned by GET /, and standard Python comparsion
operators eq, lt, gt, le, ge. Operators should be divided from
fields by double underline as in example above. If operator is omitted, eq will
be used.
Configuration¶
Some Device Manager’s parameters can be configured via configs/device_manager.conf.
- start_port, max_devices
- Specifies the range
[sart_port; start_port + 2 * max_devices]of available ports. - minicap_root, minitouch_root
- Specifies path to minicap and minitouch binaries.
- whitelist_devices, blacklist_devices
- If
whitelistis not empty, only devices with specified ADB ID will be available.blacklistwill be ignored. - If
whitelistis empty, devices with ADB ID, specified inblacklistwill be unavailable. - If both lists are empty, all connected devices will be available.
- If