首页 > 解决方案 > 如何配置 Travis CI 以便 `xcrun` 可以找到 `altool`(Mac OS X 10.14 上的 xcode 11.3)?

问题描述

在 Travis CI 上运行我的公证构建时,出现以下错误:

xcrun: error: unable to find utility “altool”, not a developer tool or in PATH

你可以在这里找到完整的构建输出:https ://travis-ci.org/github/trufflesuite/ganache/jobs/663747601#L3825

在此处完成 Travis 配置:https ://travis-ci.org/github/trufflesuite/ganache/jobs/663747601/config

我已经尝试运行sudo xcode-select -rsudo xcode-select -s /Applications/Xcode.app根据在 github 上找到的提示和堆栈溢出(https://stackoverflow.com/a/56617634/160173https://stackoverflow.com/a/53204124/160173),但无济于事。

我错过了什么?

标签: macostravis-cixcrunelectron-notarize

解决方案


我的问题是我的 Travis 配置实际上并没有使用 ; 的根级osx_image指令"xcode11.3"include由于我使用了 Travis矩阵,该指令被忽略。osx_image使用矩阵时指定的正确方法include如下:

matrix:
  include:
  - os: osx
    osx_image: "xcode11.3"
  - os: linux
    dist: bionic

进行此更改后,我无需尝试上述xcode-select问题中链接的解决方案。


推荐阅读