def get_uiautomator(): if get_uiautomator.instance: return get_uiautomator.instance else: port=_init() get_uiautomator.instance = AutomatorDevice(None, port, os.environ.get("PLATFORM_IP", "127.0.0.1"), None) return get_uiautomator.instance
def __init__(self, serial, _package_name, _activity, ui_device=AutomatorDevice()): super(CloudDevice, self).__init__(serial, _package_name, ui_device) self.package_name = _package_name self.launch_activity = _activity self.pid = None self.timeout = 3000 self.platform_client = platform.get_platform_client()