poco.drivers.unity3d.unity3d_poco module
- class UnityPoco(addr=('localhost', 5001), unity_editor=False, connect_default_device=True, device=None, **options)[source]
Bases:
StdPocoPoco Unity3D implementation.
- Parameters:
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 toFalseconnect_default_device (
bool) – whether connect to a default device if no devices selected manually. default toTrue. device (Device):airtest.core.device.Deviceinstance provided byairtest. leave the parameter default and the default device will be chosen. more details refer toairtest docoptions – see
poco.pocofw.Poco
Examples
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() ...