# -*- coding: UTF-8 -*- import os,time,sys from useriface import device from useriface import logger from useriface import hostpc from datetime import datetime from sendemail_attach_import import Sendmail import multiprocessing #SN = '192.168.40.133:5555' SN = '0123456789ABCDEF' dev = device.Device(SN) ui = dev.uidevice pc = hostpc.Host(SN) log = logger.Logger(__file__) def Logfile(): curtime0 = datetime.now().strftime('%Y%m%d_%H%M%S') global file1 file1 = curtime0 +'_camera.log' log1 = log.addLog2file(file1) #待机唤醒,进入applist,打开相机,拍照,进入图库,删除刚刚拍摄的照片,返回Home,待机 def WatcherRun():
# -*- encoding: UTF-8 -*- from useriface import device from useriface import hostpc from useriface import logger import time,os SN='0123456789ABCDEF' IP='192.168.40.185' device = device.Device(SN) daros = device.daros.connect(IP) log = logger.Logger(__file__) pc = hostpc.Host(SN) log.addLog2file('daros.txt') def DisableApks(path='/system/priv-app/'): for apks in ['RooboBoot','RooboDarosService']: findapk = os.popen("adb -s " + SN + " shell ls " + path + apks + "/").read() if findapk.find(apks + ".apk") != -1: os.popen("adb -s " + SN + " shell mv " + path + apks + "/" + apks + ".apk " + path + apks + "/" + apks) log.info("mv apks: " + path + apks + "/" + apks + ".apk")
# -*- encoding: UTF-8 -*- import os, sys, time from datetime import datetime from useriface import device from useriface import hostpc from useriface import logger import multiprocessing sn = 'testmode' #sn = '50a99b07' dev = device.Device(sn) ui = dev.uidevice pc = hostpc.Host(sn) log = logger.Logger(__file__) log.addLog2file('8909_wifi_ping.log') count = 60 on = ui(packageName='com.android.settings', text=u'关闭') off = ui(packageName='com.android.settings', text=u'开启') def Gowifi(): log.info("open settings") os.popen("adb -s " + sn + " shell am start com.android.settings/.Settings") time.sleep(5)
songs = ['kbkb.wav'] volume = ['11500'] exl = ['conbow.xlsx'] for an in ['0', '-30', '30', '-45', '45', '-90', '90', '-150', '150']: myprint("******* test angel: %s" % an) for i in range(0, len(exl)): d.setExcel(pathE + exl[i]) os.system('nircmd setsysvolume ' + volume[i]) for j in range(1, 101): myprint("==================== test wake up time: " + str(j)) d.playSound(pm + songs[i]) time.sleep(4.5) angle() moto(an, 1) time.sleep(1) d.stop() if __name__ == '__main__': dev = device.Device(device_list) lgcxdish.start() lgcall.start() lgcall.startCap() for y in range(1, testtime): myprint("================= " + curtime + " ; testtimes: " + str(y) + " =================") dev.startActivity(component='com.android.music/.MediaPlaybackActivity') test_hd_wake(y) lgcall.stopCap()