STF WEB 端批量移动设备管理控制工具 STF 的环境搭建和运行

汪汪 · 2015年07月23日 · 最后由 pcz88 回复于 2019年09月20日 · 15763 次阅读
本帖已被设为精华帖!

最近项目涉及到较多设备批量管理的需求,发现一工具,可以批量对大量设备进行 WEB 端管理,工具主页:https://openstf.github.io/
工具名 STF(Smartphone Test Farm)

STF (or Smartphone Test Farm) is a web application for debugging smartphones, smartwatches and other gadgets remotely, from the comfort of your browser.

上个主页上的效果图吧:
这里写图片描述
它的 github 页面为:https://github.com/openstf/stf
下面简单记录下在 Ubuntu 上搭建它的步骤 (windows 暂时没尝试过,应该类似)
环境:Ubuntu15.04(desktop-64bit)
浏览器:firefox

1、Linux 一些基本包的安装:

在控制台分别运行

sudo apt-get update
sudo apt-get install git
sudo apt-get install lib32stdc++6
sudo apt-get install yum

2、SDK 环境安装

这里我偷了个懒直接拷贝已经下载好的 JDK 和 Android SDK 环境过来,当然如果没有的同学估计要重新慢慢下载和安装了。
拷贝 SDK 目录到 HOME 目录中,打开控制台命令运行:

sudo gedit ~/.bashrc

配置环境变量并保存退出 (wang 为用户名,需要根据实际路径来填写)

export JAVA_HOME=/home/wang/SDK/jdk1.8.0_45
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar 
export ANDROID_HOME=/home/wang/SDK/android-sdk-linux
export PATH=$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH

在控制台执行命令使之生效:

source ~/.bashrc

验证:控制台分别输入 adb 和 java -version 来验证 SDK 是否配置生效

3、nodejs 安装

https://nodejs.org/download/
下载 nodejs 安装包,解压并控制台进入目录
运行如下命令

./configure
make
sudo make install
sudo ln -s /usr/local/bin/node /usr/bin/node
sudo ln -s /usr/local/bin/npm /usr/bin/npm

验证:控制台分别输入 node -v 和 npm -v 验证是否配置完成
这里写图片描述

4、安装 Bower

控制台执行 npm 命令进行 Bower 安装并等待完成

sudo npm install bower -g

验证:
这里写图片描述

5、安装 RethinkBD

控制台执行

source /etc/lsb-release && echo "deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list
wget -qO- http://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -
//注意:以上为一条命令,需一起执行
sudo apt-get update
sudo apt-get install rethinkdb

验证:
这里写图片描述

6、安装 GraphicsMagick

最新版本包地址:http://sourceforge.net/projects/graphicsmagick/files/graphicsmagick/
解压 GraphicsMagick-1.3.21.tar.gz 并控制台进入目录
执行

./configure
make
sudo make install

验证:
这里写图片描述

7、安装 libsodium(zeromq 的依赖)

github 下载最新包:https://github.com/jedisct1/libsodium/releases
解压 libsodium-1.0.3.tar.gz 并控制台进入目录
执行

./configure
make
sudo make install

验证:
这里写图片描述

8、安装 zeromq

最新版本包地址:http://download.zeromq.org/
解压 zeromq-4.1.2.tar.gz 并控制台进入目录
执行

./configure
make
sudo make install
sudo ldconfig

9、安装 protobuf

github 下载最新包:https://github.com/google/protobuf/releases
解压 protobuf-cpp-3.0.0-alpha-3.tar.gz 并控制台进入目录
执行

//因为需要配置环境变量,所以用参数指定到了local下的指定目录中
./configure --prefix=/usr/local/protobuf
make
sudo make install

修改环境变量配置文件:

sudo gedit ~/.bashrc

配置环境变量并保存退出:

export PATH=$PATH:/usr/local/protobuf/bin/
export PKG_CONFIG_PATH=/usr/local/protobuf/lib/pkgconfig/

在控制台执行命令使之生效:

source ~/.bashrc

验证:
这里写图片描述

10、安装 pkg-config

sudo apt-get install pkg-config

验证:
这里写图片描述

11、安装 stf (可能需要或者)

控制台执行命令:

sudo npm install -g stf

安装过程:
这里写图片描述

STF 运行

一、启动 rethinkDB

安装完成后,打开单独的控制台,运行命令等待服务启动完成:

rethinkdb

这里写图片描述

二、启动 stf 服务端

打开一个单独的控制台,运行命令等待服务启动完成:

stf local

这里写图片描述
注:这里我多加了个参数 --allow-remote 用于允许远程调试设备连接

三、运行客户端

在浏览器中输入地址:http://localhost:7100/ 访问客户端。
输入用户名和邮箱登录即可开始使用。
登陆界面
主界面
控制台

然后就可以在页面上直接控制连接的设备了,按照官方的说法,可以控制 more than 160 devices. 当然 要有好的 hub 或者无线环境。
其他的以后进一步发掘吧。

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
共收到 156 条回复 时间 点赞

有支持 ios 环境的不?

想请教下,我安装完成后在连接设备时,在终端输入 adb connect ip:port 后,提示 failed to connect to 'IP:port': Connection refused
然后插入 USB 直接就连接上了,但是就是无法通过 Wi-Fi 连接,手机和电脑都是在同一个局域网内

