在用脚本启动 app 时,
console 打出的错误是:

selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: Command '/usr/local/android-sdk-macosx/platform-tools/adb -P xxxxx -s xxxxxxx shell ls /data/local/tmp/0001183aa4c4852a5fe987466c77d407.apk' exited with code 1{"stdout":"","stderr":"ls: /data/local/tmp/0001183aa4c4852a5fe987466c77d407.apk: No such file or directory\n","code":1}

appium 详细日志:

[MJSONWP] Encountered internal error running command: Error: Error executing adbExec. Original error: Command '/usr/local/android-sdk-macosx/platform-tools/adb -P xxx -s xxx shell ls /data/local/tmp/0001183aa4c4852a5fe987466c77d407.apk' exited with code 1{"stdout":"","stderr":"ls: /data/local/tmp/0001183aa4c4852a5fe987466c77d407.apk: No such file or directory\n","code":1}
    at ADB.execFunc$ (lib/tools/system-calls.js:189:13)
    at tryCatch (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
    at run (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:104:47)
    at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:115:28
    at flush (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/$.microtask.js:19:5)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

我不太理解,即使真机中不存在该 apk,应该会自动下载一个到真机上,而不是直接抛出该 apk 不存在。


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