poco.agent module

class PocoAgent(hierarchy, input, screen, command=None)[源代码]


This is the agent class for poco to communicate with target device.

This class is an aggregation of 4 major interfaces for now.

  • HierarchyInterface: defines the hierarchy accessibility methods such as dump(crawl the whole UI tree), getAttr(retrieve attribute value by name)
  • InputInterface: defines the simulated input methods to allow inject simulated input on target device
  • ScreenInterface: defines methods to access the screen surface
  • CommandInterface: defines methods to communicate with target device in arbitrary way. This is optional.

Return the driver of this agent related to. None if the driver is not ready to bind.

返回:the driver of this agent related to.
返回类型:inherit from Poco

Retrieve the sdk version from remote runtime. Each poco agent implementation should override this method.

返回:version string of the poco sdk. usually in “0.0.0” format. None if not provided by poco sdk.

Return the interface of this agent handled.

返回:the rpc interface of this agent handled.
Raises:NotImplementedError – raises if the agent implementation dose not expose the rpc interface to user.