3楼 已删除
Jacc 专栏文章:Ubuntu16 安装 STF 记录 中提及了此贴 01月09日 17:37
石磊 回复

可以的,只要装了 ADB 的机子 可以 adb devices 看到手机就可以了

测试生 STF 部署踩坑小记 中提及了此贴 10月31日 11:36

@wang04170 请问安装 rethinkdb 时报这个错是啥原因呢

汪汪 回复

我的环境,所有的都是 Ubuntu14.4. stf 3.3,PC 端都有 ADB

我想问一下,如果我想把多个 pc 连接的手机映射到一个 stf 服务器,要怎么做,怎么端口转发实现这个功能尼?
我目前是这样做的,
1)第一个 PC(100.176.181.90)端执行: adb nodaemon server -a -P 5037
2)stf 服务器执行如下三条:
1) rethinkdb;
2) stf local --public-ip=10.170.180.xx --allow-remote;
3) stf provider --name local --min-port 7400 --max-port 7700 --connect-sub tcp://127.0.0.1:7114 --connect-push tcp://127.0.0.1:7116 --group-timeout 20000 --public-ip 10.170.180.xx --storage-url http://10.170.180.xx:7100/ --adb-host 100.176.181.90 --adb-port 5037 --vnc-initial-size 540x960 --allow-remote;

当我对第二个 PC(100.176.181.91)执行:
1)PC 端: adb nodaemon server -a -P 5037;
2)stf 端: stf provider --name local --min-port 7400 --max-port 7700 --connect-sub tcp://127.0.0.1:7114 --connect-push tcp://127.0.0.1:7116 --group-timeout 20000 --public-ip 10.170.180.xx --storage-url http://10.170.180.xx:7100/ --adb-host 100.176.181.91 --adb-port 5037 --vnc-initial-size 540x960 --allow-remote;

却始终连不上,第二个命令执行之后,log 打印到 Tracking devices,就没有后面的了,不动了,
有什么好的方法吗?
我的目标是想实现不同 PC 上的手机,都显示在 STF 服务器上面,搭建一个分布式的环境;
希望大家看到给点意见,非常感谢!

按着楼主说的步骤终于出来页面了,但是没有显示我正在连接的设备呢,使用 adb devices 命令是有的

请问你那解决了吗 我用的 VMware 的 centos7 也有这个问题

11楼 已删除
skyjin 回复

我是 linux 下安装的 STF,STF 官网好像有说 windows 不支持安装哦

蓝蓝 回复

@HeartBeat , Windows 怎么安装的。有文档吗。本人刚刚接触 Android 自动化。

14楼 已删除
老马 macaca server +Jenkins +STF 自动化环境部署思考 中提及了此贴 03月07日 15:23
程明远 回复

是的

@HeartBeat 你好,请问您是在 ubuntu16.04 的环境下搭建的吗?

匿名 #18 · 2017年12月12日

你好,执行 stf doctor 有最下面的报错,请问如何解决啊

有没人遇到,在 win7 chrome v58/v61 下打开 STF,没有显示文字的?win10 chrome v61 和 win7 chrome v59 打开就好好的

F12 看,有个 woff 请求,Request Headers 告警:"Provisional headers are shown"

玄月指光 STF 折腾之路 最后换成 Docker 来安装 中提及了此贴 10月12日 16:00
蓝蓝 回复

感谢楼主的安装文档指导!昨天环境我成功装上了,太 6 了。

Setup had an error Error: Cannot find module '/usr/local/lib/node_modules/stf/node_modules/_jpeg-turbo@0.4.0@jpeg-turbo/lib/binding/node-v57-linux-x64/jpegturbo.node'

求助,有人遇到这个问题么,devices 一直是 disconnected,一直报这个错误

蓝蓝 回复

已解决:
sudo npm install yargs -g
sudo cnpm intall zmq -g
多次安装成功之后就好了

@AwesomeOcean 求助,stf local 运行时出现依赖没安装上;

26楼 已删除
chestnut 回复

我遇到这个问题是在 update node 版本到 8.x 之后,后来没法解决,只好降低 node 的版本到 4.x。目前无此问题出现

@wang04170 敬爱的楼主,可不可以把https://github.com/openstf/stf#requirements 中提到的 yasm 的安装(sudo apt-get install yasm)的步骤也补充进来,这个帖子是 STF 风向标和 STF 中文 Icon,以及必读帖一样的存在,补充上对很多初次接触 STF 的同学有很大的意义呢。

emma.ren STF 使用系列心得 [安装篇] 中提及了此贴 06月05日 12:22
lee 回复

已经解决了

RethinkDB 提示无效, 请问有解决办法吗? 感谢

blueshark 回复

非常感谢,问题已解决

徐旻 回复

我的资料里有我的联系方式

回复

安装 zmq

blueshark 回复

求一个联系方式

我这个错误怎么解决呢?谢谢各位
INF/util:procutil 127572 [*] Forking "/usr/local/lib/node_modules/stf/lib/cli.js poorxy --port 7100 --app-url http://localhost:7105/ --auth-url http://localhost:7120/ --api-url http://localhost:7106/ --websocket-url http://localhost:7110/ --storage-url http://localhost:7102/ --storage-plugin-image-url http://localhost:7103/ --storage-plugin-apk-url http://localhost:7104/"
/usr/local/lib/node_modules/stf/node_modules/_bindings@1.2.1@bindings/bindings.js:83
throw e
^

