STF 全新 Mac 安装 STF 全记录

namedlock · 2023年02月07日 · 最后由 codingman 回复于 2023年08月29日 · 4579 次阅读

STF 介绍

STF 是一个移动设备群控方案的开源实现,原名是 OpenSTF,由 CyberAgent, HeadSpin 以及其他贡献者等支持。后来就由 device farm 接手了,并改名为 @devicefarmer/stf

安装环境

  • 硬件: Mac Air M1 芯片
  • 操作系统版本:Mac Ventura

安装步骤

使用 app store 安装 xcode

安装 brew

访问 https://brew.sh/ 安装,即

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

安装 npm

先安装 nvm,然后安装 node 8.9.1 版本

brew install nvm
nvm install 8.9.1
brew install python3

安装 stf

按照 https://github.com/DeviceFarmer/stf 提供的指引安装,

brew install rethinkdb graphicsmagick zeromq protobuf yasm pkg-config cmake
npm install -g @devicefarmer/stf --python=python2.7

最开始是执行以下命令安装@devicefarmer/stf 的,

npm install -g @devicefarmer/stf

但是报错了

Python executable "python" is v3.9.6, which is not supported by gyp

后面经过排查,有人说要加--python=python2.7 参数

安装 Android SDK

按照之前的文章Unix/Linux 环境下 安装 android sdk 步骤 执行即可

运行

rethinkdb &
stf local

然后访问

http://127.0.0.1:7100/

就能看到登录页面了

输入:

  • name 为 adminstrator
  • E-mail 为 administrator@fakedomain.com

登录后就看到设备了

碰到的其他问题

xcode-select: error

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

解决办法:

1. 安装 Xcode
2. 执行 sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

碰到 npmERR!

npmERR! fatal: unable to access 'https://github.com/fintechx/swagger-node-runner.git/': LibreSSL SSL_read: error:02FFF03C:system library:func(4095):Operation timed out, errno 60

解决办法也很简单,重试多次。

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
共收到 3 条回复 时间 点赞

都新电脑了,不妨试试 sonic,完美替代😆

cc 回复

可以的 正打算学一下 go,研究一下 sonic

请问需要 Rosetta 执行么?

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册