关于自动化: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

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理