Error: libzmq.so.5: cannot open shared object file: No such file or directory
at Error (native)
at Object.Module._extensions..node (module.js:597:18)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at bindings (/usr/local/lib/node_modules/stf/node_modules/_bindings@1.2.1@bindings/bindings.js:76:44)
at Object. (/usr/local/lib/node_modules/stf/node_modules/_zmq@2.15.3@zmq/lib/index.js:6:30)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
FTL/cli:local 127572 [] Child process had an error ExitError: Exit code "1"
at ChildProcess. (/usr/local/lib/node_modules/stf/lib/util/procutil.js:49:23)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
INF/cli:local 127572 [
] Shutting down all child processes
/usr/local/lib/node_modules/stf/node_modules/_bindings@1.2.1@bindings/bindings.js:83
throw e
^

Error: libzmq.so.5: cannot open shared object file: No such file or directory
at Error (native)
at Object.Module._extensions..node (module.js:597:18)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at bindings (/usr/local/lib/node_modules/stf/node_modules/_bindings@1.2.1@bindings/bindings.js:76:44)
at Object. (/usr/local/lib/node_modules/stf/node_modules/_zmq@2.15.3@zmq/lib/index.js:6:30)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)

Kilmer 回复

给 root 文件夹赋予 777 权限

Leon 回复

终端执行:npm install -g stf
PS:执行上面第二步可能会卡住,这是因为需要 ***,这里可以用淘宝镜像 cnpm 来安装

