Appium 关于 appium 的 driver.unlockDevice () 函数报错

战 神 · November 20, 2017 · Last by kong replied at July 11, 2019 · 1092 hits

在真机上执行用例,setUp之后,想试试unlockDevice这个函数的使用方式,但实际使用情况如下:
会执行解锁操作,但随后appium server会持续报错,无限循环执行解锁动作,未执行用例与安装APP,以为是权限问题但当我把unlock app权限全部允许之后,
同样未得到解决。
报错信息如下:

[ADB] Error: Error occured while starting App. Original error: Error executing adbExec. Original error: 
'Command 'C\:\\Users\\Administrator\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe -P 5037
-s 0715f7bdaaec1938 shell am start -W -n io.appium.unlock/.Unlock -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000' timed out after 20000ms'; Stderr: ''; Code: 'null'
at Object.wrappedLogger.errorAndThrow (C:\Users\Administrator\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-support\lib\logging.js:63:13)
at ADB.callee$0$0$ (C:\Users\Administrator\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-adb\lib\tools\apk-utils.js:101:9)
at tryCatch (C:\Users\Administrator\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\Administrator\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (C:\Users\Administrator\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (C:\Users\Administrator\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
Error: Error occured while starting App. Original error: Error executing adbExec. Original error:
'Command 'C\:\\Users\\Administrator\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe -P 5037 -s 0715f7bdaaec1938 shell am start -W -n io.appium.unlock/.Unlock -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000'
timed out after 20000ms'; Stderr: ''; Code: 'null'
at Object.wrappedLogger.errorAndThrow (C:\Users\Administrator\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-support\lib\logging.js:63:13)
at ADB.callee$0$0$ (C:\Users\Administrator\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-adb\lib\tools\apk-utils.js:101:9)
at tryCatch (C:\Users\Administrator\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\Administrator\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (C:\Users\Administrator\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (C:\Users\Administrator\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)

是否有同学遇到过这种现象,欢迎交流

共收到 3 条回复 时间 点赞

同遇到,没解决

cheng 回复

在某些手机上出现这个问题, 真是很蛋疼。。。。只能通过不息屏来解决了

请问楼主的问题解决了吗?我通过pybot命令运行脚本,无限循环执行解锁动作,一直无法解决

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