APPIUMsend_keys输入太慢?用adb可以提升很大速度

161 阅读1分钟

appium输入过慢,采用adb方式

def fast_input(str,element):
    '快速输入'
    x = subprocess.check_output('adb devices', shell=True).split('\n')[1][:-7]
    element.click()
    time.sleep(0.3)
    subprocess.Popen('adb -s %s shell input text %s'%(x,str), shell=True)
    time.sleep(0.5)