在真机上执行用例,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)

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


↙↙↙阅读原文可查看相关链接,并与作者交流