STF 集成之iOS开源 踩坑

本文是基于集成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

你可能感兴趣的:(自动化自动化测试)