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 ...
随机推荐
- pycharm代码中批量粘贴内容的快捷键
windows电脑中,竖向批量复制的快捷键:Alt
- 使用PXE+VNC方式安装CentOS 7
U盘坏了,用个下面的方法安装 安装配置dhcp yum -y install dhcp tftp-server 修改如下,网段改为你自己的网段 vim /etc/dhcp/dhcpd.conf sub ...
- Oracle sqlplus中退格键、DEL键、上下左右键无法使用乱码问题
功能描述:Oracle sqlplus中退格键.DEL键.上下左右键无法使用乱码 1.安装readline-8.0 ①下载readline-8.0.tar.gz文件,百度网盘下载路径: https:/ ...
- outh2
之前做天猫精灵对接,就碰到了outh鉴权,当时实现好之后没有细细缕,今天看了一个博主的介绍,贴一下 转载自http://www.ruanyifeng.com/blog/2014/05/oauth_2_ ...
- 深入理解java虚拟机--垃圾收集器
对象的销毁 对象的finalize方法只会执行一次,在finalize里可以自救不被销毁,二次被主动gc,必定会销毁 类销毁
- 获取NX装配结构信息
最近在做一个项目,需要获取NX装配结构信息,这里把代码分享给大家,希望对各位有帮助,注意以下几点: 1)代码获取了PART的属性.表达式等,因此一些细节可能需要您根据实际情况修改. 2)读写XML用的 ...
- tf.app.flags与argparse功能类似
https://blog.csdn.net/ei1990/article/details/76423277 tensorflow中tf.app.flags与argparse模块有点类似,通过它们都可以 ...
- 每日一个知识点系列:volatile的可见性原理
每日一个知识点系列的目的是针对某一个知识点进行概括性总结,可在一分钟内完成知识点的阅读理解,此处不涉及详细的原理性解读. img 看图说话 关键点1: 总线嗅探器(MESI 缓存一致性原理 ) 关键点 ...
- @ComponentScan比较
ComponetScan 定义扫描规则 value:指定要扫描的包 excludeFilters=Filter[] 指定扫描的时候按照什么规则排除哪些组件. includeFilters=Filter ...
- 《RESTful Web APIs》书中有一段POST API示例,现实中我们如何测试这个示例?书中没有说,Let's try it!
<RESTful Web APIs>书中有一段POST API示例: I then send the filled-out template as part of an HTTP POST ...