安装
首推用Docker安装,超快,参考博文:docker安装部署STF
$ docker pull openstf/stf 拉取STF镜像
$ docker pull sorccu/adb 拉取adb 镜像
$ docker pull rethinkdb 拉取rethinkdb 镜像
$ docker run -d --name rethinkdb -v /srv/rethinkdb:/data --net host rethinkdb rethinkdb --bind all --cache-size 8192 --http-port 8090
$ docker run -d --name adbd --privileged -v /dev/bus/usb:/dev/bus/usb --net host sorccu/adb:latest
$ docker run -d --name stf --net host openstf/stf stf local --public-ip 192.168.164.100 --allow-remote
远程centos服务器(**.***.215.44):安装并运行stf服务
个人mac电脑:安装adb
1、服务器启动rethinkdb
rethinkdb --bind all --cache-size 8192 --http-port 8090
2、服务器启动stf,IP是stf运行的本机ip
stf local --public-ip **.***.215.44 --allow-remote
3、mac电脑:
连接Android设备开启ADB调试
adb -P 5037 -a nodaemon server
4、服务器启用stf provider
stf provider --name mikezhoudeMac-mini.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 **.***.215.44 --storage-url http://localhost:7100/ --adb-host **.**.119.21 --adb-port 5037 --vnc-initial-size 600x800 --allow-remote
安装openSTF教程参考:https://www.jianshu.com/p/539ee1053da3
https://blog.csdn.net/zhengshaolong8125/article/details/79825891
https://testerhome.com/topics/7966
单独使用STF中的adb远程调试功能:adbkit
OpenSTF中有一个远程Debug的功能,可以执行完adb connect一个地址后,就可以对远方的手机进行各种adb操作了。
这个功能STF早已把它开源 https://github.com/openstf/adbkit 但只是没有写到文档里去而已。原本只能使用js代码来调用这个功能,我提了一个简单的pr,使得该功能可以用在命令行下调用。下面具体说下使用方法
使用方法
安装nodejs
推荐使用nvm安装
安装adbkit
$ npm i -g adbkit
启动usb转tcp服务
$ adbkit usb-device-to-tcp -p $port $serial
再另一台装有adb的机器上进行设备的连接
假设启动adbkit服务的机器ip是10.0.0.1 端口是15555
$ adb connect 10.0.0.1:15555