(cnpm 安装执行:npm install -g cnpm --registry=https://registry.npm.taobao.org

终端执行:cnpm install -g stf

1、启动 rethinkDB
2、启动 STF
3、stf doctor 查看所需依赖状态

chestnut 回复

终端执行:npm install -g stf
PS:执行上面第二步可能会卡住,这是因为需要 ***,这里可以用淘宝镜像 cnpm 来安装

(cnpm 安装执行:npm install -g cnpm --registry=https://registry.npm.taobao.org

终端执行:cnpm install -g stf

1、启动 rethinkDB
2、启动 STF
3、stf doctor 查看所需依赖状态

斯特瑞 回复

也踩过这个坑,最后找到了解决的方法,应该上面提到 “打开了 80 端口远程 ip 已设置,但是从远程访问页面时出现 disconnect 提示,总是连接不成功。” 也是类似的原因。
不能只映射 7100 端口,还要把 stf 连接手机用到的一系列端口都要打开,看启动时的显示应该打开了好多端口,所以我们在设置映射时候直接打开了 7000-8000 端口段映射,然后就可以了。。。
希望有所帮助。

wanxiaoqiang 回复

我现在 stf 都搭建好,但是就是一直不显示设备,然后我又通过 cmd abd devices 进去看设备是链接上的,不知道为啥 在 stf 界面里面就是不显示,我的手机是直接链接在 stf 环境上面的设备

wanxiaoqiang 回复

我想加你好友,能留个 qq 或者微信吗,非常感谢,我的微信是 wxq_lw

blueshark 回复

恩,现在不知道为啥 stf 进入了 数据库也初始化成功,但是就是连接不上手机设备,我在终端用 adb devices 看了设备是有的。

wanxiaoqiang 回复

亲,sh 文件肯定是在 linux 下执行的啊,建议你先看下 linux、docker、nginx 的相关基础知识,否则遇到问题不好解决的😀

@blueshark 请问那个 nginx 代理的配置文件是怎样加进去的了,执行 docker run -d -v $(pwd)/nginx.conf:/etc/nginx/nginx.conf:ro --name nginx --net host nginx nginx 是需要到 ubantu 下面进行 echo 吗

鱼肚白 回复

肯定是 provider 报错了,你看看前面的 log 报什么错

blueshark 回复

兄弟,我用的 docker,提示
。。啥原因啊

blueshark 回复

大神 能加下你 qq 问下你这块东西吗,非常感谢

您好,请问您的问题解决了吗,我也遇到,想请教下,方便可以加下 qq 吗

linkin 回复

windows 上没有解决,mac 下搭建可调通

wangpengfei100 [该话题已被删除] 中提及了此贴 04月18日 12:41

WRN/device:plugins:touch 15254 [5PJVT8MNVGIZNN99] Will not apply desired state due to too many failures
INF/device:plugins:touch 15254 [5PJVT8MNVGIZNN99] Stopping minitouch service
FTL/device 15254 [5PJVT8MNVGIZNN99] Setup had an error Error: Failed more than 3 times in 10000ms
at TouchConsumer._failLimitExceeded (/usr/local/lib/node_modules/stf/lib/units/device/plugins/touch/index.js:230:26)
at FailCounter.emit (/usr/local/lib/node_modules/stf/node_modules/eventemitter3/index.js:117:35)
at FailCounter.inc (/usr/local/lib/node_modules/stf/lib/util/failcounter.js:29:10)
at TouchConsumer._outputEnded (/usr/local/lib/node_modules/stf/lib/units/device/plugins/touch/index.js:223:24)
at RiskyStream.emit (/usr/local/lib/node_modules/stf/node_modules/eventemitter3/index.js:115:35)
at RiskyStream. (/usr/local/lib/node_modules/stf/lib/util/riskystream.js:14:12)
at emitNone (events.js:91:20)
at Socket.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
From previous event:
at startConsumer (/usr/local/lib/node_modules/stf/lib/units/device/plugins/touch/index.js:511:14)
at /usr/local/lib/node_modules/stf/lib/units/device/plugins/touch/index.js:526:12
at SerialSyrup.ParallelSyrup.invoke (/usr/local/lib/node_modules/stf/node_modules/stf-syrup/lib/parallel.js:54:24)
at /usr/local/lib/node_modules/stf/node_modules/stf-syrup/lib/serial.js:43:33
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
FTL/util:lifecycle 15254 [5PJVT8MNVGIZNN99] Shutting down due to fatal error
INF/provider 15245 [] Cleaning up device worker "5PJVT8MNVGIZNN99"
ERR/provider 15245 [
] Device worker "5PJVT8MNVGIZNN99" died with code 1

wangpengfei100 STF 初步定制测试平台 中提及了此贴 04月17日 11:45
loneyao 回复

这个问题是 nodejs 一些版本的 bug,npm 编译安装模块的时候没把对应的 bind 文件拷贝过去。解决办法是重新编译一遍,类似于这样:
$ sudo npm install -g node-gyp
$ cd node_modules/libxmljs
$ node-gyp rebuild

参考: https://github.com/libxmljs/libxmljs/issues/253

Device database does not have a match for device
我遇到的是这种问题。也查过 github 上的 issue,开发者说还没有这种手机,我的手机是红米 3.

blueshark 回复

私聊,我遇到了一些问题

Kilmer 回复

这个问题我也遇到过,社区的 issue 还是 open 状态
换成自己 mac 上安装,两行命令就跑起来了

loneyao 回复

你的 stf 配置成功了吗

clydeiMac:~ cly$ stf local --public-ip 192.168.28.2 --allow-remote
INF/util:procutil 10270 [] Forking "/usr/local/lib/node_modules/stf/lib/cli.js migrate"
INF/db 10271 [
] Connecting to 127.0.0.1:28015
INF/db:setup 10271 [] Database "stf" already exists
INF/db:setup 10271 [
] Table "users" already exists
INF/db:setup 10271 [] Table "accessTokens" already exists
INF/db:setup 10271 [
] Table "vncauth" already exists
INF/db:setup 10271 [] Table "devices" already exists
INF/db:setup 10271 [
] Table "logs" already exists
INF/db:setup 10271 [] Index "users"."adbKeys" already exists
INF/db:setup 10271 [
] Index "accessTokens"."email" already exists
INF/db:setup 10271 [] Index "vncauth"."response" already exists
INF/db:setup 10271 [
] Index "vncauth"."responsePerDevice" already exists
INF/db:setup 10271 [] Index "devices"."owner" already exists
INF/db:setup 10271 [
] Index "devices"."present" already exists
INF/db:setup 10271 [] Waiting for index "users"."adbKeys"
INF/db:setup 10271 [
] Waiting for index "accessTokens"."email"
INF/db:setup 10271 [] Waiting for index "vncauth"."response"
INF/db:setup 10271 [
] Waiting for index "vncauth"."responsePerDevice"
INF/db:setup 10271 [] Waiting for index "devices"."owner"
INF/db:setup 10271 [
] Waiting for index "devices"."present"
INF/db:setup 10271 [] Index "devices"."providerChannel" already exists
INF/db:setup 10271 [
] Waiting for index "devices"."providerChannel"
INF/db:setup 10271 [] Index "users"."adbKeys" is ready
INF/db:setup 10271 [
] Index "accessTokens"."email" is ready
INF/db:setup 10271 [] Index "vncauth"."responsePerDevice" is ready
INF/db:setup 10271 [
] Index "vncauth"."response" is ready
INF/db:setup 10271 [] Index "devices"."providerChannel" is ready
INF/db:setup 10271 [
] Index "devices"."present" is ready
INF/db:setup 10271 [] Index "devices"."owner" is ready
INF/util:procutil 10270 [
] Forking "/usr/local/lib/node_modules/stf/lib/cli.js triproxy app001 --bind-pub tcp://127.0.0.1:7111 --bind-dealer tcp://127.0.0.1:7112 --bind-pull tcp://127.0.0.1:7113"
INF/util:procutil 10270 [] Forking "/usr/local/lib/node_modules/stf/lib/cli.js triproxy dev001 --bind-pub tcp://127.0.0.1:7114 --bind-dealer tcp://127.0.0.1:7115 --bind-pull tcp://127.0.0.1:7116"
INF/util:procutil 10270 [
] Forking "/usr/local/lib/node_modules/stf/lib/cli.js processor proc001 --connect-app-dealer tcp://127.0.0.1:7112 --connect-dev-dealer tcp://127.0.0.1:7115"
INF/util:procutil 10270 [] Forking "/usr/local/lib/node_modules/stf/lib/cli.js processor proc002 --connect-app-dealer tcp://127.0.0.1:7112 --connect-dev-dealer tcp://127.0.0.1:7115"
INF/util:procutil 10270 [
] Forking "/usr/local/lib/node_modules/stf/lib/cli.js reaper reaper001 --connect-push tcp://127.0.0.1:7116 --connect-sub tcp://127.0.0.1:7111"
INF/util:procutil 10270 [] Forking "/usr/local/lib/node_modules/stf/lib/cli.js provider --name clydeiMac.local --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 192.168.28.2 --storage-url http://localhost:7100/ --adb-host 127.0.0.1 --adb-port 5037 --vnc-initial-size 600x800 --allow-remote"
INF/util:procutil 10270 [
] Forking "/usr/local/lib/node_modules/stf/lib/cli.js auth-mock --port 7120 --secret kute kittykat --app-url http://192.168.28.2:7100/"
INF/util:procutil 10270 [] Forking "/usr/local/lib/node_modules/stf/lib/cli.js app --port 7105 --secret kute kittykat --auth-url http://192.168.28.2:7100/auth/mock/ --websocket-url http://192.168.28.2:7110/"
INF/util:procutil 10270 [
] Forking "/usr/local/lib/node_modules/stf/lib/cli.js api --port 7106 --secret kute kittykat --connect-push tcp://127.0.0.1:7113 --connect-sub tcp://127.0.0.1:7111"
INF/util:procutil 10270 [] Forking "/usr/local/lib/node_modules/stf/lib/cli.js websocket --port 7110 --secret kute kittykat --storage-url http://localhost:7100/ --connect-sub tcp://127.0.0.1:7111 --connect-push tcp://127.0.0.1:7113"
INF/util:procutil 10270 [
] Forking "/usr/local/lib/node_modules/stf/lib/cli.js storage-temp --port 7102"
INF/util:procutil 10270 [] Forking "/usr/local/lib/node_modules/stf/lib/cli.js storage-plugin-image --port 7103 --storage-url http://localhost:7100/"
INF/util:procutil 10270 [
] Forking "/usr/local/lib/node_modules/stf/lib/cli.js storage-plugin-apk --port 7104 --storage-url http://localhost:7100/"
INF/util:procutil 10270 [*] Forking "/usr/local/lib/node_modules/stf/lib/cli.js poorxy --port 7100 --app-url http://localhost:7105/ --auth-url http://localhost:7120/ --api-url http://localhost:7106/ --websocket-url http://localhost:7110/ --storage-url http://localhost:7102/ --storage-plugin-image-url http://localhost:7103/ --storage-plugin-apk-url http://localhost:7104/"
/usr/local/lib/node_modules/stf/node_modules/bindings/bindings.js:91
throw err
^

Error: Could not locate the bindings file. Tried:
→ /usr/local/lib/node_modules/stf/node_modules/zmq/build/zmq.node
→ /usr/local/lib/node_modules/stf/node_modules/zmq/build/Debug/zmq.node
→ /usr/local/lib/node_modules/stf/node_modules/zmq/build/Release/zmq.node
→ /usr/local/lib/node_modules/stf/node_modules/zmq/out/Debug/zmq.node
→ /usr/local/lib/node_modules/stf/node_modules/zmq/Debug/zmq.node
→ /usr/local/lib/node_modules/stf/node_modules/zmq/out/Release/zmq.node
→ /usr/local/lib/node_modules/stf/node_modules/zmq/Release/zmq.node
→ /usr/local/lib/node_modules/stf/node_modules/zmq/build/default/zmq.node
→ /usr/local/lib/node_modules/stf/node_modules/zmq/compiled/6.10.1/darwin/x64/zmq.node
at bindings (/usr/local/lib/node_modules/stf/node_modules/bindings/bindings.js:88:9)
at Object. (/usr/local/lib/node_modules/stf/node_modules/zmq/lib/index.js:6:30)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/usr/local/lib/node_modules/stf/node_modules/zmq/index.js:2:18)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
FTL/cli:local 10270 [] Child process had an error ExitError: Exit code "1"
at ChildProcess. (/usr/local/lib/node_modules/stf/lib/util/procutil.js:49:23)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
INF/cli:local 10270 [
] Shutting down all child processes
/usr/local/lib/node_modules/stf/node_modules/bindings/bindings.js:91
throw err
^

Error: Could not locate the bindings file. Tried:
→ /usr/local/lib/node_modules/stf/node_modules/zmq/build/zmq.node
→ /usr/local/lib/node_modules/stf/node_modules/zmq/build/Debug/zmq.node
→ /usr/local/lib/node_modules/stf/node_modules/zmq/build/Release/zmq.node
→ /usr/local/lib/node_modules/stf/node_modules/zmq/out/Debug/zmq.node
→ /usr/local/lib/node_modules/stf/node_modules/zmq/Debug/zmq.node
→ /usr/local/lib/node_modules/stf/node_modules/zmq/out/Release/zmq.node
→ /usr/local/lib/node_modules/stf/node_modules/zmq/Release/zmq.node
→ /usr/local/lib/node_modules/stf/node_modules/zmq/build/default/zmq.node
→ /usr/local/lib/node_modules/stf/node_modules/zmq/compiled/6.10.1/darwin/x64/zmq.node
at bindings (/usr/local/lib/node_modules/stf/node_modules/bindings/bindings.js:88:9)
at Object. (/usr/local/lib/node_modules/stf/node_modules/zmq/lib/index.js:6:30)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/usr/local/lib/node_modules/stf/node_modules/zmq/index.js:2:18)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)

