Mac安装stf
1.brew install rethinkdb graphicsmagick zeromq protobuf yasm pkg-config
2.node版本8.x我的是8.15.0
3.npm install -g stf 或者cnpm install -g stf
4.后天启动数据库:nohup rethinkdb &
5.启动STF的客户端:stf local --public-ip 本机IP --allow-remote
例如:stf local --public-ip 192.168.1.102 --allow-remote
在浏览器访问:http://192.168.0.101:7100/
6.常用的接口脚本
#!/usr/bin/env bash
STF_TOKEN=4df3f1f8232d459aa83a4ffb15ed1d44695868e40fc7462892adc5ea0ac19d63
#STF_URL=http://39.105.132.200:7100
STF_URL=http://127.0.0.1:7100
DEVICE_SERIAL="emulator-5554"
# 申请设备
function add_device() {
response=$(curl -X POST -H "Content-Type: application/json" \
-H "Authorization: Bearer $STF_TOKEN" \
--data "{\"serial\": \"$DEVICE_SERIAL\"}" $STF_URL/api/v1/user/devices)
success=$(echo "$response" | jq .success | tr -d '"')
description=$(echo "$response" | jq .description | tr -d '"')
if [ "$success" != "true" ]; then
echo "Failed because $description"
echo exit 1
fi
echo "Device $DEVICE_SERIAL added successfully"
}
# 远程链接设备
function remote_connect() {
response=$(curl -X POST \
-H "Authorization: Bearer $STF_TOKEN" \
$STF_URL/api/v1/user/devices/$DEVICE_SERIAL/remoteConnect)
success=$(echo "$response" | jq .success | tr -d '"')
description=$(echo "$response" | jq .description | tr -d '"')
if [ "$success" != "true" ]; then
echo "Failed because $description"
echo exit 1
fi
remote_connect_url=$(echo "$response" | jq .remoteConnectUrl | tr -d '"')
echo $remote_connect_url
adb connect $remote_connect_url
echo "Device $DEVICE_SERIAL remote connected successfully"
}
# 移除设备
function remove_device() {
# 断开设备链接
adb disconnect $remote_connect_url
response=$(curl -X DELETE \
-H "Authorization: Bearer $STF_TOKEN" \
$STF_URL/api/v1/user/devices/$DEVICE_SERIAL)
success=$(echo "$response" | jq .success | tr -d '"')
description=$(echo "$response" | jq .description | tr -d '"')
if [ "$success" != "true" ]; then
echo "Failed because $description"
echo exit 1
fi
echo "Device $DEVICE_SERIAL removed successfully"
}
function run_device() {
add_device
remote_connect
sleep 2
adb devices
remote_device=$remote_connect_url
java -jar /Users/anxiaodong/learn/appcrawler/appcrawler-2.4.0-jar-with-dependencies.jar \
-c /Users/anxiaodong/learn/appcrawler/xueqie.yml \
--capability "udid=${remote_device}, systemPort=1${remote_device#*:}, appPackage=com.xueqiu.android,appActivity=.view.WelcomeActivityAlias"
remove_device
}
function every_device() {
#获得可用设备列表
devices=$(curl -H "Authorization: Bearer $STF_TOKEN" $STF_URL/api/v1/devices | jq -r '.devices[] | select(.present==true)|.serial ')
for DEVICE_SERIAL in $devices; do
{
add_device
remote_connect
sleep 2
remote_device=$remote_connect_url
eval $1
adb disconnect $remote_device
sleep 2
remove_device
} &
done
}
Mac安装stf的更多相关文章
- Mac 之 STF 搭建(淘宝源安装)
参考链接:https://www.jianshu.com/p/5fe8cb7d214f (MAC直接安装STF)https://www.jianshu.com/p/c5c298486dbd(homeb ...
- Mac上安装stf
一,安装 STF的依赖比较多,如下: Node.js >= 0.12ADB properly set upRethinkDB >= 2.2GraphicsMagick (for resiz ...
- MAC 下 STF 的环境搭建和运行
STF --WEB 端批量移动设备管理控制工具 安装各种包 (首先安装Macport,因为后面需要用到port:http://www.ccvita.com/434.html) linux的基本包安装, ...
- 【openstf】自己的云测平台——mac安装openstf
openstf的github地址:https://github.com/openstf/stf 上图可以清晰看出openstf的使用场景和效果 openstf是一个web应用程序,用于远程调试智能 ...
- mac安装tensorflow报错
问题:mac安装tensorflow过程中,爆出oserror:permission denied 解决方案:关闭mac的sip,然后sudo安装 关闭sip的方法:重启mac,按住command+R ...
- Mac 安装activate-power-mode atom
Mac 安装activate-power-mode atom 标签: atommac 2015-12-02 14:53 308人阅读 评论(0) 收藏 举报 分类: git(2) 版权声明:本文为 ...
- Mac安装ctags
Mac安装ctags mac 系统有自带的ctags,但是不支持"ctags -R"指令,需要自己在安装Exuberant Ctags 1.下载ctags 2. 安装 ./conf ...
- ubuntu 安装 swoole 和mac 安装swoole 扩展
ubuntu php 安装swoole 比较容易 1. 从git下载源码 2. 下载pcre http://sourceforge.net/projects/pcre/files/pcre/8.36/ ...
- [Scrapy] Mac安装Scrapy
Mac安装Scrapy Mac版本 10.11 El Captain. 前一段想在Mac上用Scrapy,各种问题.有一个不错的工具:Anaconda. 安装Anaconda 下载地址 我还是下pyt ...
随机推荐
- python修改excel内容
前提:安装pip install xlutils和xlrd 思路:xlrd用来读数据,xlutils用来修改数据:先打开excel——读到原来的sheet页——生成可以修改的excel和sheet页— ...
- 从一次编译出发梳理概念: Jetty,Jersey,hk2,glassFish,Javax,Jakarta
从一次编译出发梳理概念: Jetty,Jersey,hk2,glassFish,Javax,Jakarta 目录 从一次编译出发梳理概念: Jetty,Jersey,hk2,glassFish,Jav ...
- spring boot之Thymeleaf
没怎么仔细研究,就是spring boot的服务器需要一个登录界面,用这个实现了一个白板式的页面. https://blog.csdn.net/yelllowcong/article/details/ ...
- RabbitMQ安装、集群搭建、概念解析
RabbitMQ安装.集群搭建.概念解析 基本概念 为什么会产生MQ 1.解耦:采用异步方式实现业务需求达到解耦的目的. 2.缓冲流量,削峰填谷: 问:为什么会有流量冲击? 答:采用"直接调 ...
- ==、equals()、hashcode()的关系和区别
==.equals().hashcode()概念 ==:它的作用是判断两个对象的地址是不是相等.即,判断两个对象是不试同一个对象. equals():它的作用也是判断两个对象是否相等.但它一般有两种使 ...
- Oracle学习(十一)聚合函数
AVG() 求平均数 --查询某列的平均值 SELECT AVG(列) FROM 表 COUNT()查询条数 -- 查询所有记录的条数 select count(*) from 表; -- 查询对应列 ...
- python库之argparse
先运行一个干净的argparse 由于没有添加任何参数,所以只能用自带的 -h(--help)参数 现在来加一个参数 所以echo为必填项 描述在-h时会出现 type=int指定参数只能是数字,否则 ...
- django中url和reverse使用
使用url标签和reverse()函数,可以避免在模板和view中对url进行硬编码,这样即使url改变了,对模板和view也没有影响, 其实在模板, view中,如果想获取当前访问的url,那用re ...
- 【CF1425B】 Blue and Red of Our Faculty! 题解
原题链接 简要翻译: 有一个连通图,A和B同时从点1出发,沿不同的路径前进.原本,图上的每一条边都是灰色的.A将经过的边涂成红色,B将经过的边涂成蓝色的.每个回合每个人只能走灰色的边.当某个回合中不存 ...
- Django-当前菜单激活状态-模版 request | slice
如何满足这个需求? 1. view中传递过来一个当前页面的参数标识,通过模版语言进行判断 {% if current_page == 'index' %}active{% endif %} # 每一个 ...