Appium Unhandled rejection Error: Error executing adbExec

Test_y · June 15, 2018 · Last by Sutune replied at January 07, 2019 · 2444 hits
  • python3.6 + appium 1.8.1
    • win 10 64
    • java 8
    • vivo 手机

是通过命令行方式启动 appium -a 127.0.0.1 -p 4723 -U 序列号 --session-override
不是通过客户端

from appium import webdriver

desired_caps = {
'platformName': 'Android',
'platformVersion': '7.1.2',
'deviceName': 'vivo',
'appPackage': 'com.android.bbkcalculator',
'appActivity': '.Calculator',
"noReset": True,
'newCommandTimeout': 30,
"resetKeyboard": True,
"noSign": True
}

driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
driver.find_element_by_id('com.android.bbkcalculator:id/digit1').click()
driver.find_element_by_id('com.android.bbkcalculator:id/plus').click()
driver.find_element_by_id('com.android.bbkcalculator:id/digit1').click()
driver.find_element_by_id('com.android.bbkcalculator:id/equal').click()
driver.close_app()

错误信息如下

Unhandled rejection Error: Error executing adbExec. Original error: 'Command 'D:\test\android-sdk\platform-tools\adb.exe -P 5037 -s 2d4fac41 shell input keyevent 3' exited with code 4294967177'; Stderr: ''; Code: '4294967177'
at ADB.execFunc$ (D:\test\nodejs\node_default\node_modules\appium\node_modules\appium-adb\lib\tools\system-calls.js:317:13)
at tryCatch (D:\test\nodejs\node_default\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as throw
at GeneratorFunctionPrototype.invoke (D:\test\nodejs\node_default\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
at

不是很懂新版的appium
😢

共收到 5 条回复 时间 点赞

手动执行下D:\test\android-sdk\platform-tools\adb.exe -P 5037 -s 2d4fac41 shell input keyevent 3看有啥错误呢?

Test_y #2 · June 15, 2018 作者
雨夜狂奔 回复

没反应欸

Test_y #3 · June 15, 2018 作者

如果吧driver.close_app()改为driver.quit()
变成如下错误

An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command 'D:\test\android-sdk\platform-tools\adb.exe -P 5037 -s 2d4fac41 shell input keyevent 3' exited with code 4294967177'; Stderr: ''; Code: '4294967177'

打开手机设置中开发者选项-USB模拟点击,如果无法开启,退出vivo账号,重新登录即可。

yszj 回复

非常感谢,亲测有效!

需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up