poco.drivers.std package
- class StdPoco(port=15004, device=None, use_airtest_input=True, ip=None, **kwargs)[source]
Bases:
Poco
Poco standard implementation for PocoSDK protocol.
- Parameters:
port (
int
) – the port number of the server that listens on the target device. default to 15004.device (
Device
) –airtest.core.device.Device
instance provided byairtest
. leave the parameter default and the default device will be chosen. more details refer toairtest doc
options – see
poco.pocofw.Poco
Examples
The simplest way to connect to a cocos2dx-lua game:
from poco.drivers.std import StdPoco from airtest.core.api import connect_device # connect a device first, then initialize poco object device = connect_device('Android:///') poco = StdPoco(10054, device) # or use ip:port to initialize poco object poco = StdPoco(port=10054, ip='xx.xx.xx.xx') # now you can play with poco ui = poco('...') ui.click() ...
- class StdPocoAgent(addr=('localhost', 15004), use_airtest_input=True)[source]
Bases:
PocoAgent
- get_sdk_version()[source]
Retrieve the sdk version from remote runtime. Each poco agent implementation should override this method.
- Returns:
version string of the poco sdk. usually in “0.0.0” format. None if not provided by poco sdk.
- Return type:
str
- property rpc
Return the interface of this agent handled.
- Returns:
the rpc interface of this agent handled.
- Return type:
object
- Raises:
NotImplementedError – raises if the agent implementation dose not expose the rpc interface to user.