def main_process(cmd): devices = Fun.devices_list_with_connection_check() if len(devices) == 0: Fun.log('no device connected') sys.exit(2) for dev in devices: Thread(target=collect_dump_info, args=(dev, cmd)).start()
def click_test(): tags = FunCom.devices_list_with_connection_check() tag = tags[0] apk_files = FunPkg.get_apk_file_in_project() if len(apk_files) > 0: for f in apk_files: if str(f).endswith(Res.pgk_suffix): FunPkg.uninstall(tag, Res.pkg_name) FunPkg.install_r(tag, FunCom.get_abspath(f), True) break else: raise Exception( "no apk found in project '/apk' directory, put one at least") FunCom.serial_clicks_by_control_file(tag)
def battery_instrument_main(): FunCom.log('launch battery instrument ') x = 0 while True: for app_file in FunPkg.get_apk_file_in_project(): try: tag = FunCom.devices_list_with_connection_check()[0] FunCom.p_open(Res.adb_dump_battery_unplug(tag)) FunCom.send_key_home(tag) FunPkg.uninstall_and_install(tag, app_file, Res.pkg_name) FunCom.serial_clicks_by_control_file(tag) FunCom.sleep(20) perform_operations(tag, FunCom.get_device_uid(tag), x, app_file) x += 1 except Exception as e: FunCom.log(e)
def main_process(): devices = Fun.devices_list_with_connection_check() for dev in devices: Thread(target=collect_dump_info, args=(dev, )).start()
from multiprocessing import freeze_support
def swipe_test(): tags = FunCom.devices_list_with_connection_check() for tag in tags: FunCom.serial_operation_by_control_file(tag, '/case/%s.txt' % 'all_apps')
import sys