linkin 回复

https://testerhome.com/topics/6117

改造篇里有提到修改截图问题,试了下,可以解决截屏问题。

Ben 回复

我现在也遇到截屏失败、截屏打不开的问题。
查询手机文件也不行,调试 html 有报错

linkin MAC 下 STF 的环境搭建和运行 中提及了此贴 03月24日 16:48
chestnut 回复

请问你这个问题解决了吗?是怎么解决的?

你好,你的截图问题解决了吗??????

Ben 回复

你好,你的截图问题解决了吗???

yuweixx 回复

你们用的 USB 连接多少台,用的 hub 吗

匿名 #67 · 2017年03月12日

你帖子里的 rethinkdb 源现在下不到资源了,还有别的 rethinkdb 源么?我也在搭建本地环境

chestnut 回复

你的问题怎么解决的

依赖环境都已检查配好,stf version 可查是 2.3.0,但 stf-doctor 不可用
stf local 报错:

求指教!~

请问有没有遇到过无法截图的朋友们,用 STF 截的图无法显示

安装步骤里面貌似缺少了安装 yasm 一步。然后楼主给出的 zeromq 下载地址真的很慢,可以尝试http://zeromq.org/intro:get-the-software

易寒 STF 框架之 minicap 工具 中提及了此贴 12月16日 16:23
狂师 STF 使用系列心得 [安装篇] 中提及了此贴 12月08日 21:25
syl7752 STF 初步定制测试平台 中提及了此贴 12月08日 19:26

