poco.drivers.unity3d.unity3d_poco module

class UnityPoco(addr=('localhost', 5001), unity_editor=False, connect_default_device=True, device=None, **options)[源代码]

基类:StdPoco

Poco Unity3D implementation.

参数:
  • addr (tuple) – the endpoint of your Unity3D game, default to ("localhost", 5001)

  • unity_editor (bool) – whether your Unity3D game is running in UnityEditor or not. default to False

  • connect_default_device (bool) – whether connect to a default device if no devices selected manually. default to True. device (Device): airtest.core.device.Device instance provided by airtest. leave the parameter default and the default device will be chosen. more details refer to airtest doc

  • options – see poco.pocofw.Poco

示例

If your game is running on Android, you could initialize poco instance by using following snippet:

from poco.drivers.unity3d import UnityPoco

# your phone and your PC/mac should be inside the same sub-net.
ip = '<ip address of your phone>'
poco = UnityPoco((ip, 5001))
poco('button').click()
...