STF 请教在 CentOS 虚机上使用 Docker 搭建 STF 服务, 使用 slave 节点添加 android 设备的两个问题

匿名 · 2019年09月27日 · 1387 次阅读

在 CentOS(虚机机) 上使用 Docker 部署的 STF 服务, 主要参考的是这篇文章
https://www.jianshu.com/p/10bdf33d2c64 成功搭建, STF 可以正常访问.

现在想将我个人的笔记本作为 slave 节点, 将连接此笔记本的 Android 设备添加到 STF 上去 (因为 centOS 是虚机, 应该没法用 android 设备连接虚机, wifi connect 没试过). 我的笔记本和 centOS 虚机网络是连通的, 笔记本上没有安装 STF.
相当于我参考的这篇文章的环境示例 2: https://www.gaoyaxuan.net/blog/157.html 这里给的方案就是:

步骤 1. slave 电脑启动 adb server 并对外暴露 5037 端口
步骤 2. 启动 STF 服务时后缀 --allow-remote 结合第一篇文章, 完整的命令为:
sudo docker run -d --name stf --net host openstf/stf stf local --public-ip --allow-remote
步骤 3.
通过 STF provider 的方式, 使用 adb host, 将 slave 电脑上的 android 设备添加到 STF 服务上
stf provider --name centos74 --min-port 7400 --max-port 7700 --connect-sub tcp://127.0.0.1:7114 --connect-push tcp://127.0.0.1:7116 --group-timeout 900 --public-ip 10.24.51.1 --storage-url http://localhost:7100/ --adb-host 10.24.12.234 --adb-port 5037 --vnc-initial-size 600x800 --mute-master never --allow-remote

请教问题 1: 在 slave 设备上启动 adb server 并对外暴露 5037 端口应如何操作?

执行 adb -a -P 5037 fork-server server
会提示: reply fd for adb server to client communication not specified.
网上搜过一些方法, 如 adb nodaemon server -a -P 5037
直接使用会使 adb 关闭, 并会提示: This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
此时如果 adb kill-server 后在执行 adb nodaemon server -a -P 5037 时, 会有以下提示:

这个正常吗?

请教问题 2: STF provider 这个指令都需要修改哪些地方? 仅 public-ip 和 adb-host 这两个地方?

按照我的理解, public-ip 需修改成 STF 服务主机的地址 adb-host 应修改为对应的 slave 机地址吧.(这里是因为之前看过的两篇文章里对应的地址有出入)

只修改 public-ip 和 adb-host 地址,去执行 stf provider
如果 public-ip 使用 centOS STF 主机的地址, adb-host 用 slave 笔记本的地址, 执行 stf provider 命令, 报以下错误

这里在网上搜索过一些方法, 暂时卡在这里了

如果互换, public-ip 使用 slave 笔记本的 ip, adb-host 使用 centOS STF 主机的 ip, 则会一直无响应, 如下 (应该本来就不对的)

如果有经验丰富的前辈拨冗指点一下, 那就太感谢了~

共收到 2 条回复 时间 点赞
匿名 #1 · 2019年09月27日

先预祝大家国庆节快乐~ 🍻

匿名 #2 · 2019年10月09日

1

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册