关于自动化:STF-集成之iOS开源-踩坑

10次阅读

共计 941 个字符,预计需要花费 3 分钟才能阅读完成。

本文是基于集成 mrx102 开源 stf 和 webdriverAgent, 所遇到的坑作一些总结.
我的项目地址:
https://github.com/mrx1203/stf.git
https://github.com/mrx1203/WebDriverAgent.git

环境筹备

装置 libimobiledevice 等依赖工具。

brew install usbmuxd
brew link usbmuxd
brew install libimobiledevice
brew install ideviceinstaller
brew install carthage
brew install socat

装置 stf 依赖:brew install graphicsmagick zeromq protobuf yasm pkg-config

clone 代码 WebDriverAgent,假如代码寄存门路为 /Users/test/Desktop/WebDriverAgent/,这个门路在启动 ios-provider 是通过 –wda-path 传入。配置好 WebDriverAgent,在我的项目根目录运行

./Scripts/bootstrap.sh

启动 ios-provider

因为 ios-provider 须要应用 xcodebuild 等 mac 下的命令行工具,而 docker 容器中并没有提供这类工具,所以不能用 docker 来部署 ios-provider,只能通过源码形式部署。部署步骤如下:
(1)拉取源代码 git clone https://github.com/mrx1203/stf.git
(2)切换到 stf 目录下, 装置依赖库 npm install;npm install –save request;npm install –save request-promise
这里有个坑就是:node 版本要用 8.9.3 版本的,要不然有问题, 用 nvm 装置 8.9.3 版本的 node
(3)启动 stf,cd 到 stf 我的项目的 bin 目录下,执行上面命令,ip 为本机 ip

./stf local --public-ip 172.10.24.85 --wda-path /Users/so/Desktop/stf_autorunJs/WebDriverAgent --wda-port 8100
正文完
 0