Exemplo n.º 1
0
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()
Exemplo n.º 2
0
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)
Exemplo n.º 3
0
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)
Exemplo n.º 4
0
def main_process():
    devices = Fun.devices_list_with_connection_check()
    for dev in devices:
        Thread(target=collect_dump_info, args=(dev, )).start()
Exemplo n.º 5
0
from multiprocessing import freeze_support
Exemplo n.º 6
0
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')
Exemplo n.º 7
0
import sys