为什么我同时在线连接数最多只能 37 台,是 ADB 限制,还是 STF 限制?

blueshark STF 开发环境搭建与制作 docker 镜像过程 中提及了此贴 11月24日 14:54
大东 [STF 系列] 无痛接入基于 LDAP 的单点登录 中提及了此贴 11月23日 11:16

你好请问局域网内其他电脑上如何部署,将设备 provider 上去,provider 参数如何填写。

狂师 [该话题已被删除] 中提及了此贴 10月14日 00:36

#20 楼 @wang04170 不知道亲们为什么一直考虑无线 adb,其实 stf 是原生支持多 client 的,直接启动多个 provider 就行了,可以把手机插在多个 provider 电脑上

#100 楼 @sunmai 直接用 docker,不要太简单,不过最好安装在 linux 机器上,可以联系我,举手之劳不收费😂

谁有时间帮忙远程安装 免费最好收费也行

使用 stf doctor,提示 rethinkdb 的版本无效,TypeError: Invalid Version: 2.3.5~0xenial,请问怎么解决,按照上面文档一步步按照的

我使用 screenshot 截图后,点击查看照片,提示错误,有遇到过的吗?

老马 [该话题已被删除] 中提及了此贴 08月31日 16:52
syl7752 [该话题已被删除] 中提及了此贴 08月26日 18:44

你好! 我在使用 STF 时发现我的上传功能在安装时很慢,不能上传软件;我采用 ftp 下载模式进行安装,但是在安装完成以后,可以正常使用,一旦关闭在开启这个手机时,发现软件没有了,并且 info 信息中没有任何报错信息。请问这个是怎么回事。

@kilmer

提示 gyp WARN EACCES user "root" does not have permission to access the dev dir "/home/zhaojiajun/.node-gyp/4.0.0"这个你有解决了吗? 我也遇到了,纠结, 求指教。

blueshark [该话题已被删除] 中提及了此贴 07月14日 14:21
大东 [该话题已被删除] 中提及了此贴 06月29日 20:34
易寒 [该话题已被删除] 中提及了此贴 06月29日 20:34

我理解的应用场景是 stf 集成测试框架实现云测吗?大家都用这个具体能干什么呢?

#81 楼 @sl1010 adb 通过 tcpip 方式连接,就行了,具体 adb 如何通过 wifi 方式连接,可以百度一下,很多很多,我现在就是 wifi 远程方式连接终端

INF/util:procutil 2440 [] Forking "/Users/allanwendy/node_modules/stf/lib/cli.js migrate"
INF/db 2441 [
] Connecting to 127.0.0.1:28015
undefined:1
ERROR: Received an unsupported protocol version. This port is for RethinkDB qu
^
SyntaxError: Unexpected token E
at Object.parse (native)
at Socket.handshake_callback (/Users/allanwendy/node_modules/stf/node_modules/rethinkdb/net.js:624:35)
at Socket.emit (events.js:107:17)
at readableAddChunk (_stream_readable.js:163:16)
at Socket.Readable.push (_stream_readable.js:126:10)
at TCP.onread (net.js:538:20)

/Users/allanwendy/node_modules/bluebird/js/main/promise.js:677
throw e;
^
ExitError: Exit code "1"
at ChildProcess. (/Users/allanwendy/node_modules/stf/lib/util/procutil.js:49:23)
at ChildProcess.emit (events.js:110:17)
at Process.ChildProcess._handle.onexit (child_process.js:1074:12)

这个咋解决啊,有没有大神帮忙看看哈

npm WARN deprecated jade@1.11.0: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated transformers@2.1.0: Deprecated, use jstransformer
/usr/local/bin/stf -> /usr/local/lib/node_modules/stf/bin/stf

