STF 集成之iOS开源 踩坑

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

环境准备

安装libimobiledevice等依赖工具。ios

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-configgit

clone代码WebDriverAgent,假设代码存放路径为/Users/test/Desktop/WebDriverAgent/,这个路径在启动ios-provider是经过--wda-path传入。配置好WebDriverAgent,在项目根目录运行github

./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为本机 ipweb

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