stf环境安装(ios&android)

stf项目地址

https://github.com/mrx1203/stf
https://github.com/mrx1203/WebDriverAgent

第一步:安装版本为8.9.1的node

使用nvm控制node版本

brew install nvm
nvm install 8.9.1

安装nvm的时候以下文字记得粘贴到~/.bash_profile里面去
在这里插入图片描述
指定默认版本为v8.9.1

nvm alias default 8.9.1

第二步:环境准备

brew install usbmuxd

brew link usbmuxd

brew install libimobiledevice --HEAD (这个可能会出现更新不到最新版本所以需要加head)

brew install ideviceinstaller

brew install carthage

brew install socat

其中usbmuxd,libimobiledevice我是采用源码安装的,源码安装地址:https://github.com/libimobiledevice,像libsbmuxd,libplist,libimobiledevice-glue都可以在里面源码安装,源码安装有一个好处,用brew安装libimobiledevice后,idevicesscreenshot无法截屏ios14以上的手机,源码安装是完全没问题的,大概是brew里的源还没有跟新,用–HEAD安装也没用(这个问题研究了好久)

openssl源码安装地址:https://github.com/openssl/openssl,openssl文件挺大,编译起来挺费劲

./config
make
sudo make install

安装stf依赖

brew install graphicsmagick zeromq protobuf yasm pkg-config

检查是否缺少依赖

stf doctor

问题1

brew装包失败,问题如下
在这里插入图片描述
解决办法:换bottle源

echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile

问题2

npm安装phantomjs失败
在这里插入图片描述
解决办法:
自行将报错中的https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-macosx.zip下载到对应的/var/folders/y6/yq_j426j10d994q42mfy9p380000gn/T/phantomjs/phantomjs-2.1.1-macosx.zip,重新npm install phantomjs-prebuilt@2.1.16

问题3

bower install 安装出错
在这里插入图片描述

解决办法:设置git使用git://协议代替https://协议

git config --global url."git://".insteadOf https://

问题4

npm install sharp时在libvips模块出错
在这里插入图片描述
解决办法:

npm config get cache

查看自己的cache地址,我的是/Users/admin/.npm
将下不来的libvips的zip包放在/Users/admin/.npm/_libvips文件夹下面,重新install

开启服务

./stf local
ios远端开启服务:
stf ios-provider --name <你的名字> --connect-sub tcp://<远端ip>:7250 --connect-push tcp://<远端ip>:7270 --storage-url http://<远端ip>:7100/ --public-ip <本机ip> --heartbeat-interval 20000 --wda-path /Users/admin/WebDriverAgent/ --wda-port 8100
android远端开启服务:
./stf provider --name <你的名字> --min-port 7400 —-max-port 7700 --connect-sub tcp://<远端ip>:7114 --connect-push tcp://<远端ip>:7116 --group-timeout 20000 --public-ip <本机ip> --storage-url http://<远端ip>:7100/ --vnc-initial-size 600x800

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值