在 mac 上安装好了 STF 后, 启动服务一些正常,但是每次都会在过了一段时间后就服务挂掉,不知道有没有人有相同的情况。
在链接正常的情况下,插拔手机设备也会报错 server 挂掉。
由于是第一次接触 stf 对于其内部的工作原理不是很了解。

安装的环境如下:

testdeMac-mini:~ test$ stf doctor
2017-12-11T04:27:11.794Z INF/cli:doctor 1190 [*] OS Arch: x64
2017-12-11T04:27:11.796Z INF/cli:doctor 1190 [*] OS Platform: darwin
2017-12-11T04:27:11.797Z INF/cli:doctor 1190 [*] OS Platform: 17.2.0
2017-12-11T04:27:11.797Z INF/cli:doctor 1190 [*] Using Node 8.1.4
2017-12-11T04:27:11.816Z INF/cli:doctor 1190 [*] Using ZeroMQ 4.2.2
2017-12-11T04:27:11.838Z INF/cli:doctor 1190 [*] Using GraphicsMagick 1.3.26
2017-12-11T04:27:11.839Z INF/cli:doctor 1190 [*] Using ProtoBuf 3.5.0
2017-12-11T04:27:11.842Z INF/cli:doctor 1190 [*] Using RethinkDB 2.3.6
2017-12-11T04:27:11.843Z INF/cli:doctor 1190 [*] Using ADB 1.0.39

日志如下:

2017-12-11T03:32:00.025Z INF/provider 834 [*] Providing all 4 device(s)
2017-12-11T03:32:21.990Z INF/auth-mock 835 [::ffff:127.0.0.1] Authenticated "lllll@163.com"
2017-12-11T03:38:02.708Z IMP/device:plugins:service 844 [G2W7N15209049445] Agent connection ended, attempting to relaunch
2017-12-11T03:38:02.708Z INF/device:plugins:service 844 [G2W7N15209049445] Launching service
2017-12-11T03:38:02.709Z INF/provider 834 [*] Lost device "G2W7N15209049445" (device)
2017-12-11T03:38:02.710Z IMP/device:plugins:service 844 [G2W7N15209049445] Service connection ended, attempting to relaunch
2017-12-11T03:38:02.710Z INF/provider 834 [*] Shutting down device worker "G2W7N15209049445"
2017-12-11T03:38:02.710Z INF/device:plugins:service 844 [G2W7N15209049445] Launching service
2017-12-11T03:38:02.711Z WRN/device:plugins:touch 844 [G2W7N15209049445] Shell keeping minitouch running ended unexpectedly
2017-12-11T03:38:02.712Z INF/device:plugins:touch 844 [G2W7N15209049445] Disconnecting from minitouch service
2017-12-11T03:38:02.713Z INF/provider 834 [*] Cleaning up device worker "G2W7N15209049445"
2017-12-11T03:38:02.714Z INF/provider 834 [*] Gracefully killing device worker "G2W7N15209049445"
2017-12-11T03:38:02.717Z FTL/util:lifecycle 844 [G2W7N15209049445] Forward shell ended; we shall share its fate
2017-12-11T03:38:02.719Z FTL/util:lifecycle 844 [G2W7N15209049445] Shutting down due to fatal error
2017-12-11T03:38:02.733Z INF/provider 834 [*] Device worker "G2W7N15209049445" has retired
2017-12-11T03:38:03.053Z FTL/util:lifecycle 846 [5eb2b636] Forward shell ended; we shall share its fate
2017-12-11T03:38:03.054Z FTL/util:lifecycle 843 [0642f8d6f0ec9d1a] Forward shell ended; we shall share its fate
2017-12-11T03:38:03.053Z FTL/util:lifecycle 845 [C4Y5T16810004018] Forward shell ended; we shall share its fate
2017-12-11T03:38:03.054Z FTL/util:lifecycle 846 [5eb2b636] Shutting down due to fatal error
2017-12-11T03:38:03.054Z FTL/util:lifecycle 843 [0642f8d6f0ec9d1a] Shutting down due to fatal error
2017-12-11T03:38:03.054Z FTL/util:lifecycle 845 [C4Y5T16810004018] Shutting down due to fatal error
2017-12-11T03:38:03.058Z FTL/util:lifecycle 834 [*] Tracker had an error Error: Connection closed
    at /usr/local/lib/node_modules/stf/node_modules/.2.11.0@adbkit/lib/adb/tracker.js:21:13
    at tryCatcher (/usr/local/lib/node_modules/stf/node_modules/.2.9.34@bluebird/js/main/util.js:26:23)
    at CatchFilter.doFilter (/usr/local/lib/node_modules/stf/node_modules/.2.9.34@bluebird/js/main/catch_filter.js:40:36)
    at CatchFilter.tryCatcher (/usr/local/lib/node_modules/stf/node_modules/.2.9.34@bluebird/js/main/util.js:26:23)
    at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/stf/node_modules/.2.9.34@bluebird/js/main/promise.js:503:31)
    at Promise._settlePromiseAt (/usr/local/lib/node_modules/stf/node_modules/.2.9.34@bluebird/js/main/promise.js:577:18)
    at Promise._settlePromises (/usr/local/lib/node_modules/stf/node_modules/.2.9.34@bluebird/js/main/promise.js:693:14)
    at Async._drainQueue (/usr/local/lib/node_modules/stf/node_modules/.2.9.34@bluebird/js/main/async.js:123:16)
    at Async._drainQueues (/usr/local/lib/node_modules/stf/node_modules/.2.9.34@bluebird/js/main/async.js:133:10)
    at Immediate.Async.drainQueues (/usr/local/lib/node_modules/stf/node_modules/.2.9.34@bluebird/js/main/async.js:15:14)
    at runCallback (timers.js:800:20)
    at tryOnImmediate (timers.js:762:5)
    at processImmediate [as _immediateCallback] (timers.js:733:5)
