This a python util allows you to reserve and release any STF device
STF project and api document are avaliable from below:
*STF github: https://github.com/openstf/stf
*STF API: https://github.com/openstf/stf/blob/master/doc/API.md
According to STF API, you need get token firstly. If you don't know how to get token, please refer to Authentication.
#coding: utf-8
from stf_tools import STF
# Your STF's url, like: https://stf.example.org
STF_URL = ""
Get all the devices information on the STF
serial = 'NX529J'
token = 'xx-xxx-xx'
stf = STF(token)
devices = stf.devices()
print devices
Get specific devices information on the STF
device_info = stf.device(serial)
print device_info['remoteConnectUrl']
Use a device. This is analogous to pressing "Use" in the UI.
stf.use_device(serial)
Retrieve the remote debug URL
remote_connect_url = stf.connect_device(serial)
print remote_connect_url
Disconnect a remote debugging session.
stf.disconnect_device(serial)
Stop use device. This is analogous to pressing "Stop using" in the UI.
stf.stop_use_device(serial)