dtrace-provider@0.5.0 install /usr/local/lib/node_modules/stf/node_modules/dtrace-provider
node scripts/install.js

sh: node: command not found
npm WARN install:dtrace-provider@0.5.0 dtrace-provider@0.5.0 install: node scripts/install.js
npm WARN install:dtrace-provider@0.5.0 spawn ENOENT

jpeg-turbo@0.3.2 install /usr/local/lib/node_modules/stf/node_modules/jpeg-turbo
node-pre-gyp install --fallback-to-build

env: node: No such file or directory
/usr/local/lib
└── (empty)

npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/Cellar/node/5.7.1/bin/node" "/usr/local/bin/npm" "install" "-g" "stf"
npm ERR! node v5.7.1
npm ERR! npm v3.6.0
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn

npm ERR! jpeg-turbo@0.3.2 install: node-pre-gyp install --fallback-to-build
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the jpeg-turbo@0.3.2 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the jpeg-turbo package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs jpeg-turbo
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls jpeg-turbo
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /usr/local/lib/npm-debug.log
npm ERR! code 1

node 总是提示找不到文件@wang04170,这个咋解决啊?

搞定 c 的问题

6、安装 GraphicsMagick
执行./configure

提示:./configure: line 87: IFSer: command not found
configuring GraphicsMagick 1.3.23
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking whether build environment is sane... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in /usr/local/GraphicsMagick-1.3.23':
configure: error: C compiler cannot create executables
See
config.log' for more details

查看 config.log 提示:configure: exit 77

