• 后面更新了作者的 uiautomator2 到 2.5.6 ,试了七八个手机都没有问题了,只有我自己的一台旧手机还有问题,暂时忽略不计了

  • mac 平台在终端以后台方式运行 atxserver2-android-provider:
    nohup python3 main.py --server localhost:4000 > myout.log 2>&1 &
    [1] 80146

    查看进程信息:
    ps -ef | grep 80146
    501 80146 80081 0 10:54 下午 ttys002 0:00.67 python3 main.py --server localhost:4000
    501 80147 80146 0 10:54 下午 ttys002 0:00.08 node tcpproxy.js 20020 localhost 20015
    501 80148 80146 0 10:54 下午 ttys002 0:00.07 node tcpproxy.js 20021 localhost 20017
    501 80149 80146 0 10:54 下午 ttys002 0:00.26 node node_modules/adbkit/bin/adbkit usb-device-to-tcp -p 20022 GDB6R19A14000888

    浏览器可以正常使用设备,关闭浏览器,关闭终端,重新打开浏览器,显示” 设备屏幕同步中断”,再查看进程信息:
    ps -ef | grep 80146
    501 80146 1 0 10:54 下午 ?? 0:00.76 python3 main.py --server localhost:4000
    501 80190 80146 0 10:56 下午 ?? 0:00.00 (node)
    501 80191 80146 0 10:56 下午 ?? 0:00.00 (node)
    501 80192 80146 0 10:56 下午 ?? 0:00.00 (node)

    node 创建的子进程启动不了了,是什么原因呢?

  • 仅楼主可见
  • 仅楼主可见
  • 还是没有解决,日志如下:

  • 2020/02/16 17:29:48 httpserver.go:996: dial @minicap err: dial unix @minicap: connect: connection refused, wait 0.5s
    2020/02/16 17:29:48 cmdctrl.go:28: DEBUG program pid: 22599
    2020/02/16 17:29:48 httpserver.go:919: dial @minitouchagent error: dial unix @minitouchagent: connect: connection refused, wait 0.5s
    2020/02/16 17:29:48 cmdctrl.go:28: DEBUG ArgsFunc error: fork/exec /system/bin/pm: exec format error
    2020/02/16 17:29:48 cmdctrl.go:28: DEBUG program finished
    127.0.0.1 - - [16/Feb/2020:17:29:48 +0800] "GET /shell?command=input%20keyevent%20WAKEUP HTTP/1.1" 200 39
    2020/02/16 17:29:49 httpserver.go:919: dial @minitouchagent error: dial unix @minitouchagent: connect: connection refused, wait 0.5s
    2020/02/16 17:29:49 httpserver.go:919: dial @minitouchagent error: dial unix @minitouchagent: connect: connection refused, wait 0.5s
    2020/02/16 17:29:50 httpserver.go:919: dial @minitouchagent error: dial unix @minitouchagent: connect: connection refused, wait 0.5s
    2020/02/16 17:29:50 httpserver.go:919: dial @minitouchagent error: dial unix @minitouchagent: connect: connection refused, wait 0.5s
    2020/02/16 17:29:51 httpserver.go:919: dial @minitouchagent error: dial unix @minitouchagent: connect: connection refused, wait 0.5s
    2020/02/16 17:29:51 httpserver.go:919: dial @minitouchagent error: dial unix @minitouchagent: connect: connection refused, wait 0.5s
    2020/02/16 17:29:52 httpserver.go:919: dial @minitouchagent error: dial unix @minitouchagent: connect: connection refused, wait 0.5s
    2020/02/16 17:29:52 httpserver.go:919: dial @minitouchagent error: dial unix @minitouchagent: connect: connection refused, wait 0.5s
    2020/02/16 17:29:53 httpserver.go:919: dial @minitouchagent error: dial unix @minitouchagent: connect: connection refused, wait 0.5s
    2020/02/16 17:29:53 httpserver.go:919: dial @minitouchagent error: dial unix @minitouchagent: connect: connection refused, wait 0.5s
    2020/02/16 17:29:54 httpserver.go:911: unix @minitouchagent connect failed
    2020/02/16 17:29:54 httpserver.go:943: readJson err: read tcp 127.0.0.1:7912->127.0.0.1:56588: use of closed network connection
    127.0.0.1 - - [16/Feb/2020:17:29:48 +0800] "GET /minitouch HTTP/1.1" 200 0
    2020/02/16 17:29:55 cmdctrl.go:28: DEBUG cmd args: [/data/local/tmp/minicap -S -P 1080x1920@800x800/0]
    2020/02/16 17:29:55 httpserver.go:1012: minicap read error, try to read again
    2020/02/16 17:29:55 httpserver.go:1012: minicap read error, try to read again
    2020/02/16 17:29:55 httpserver.go:996: dial @minicap err: dial unix @minicap: connect: connection refused, wait 0.5s
    2020/02/16 17:29:55 cmdctrl.go:28: DEBUG program finished
    2020/02/16 17:29:55 cmdctrl.go:28: DEBUG Args: [/data/local/tmp/minicap -S -P 1080x1920@800x800/0]
    2020/02/16 17:29:55 cmdctrl.go:28: DEBUG start args: [/data/local/tmp/minicap -S -P 1080x1920@800x800/0], env: [LD_LIBRARY_PATH=/data/local/tmp]
    2020/02/16 17:29:55 cmdctrl.go:28: DEBUG program pid: 22649
    127.0.0.1 - - [16/Feb/2020:17:29:55 +0800] "GET /info/rotation HTTP/1.1" 200 14
    127.0.0.1 - - [16/Feb/2020:17:29:55 +0800] "GET /shell?command=input%20keyevent%20WAKEUP HTTP/1.1" 200 39
    2020/02/16 17:30:00 httpserver.go:1039: stream finished
    127.0.0.1 - - [16/Feb/2020:17:29:48 +0800] "GET /minicap HTTP/1.1" 200 0
    2020/02/16 17:30:01 httpserver.go:1008: transfer closed
    2020/02/16 17:34:55 httpserver.go:557: startservice com.github.uiautomator/.Service
    2020/02/16 17:36:23 httpserver.go:400: stop all service
    2020/02/16 17:36:23 cmdctrl.go:28: DEBUG program finished
    2020/02/16 17:36:23 httpserver.go:402: service stopped
    127.0.0.1 - - [16/Feb/2020:17:36:23 +0800] "GET /stop HTTP/1.1" 200 9
    2020/02/16 17:36:23 [Info] main.go:684 server quit: http: Server closed
    2020/02/16 17:36:23 [Info] main.go:540 run atx-agent in background
    2020/02/16 17:36:23 [Info] main.go:548 - - - - - - - - - - - - - - -
    2020/02/16 17:36:23 [Info] main.go:549 daemon started
    atx-agent version 0.8.3
    Listen on http://192.168.31.17:7912
    2020/02/16 17:36:24 cmdctrl.go:28: DEBUG ArgsFunc error: fork/exec /system/bin/pm: exec format error
    2020/02/16 17:36:24 cmdctrl.go:28: DEBUG program finished

  • 是最新的代码,sha-id 是这个:b8c821ee6429d7417808afe9c921ac5866e25742

  • 客户端和服务器都部署起来了,试了三四个安卓手机,设备都能列出来,但是只有一个 android10 系统的可以点击滑动,其他的都不能操作,有人遇到同样的问题了吗