迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:ATX开源软件地址:https://gitee.com/hagyao520/ATX开源软件介绍:ATX-SERVERManage batch of atx-agents Testerhome上相关文章Install重要:需要有go语言的基础,知道该如何编译一个go的程序 Compile with go $ go get -v github.com/openatx/atx-server$ cd $GOPATH/src/github.com/openatx/atx-server$ go build Usagelaunch $ rethinkdbRunning rethinkdb 2.3.6 (CLANG 8.1.0 (clang-802.0.42))...Running on Darwin 16.6.0 x86_64... launch ./atx-server --port 8000 Install Suppose server running $ pip install -U --pre uiautomator2$ python -m uiautomator2 init 10.0.1.1:8000 open browser http://localhost:8000, you should see the device listed on the web. Advanced usageSet up https://www.dingtalk.com notification.
APIs/list 接口其中udid是通过hwaddr, model, serial组合生成的 $ curl $SERVER_URL/list[ { "udid": "741AEDR42P6YM-2c:57:31:4b:40:74-M2_E", "ip": "10.240.218.20", "present": true, "ready": true, "using": true, "provider": null, "serial": "741AEDR42P6YM", "brand": "Meizu", "model": "M2 E", "hwaddr": "2c:57:31:4b:40:74", "agentVersion": "0.1.1", "battery": {}, "display": { "width": 1080, "height": 1920 } }] There are some fields you need pay attention.
"provider": { "id": "33576428", "ip": "10.0.0.1", "port": 10000, "present": true # provider online of not} if /devices/{query}/info$ curl $SERVER_URL/devices/ip:10.0.0.1/info# or$ curl $SERVER_URL/devices/$UDID/info 返回值同/list的的单个结果,这里就不写了。 /version
$ curl /version{ "server": "dev", "atx-agent": "0.0.7"} 执行shell命令$ curl -X POST -F command="pwd" $SERVER_URL/devices/{query}/shell{ "output": "/"} 设备管理占用、释放 状态码 成功200,失败403 占用设备$ curl -X POST $SERVER_URL/devices/{query}/reservedSuccess 释放设备状态码 成功200,失败403 $ curl -X DELETE $SERVER_URL/devices/{query}/reservedRelease success 随机占用一台设备 $ curl -X POST $SERVER_URL/devices/:random/reservedSuccess Communication between provider(u2init) and server(atx-server)Provider send POST to Serverheartbeat info to let server known provider is online. It is also need to send the same data to Server in 15s or the Provider will be marked offline. $ curl -X POST -F id=$PROVIDER_ID -F port=11000 $SERVER_URL/provider/heartbeat You may need to add ip field if provider and server is not in the same network $ PROVIDER_IP=10.0.0.1 # change to your provider ip$ PROVIDER_ID=ccdd11ff # change to your provider id$ curl -X POST \ -F ip=$PROVIDER_IP \ -F id=$PROVIDER_ID \ -F port=11000 \ $SERVER_URL/provider/heartbeat Server response status 200 indicate success, or 400 and else means failure Send using bellow command when there is device plugged-in $ DEVICE_UDID="3578298f-b4:0b:44:e6:1f:90-OD103" # change to your device udid$ DATA="{\"status\": \"online\", \"udid\": \"$DEVICE_UDID\"}"$ curl -X POST \ -F id=$PROVIDER_ID \ -F port=11000 \ -F data="$DATA" $SERVER_URL/provider/heartbeat Comminication between atx-agent and atx-serverIt is complicated. Hard to write. Docker
docker-compuse up --build
References and some good resources
LICENSE![]() |
请发表评论