λ yarn wdio wdio.conf.js
yarn run v1.10.0
$ d:\work\wagons\src\WagonsFrontapp\node_modules\.bin\wdio wdio.conf.js
A service failed in the 'onPrepare' hook
Error: Appium exited before timeout (Exit code: 2)
at ChildProcess.exitCallback (d:\work\wagons\src\WagonsFrontapp\node_modules\wdio-appium-service\build\launcher.js:94:28)
at Object.onceWrapper (events.js:317:30)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
Continue...
[16:48:43] COMMAND POST "/wd/hub/session"
[16:48:43] DATA {"desiredCapabilities":{"javascriptEnabled":true,"locationContextEnabled":true,"handlesAlerts":true,"rotatable":true,"maxInstances":1,"platformName":"Android","platformVersion":"8.0","deviceName":"Android Emulator","app":"d:\\work\\wagons\\src\\WagonsFrontapp/android/app/build/outputs/apk/app-stage.apk","autoGrantPermissions":true,"_":"2 more keys: [\"fullReset\",\"requestOrigins\"]"}}
ERROR: <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Error: EPIPE: broken pipe, write<br> at Socket._write (internal/net.js:23:7)<br> at doWrite (_stream_writable.js:396:12)<br> at writeOrBuffer (_stream_writable.js:382:5)<br> at Socket.Writable.write (_stream_writable.js:290:11)<br> at Socket.write (net.js:711:40)<br> at exports.Console.Console.log (D:\tool\scoop\persist\nodejs-lts\bin\node_modules\appium\node_modules\winston\lib\winston\transports\console.js:121:20)<br> at transportLog (D:\tool\scoop\persist\nodejs-lts\bin\node_modules\appium\node_modules\winston\lib\winston\logger.js:234:15)<br> at D:\tool\scoop\persist\nodejs-lts\bin\node_modules\appium\node_modules\winston\node_modules\async\lib\async.js:157:13<br> at _each (D:\tool\scoop\persist\nodejs-lts\bin\node_modules\appium\node_modules\winston\node_modules\async\lib\async.js:57:9)<br> at Object.async.each (D:\tool\scoop\persist\nodejs-lts\bin\node_modules\appium\node_modules\winston\node_modules\async\lib\async.js:156:9)<br> at exports.Logger.Logger.log (D:\tool\scoop\persist\nodejs-lts\bin\node_modules\appium\node_modules\winston\lib\winston\logger.js:246:9)<br> at exports.Logger.target.(anonymous function) [as info] (D:\tool\scoop\persist\nodejs-lts\bin\node_modules\appium\node_modules\winston\lib\winston\common.js:54:18)<br> at EventEmitter.<anonymous> (D:\tool\scoop\persist\nodejs-lts\bin\node_modules\appium\lib\logsink.js:197:22)<br> at emitOne (events.js:116:13)<br> at EventEmitter.emit (events.js:211:7)<br> at EventEmitter.<anonymous> (D:\tool\scoop\persist\nodejs-lts\bin\node_modules\appium\node_modules\npmlog\log.js:202:8)<br> at EventEmitter.<anonymous> (D:\tool\scoop\persist\nodejs-lts\bin\node_modules\appium\node_modules\npmlog\log.js:286:23)<br> at Object.wrappedLogger.(anonymous function) [as info] (D:\tool\scoop\persist\nodejs-lts\bin\node_modules\appium\node_modules\appium-support\lib\logging.js:69:24)<br> at startLogFormatter.immediate (D:\tool\scoop\persist\nodejs-lts\bin\node_modules\appium\node_modules\appium-base-driver\lib\express\express-logging.js:50:7)<br> at logRequest (D:\tool\scoop\persist\nodejs-lts\bin\node_modules\appium\node_modules\morgan\index.js:122:18)<br> at logger (D:\tool\scoop\persist\nodejs-lts\bin\node_modules\appium\node_modules\morgan\index.js:135:7)<br> at Layer.handle [as handle_request] (D:\tool\scoop\persist\nodejs-lts\bin\node_modules\appium\node_modules\express\lib\router\layer.js:95:5)<br> at trim_prefix (D:\tool\scoop\persist\nodejs-lts\bin\node_modules\appium\node_modules\express\lib\router\index.js:317:13)<br> at D:\tool\scoop\persist\nodejs-lts\bin\node_modules\appium\node_modules\express\lib\router\index.js:284:7<br> at Function.process_params (D:\tool\scoop\persist\nodejs-lts\bin\node_modules\appium\node_modules\express\lib\router\index.js:335:12)<br> at next (D:\tool\scoop\persist\nodejs-lts\bin\node_modules\appium\node_modules\express\lib\router\index.js:275:10)<br> at D:\tool\scoop\persist\nodejs-lts\bin\node_modules\appium\node_modules\body-parser\lib\read.js:130:5<br> at invokeCallback (D:\tool\scoop\persist\nodejs-lts\bin\node_modules\appium\node_modules\raw-body\index.js:224:16)<br> at done (D:\tool\scoop\persist\nodejs-lts\bin\node_modules\appium\node_modules\raw-body\index.js:213:7)<br> at IncomingMessage.onEnd (D:\tool\scoop\persist\nodejs-lts\bin\node_modules\appium\node_modules\raw-body\index.js:273:7)<br> at emitNone (events.js:106:13)<br> at IncomingMessage.emit (events.js:208:7)<br> at endReadableNT (_stream_readable.js:1064:12)<br> at _combinedTickCallback (internal/process/next_tick.js:139:11)<br> at process._tickCallback (internal/process/next_tick.js:181:9)</pre></body>
</html>
androidemulator.android.8_0.app-stage_apk
at new RuntimeError (d:\work\wagons\src\WagonsFrontapp\node_modules\webdriverio\build\lib\utils\ErrorHandler.js:143:12)
at Request._callback (d:\work\wagons\src\WagonsFrontapp\node_modules\webdriverio\build\lib\utils\RequestHandler.js:300:39)
at Request.self.callback (d:\work\wagons\src\WagonsFrontapp\node_modules\request\request.js:186:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request.<anonymous> (d:\work\wagons\src\WagonsFrontapp\node_modules\request\request.js:1163:10)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at IncomingMessage.<anonymous> (d:\work\wagons\src\WagonsFrontapp\node_modules\request\request.js:1085:12)
at Object.onceWrapper (events.js:313:30)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I think the reason is the last appium instance is still running from the last test, and then it cannot be started again, because the port had been used.
Otherwise it will report this error:
I think the reason is the last appium instance is still running from the last test, and then it cannot be started again, because the port had been used.