From 1111d181f9f81884e51177810cc840833ce1f4ac Mon Sep 17 00:00:00 2001 From: Diego Torres Milano Date: Tue, 24 May 2022 21:26:21 -0700 Subject: [PATCH] Add example --- .../start-activity-ui-automator-helper.py | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 examples/start-activity-ui-automator-helper.py diff --git a/examples/start-activity-ui-automator-helper.py b/examples/start-activity-ui-automator-helper.py new file mode 100755 index 00000000..fd8e4000 --- /dev/null +++ b/examples/start-activity-ui-automator-helper.py @@ -0,0 +1,25 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +Copyright (C) 2013-2022 Diego Torres Milano +Created on 2022-05-24 by Culebra v21.4.2 + __ __ __ __ + / \ / \ / \ / \ +____________________/ __\/ __\/ __\/ __\_____________________________ +___________________/ /__/ /__/ /__/ /________________________________ + | / \ / \ / \ / \ \___ + |/ \_/ \_/ \_/ \ o \ + \_____/--< +@author: Diego Torres Milano +@author: Jennifer E. Swofford (ascii art snake) +""" + +from com.dtmilano.android.viewclient import ViewClient + +device, serialno = ViewClient.connectToDeviceOrExit() + +kwargs2 = {'useuiautomatorhelper': True} +vc = ViewClient(device, serialno, **kwargs2) + +vc.uiAutomatorHelper.target_context.start_activity('com.android.chrome', 'com.google.android.apps.chrome.Main', + uri='https://google.com')