72 # The user is always right.
     73 if test "${PATH_SEPARATOR+set}" != set; then
     74   PATH_SEPARATOR=:
     75   (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
     76     (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
     77       PATH_SEPARATOR=';'
     78   }
     79 fi

用户名邮箱登入不需要注册吗?

汪汪 #101 · 2016年05月24日 Author

#81 楼 @sl1010 启动 stf 时多加了个参数 --allow-remote,然后就可以识别到 adb connect 连的设备

我已经搭建成功了真机 USB 连接也可以了,我想问问 wifi 连接的手机能不能用 STF 连接管理,可以的话要怎么连接呢

谁能弄简单的这种软件呢?自己写的,有偿

104楼 已删除

#72 楼 @yrguo_iflytek 这个可能是手机品牌或版本不兼容,换个三星 4.4 应该是能连的。

你好,请问 openstf 修改了模板,需要重新生成。应该怎么生成呢,我看官网给的解释是要运行 gulp clean,但是我运行了提示 No gulpfile found

107楼 已删除

谁能来个教程呢。小白基本不太懂,。

你好,我部署在内网服务器上,然后用路由器做了 7100 端口映射,把 7100 端口转发到内网 ip
然后使用:stf local --public-ip 外网 IP
在浏览器输入:http://外网 ip:7100
登陆进去一直显示连接失败

ERR/storage:plugins:apk 14423 [*] Unable to read manifest of "cf1df90a-f2ae-4548-b4ad-a8690e68b5fe" Error: Invalid or unsupported zip format. No END header found
at new ApkReader (/usr/local/lib/node_modules/stf/node_modules/adbkit-apkreader/lib/apkreader.js:27:17)
at Function.ApkReader.readFile (/usr/local/lib/node_modules/stf/node_modules/adbkit-apkreader/lib/apkreader.js:16:14)
at /usr/local/lib/node_modules/stf/lib/units/storage/plugins/apk/task/manifest.js:9:30
at nextTickCallbackWith0Args (node.js:420:9)
at process._tickCallback (node.js:349:13)

请问有没有人遇到过这样的错误啊,求解决方案啊。。

每次 stf 总提示 Device database does not have a match for device,然后浏览器提示连不上设备;但是,又能显示设备在;这是什么问题,楼主???

#61 楼 @q88535448 请问你的这个问题解决了么?我也是识别了 usb 设备,但是却在浏览器能访问,但是手机界面是空的,没有东西,每次刷新提示 disconnect。。

哎,是 windows 兼容性问题,,linux 和 mac 访问都正常

你好,远程访问 stf 页面缺少字符,切换成中文也不生效。你怎么解决的啊?

#50 楼 @yinzhuoqun 你好,远程访问 stf 页面缺少字符,切换成中文也不生效。你怎么解决的啊?

#66 楼 @newbiner 我也遇到截屏失败的问题

大家有没有遇到截屏失败、截屏打不开,远程访问乱码的问题啊?

#52 楼 @kilmer 重新执行安装命令即可,只要能安装成功即可,不影响使用。

#63 楼 @123321 Readme 说的是让你自己去试吧,只是他们不会提供 Windows 环境的安装支持

#62 楼 @finelucky 看 RethinkDB 主页,似乎不支持 windows 安装

有 Windows 环境搭建成功的吗?

#35 楼 @lihuazhang 我也遇到了同样的问题,打开了 80 端口远程 ip 已设置,但是从远程访问页面时出现 disconnect 提示,总是连接不成功。

@wang04170 看了官方介绍了,只支持 android

@wang04170 hi,牛人,我有一个小白的问题想了解下,为啥需要安装 android 还要配置其变量,如果是苹果手机呢或者 windows phone 呢(请谅解我没详细了解 stf 就来提问)

#35 楼 @lihuazhang 谢了,我那问题已经解决了,当初启动命令后面跟的 ip 写错了

#52 楼 @kilmer
https://github.com/nodejs/node-gyp/issues/454 你试试这里的有没有可以解决你的办法 我试了一下貌似木有

#52 楼 @kilmer 我也是这样的情况

#53 楼 @1056866402

Usb 连接手机

系统会自动在设备上面安装一个 STF Service

#53 楼 @1056866402 文章看完了没?看完在发问。

问一下大家: 这套框架,怎么连接手机。 是靠 usb 还是无线 adb
还要在手机上 安装 apk?

STF 前提依赖都安装好了

执行 sudo npm install -g stf 不成功

错误信息:
gyp WARN EACCES user "root" does not have permission to access the dev dir "/home/zhaojiajun/.node-gyp/4.0.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/stf/node_modules/ws/node_modules/utf-8-validate/.node-gyp"

请问这是什么原因导致的呢

有没有人通过 github 上的 systemd 和 docket 实现的部署?求指教! 邮箱:yuan890811@163.com,qq:892415868

安装过程过需要的文件丢百度云了,有些很小的包都下载了老半天,也是醉了。请不要叫我雷锋,我只是个搬运工。
http://pan.baidu.com/s/1c0dh1Xu
提醒:第七点和第八点顺序不能乱了。

匿名 #134 · 2015年08月18日

请问楼主 这个平台的兼容性如何?可以支持大概多少款市面上的手机?

作者分享个 docker image?

mark,今天就来搭
##update

楼主,安装 gm 的时候不成功,需要安装 libfreetype 和 libjpeg 依赖,这两个东西很难搞,费了半天时间才搞好

那天也刚好看到这东西。

#43 楼 @mads Mac, 因为这教程是 Linux

#42 楼 @yuweixx windows 平台下?

#41 楼 @mads 我就是搭着玩玩

#39 楼 @yuweixx adb server 能检测到应该就可以

#39 楼 @yuweixx ubuntu?搭这个干嘛用的。。

#38 楼 @mads 我公司搭的是 USB 连的,不过好像可以 WIFI 连,还没试

#37 楼 @yuweixx 无线 wifi 连着,然后这个平台进行管理?

#36 楼 @mads 就是真机啊,远程控制

可以真机么

#33 楼 @andyguo 你的 80 端口对外了么?

这个有啥用的。。、

如何远程访问呢,试了这个还是不行,stf local --public-ip 10.18.60.244 有搞定的吗

#31 楼 @shixue33 不是 gif 是流。

楼主,多问一句,第一个图 GIF 怎么截的?

#28 楼 @kasi 请问用的哪个软件进行无线 adb 连接的?

#28 楼 @kasi 不用 root。

不用 root 吧。root 后的手机不安全

#20 楼 @wang04170 请问你们的手机全部是用 adbwireless 去弄的吗?全部 root 了?

整了一上午,终于搞定了。

感谢分享,android 手机多得话,用这个工具还不错

汪汪 #159 · 2015年07月24日 Author

#21 楼 @carl 这些问题我也碰到过的,windows 的 adb 有连接上限的,可以把连接的 ADB 和控制的 ADB 分开来,这样单台 PC 控制十几台还是没问题的,我试过 10 多台稳定运行了 8+ 小时的,如果更多就只能换 linux 了。 关于 IP 的问题其实把路由的 DHCP 关了,设备设置静态就不会变了

已收藏,看看在 WINDOWS 上是否能发挥作用。感谢分享

太好了,我去学习一下

#20 楼 @wang04170
我也用过无线 ADB 的,在普通 WIFI 上,连了 10 台机器,“同时” 跑一样的用例,有一两台连接阶段好的,执行阶段就断开连接了,是不太稳定。另外,无线 ADB 是基于 ip 地址的,如果 IP 变了,也会有影响。如果能匹配 MAC 地址就能避免 IP 地址变化产生的影响了。

汪汪 #163 · 2015年07月24日 Author

#14 楼 @carl 我们目前的路由大概单台可以支持 60 左右的设备,而且如果单台路由有上限,可以用多台,只需要把每台路由下的设备都端口映射出来。。然后在浏览器所在的网段用 adb connect 去连接对应路由的 IP 和映射的端口就可以连到设备了。当然无线确实有不方便的地方。。。环境影响太大,不稳定阿 -。-

#16 楼 @carl 无线 adb 能控制多少台? 我的意思是普通 wifi 只能支持 15 台 已经很强了。 这个工具的意义就在于为很多人解决的 android 机器管理系统的搭建。

#15 楼 @lihuazhang
无线 adb 也可以控制多台设备啊,强大归强大,具体用起来了才知道实际意义。有些工具很强大,没什么实际用途,这就很尴尬

#14 楼 @carl 这已经很强大了啊

普通 WIFI 仅支持 15 台设备连接,一大限制啊

我试过,但是可能我环境问题,执行效率较低!

匿名 #172 · 2015年07月23日

赞赞赞

赞下

看上去功能好强大!

好激动!!!

太正点了 搭起来用用?

统一管理,可以把源码研究一下,应用到项目中,多移动设备、浏览器管理

mark,学习一下。这个对云测有用,@seveniruby

项目太牛逼了,感谢分享!

这项目看起来很屌啊

太正点了!感谢分享!

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