2017-12-11T03:38:03.067Z FTL/util:lifecycle 834 [*] Shutting down due to fatal error
2017-12-11T03:38:03.075Z FTL/cli:local 827 [*] Child process had an error ExitError: Exit code "1"
    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/stf/lib/util/procutil.js:49:23)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:197:12)
2017-12-11T03:38:03.075Z INF/cli:local 827 [*] Shutting down all child processes
2017-12-11T03:38:03.079Z INF/util:lifecycle 829 [app001] Winding down for graceful exit
2017-12-11T03:38:03.080Z INF/util:lifecycle 830 [dev001] Winding down for graceful exit
2017-12-11T03:38:03.080Z INF/util:lifecycle 831 [proc001] Winding down for graceful exit
2017-12-11T03:38:03.083Z INF/util:lifecycle 832 [proc002] Winding down for graceful exit
2017-12-11T03:38:03.085Z INF/util:lifecycle 833 [reaper001] Winding down for graceful exit
2017-12-11T03:38:03.086Z INF/util:lifecycle 835 [*] Winding down for graceful exit
2017-12-11T03:38:03.086Z INF/auth-mock 835 [*] Waiting for client connections to end
2017-12-11T03:38:03.088Z INF/util:lifecycle 836 [*] Winding down for graceful exit
2017-12-11T03:38:03.090Z INF/util:lifecycle 838 [*] Winding down for graceful exit
2017-12-11T03:38:03.090Z INF/util:lifecycle 837 [*] Winding down for graceful exit
2017-12-11T03:38:03.095Z WRN/db 838 [*] Connection closed
2017-12-11T03:38:03.096Z WRN/db 832 [proc002] Connection closed
2017-12-11T03:38:03.098Z WRN/db 833 [reaper001] Connection closed
2017-12-11T03:38:03.100Z WRN/db 831 [proc001] Connection closed
2017-12-11T03:38:03.102Z WRN/db 836 [*] Connection closed
2017-12-11T03:38:03.111Z WRN/db 837 [*] Connection closed


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