跳至內容

安裝 Tuist

Tuist 命令列介面可在 macOS 和 Linux 上執行,並將你的 Xcode、生成項目、Gradle、Bazel 和 Rust 項目連接到 Tuist 的快取、洞察和 runner 基礎設施。雖然你可以從原始碼編譯 Tuist,但我們建議使用以下其中一種安裝方法,以確保安裝有效且可驗證。Elixir 項目則改用 tuist_ex Hex 套件,不需要 CLI。

Mise#

Note

如果你尚未安裝 Mise,請先參閱入門指南。如果你的團隊或組織需要確保在不同環境中使用確定性的工具版本,Mise 是 Homebrew 的推薦替代方案。

與 Homebrew 等工具不同(後者會在全域安裝並啟用單一版本的工具),Mise 會鎖定版本,可以是全域鎖定,也可以是針對特定項目鎖定。執行 mise use 以安裝並啟用 Tuist:

bash
mise use [email protected] # Install and pin tuist-x.y.z in the current project
mise use tuist@latest # Install and pin the latest tuist in the current project
mise use -g [email protected] # Install and pin tuist-x.y.z as the global default
mise use -g tuist@system # Use the system's tuist as the global default

如果你克隆的項目已在 mise.toml 中鎖定了 Tuist 版本,請執行 mise install 來安裝它。

Tip

tuist@latest 會解析為最新的穩定版本。Tuist 也會發布預發布的 canary 和 release candidate 構建;這些版本需要手動選擇加入,而且絕不會由 latest 解析。請參閱發布渠道,了解如何鎖定你可信賴的穩定版本線,以及如何選擇加入預發布版本。

Linux 支援

在 Linux 上,Tuist 僅可透過 Mise 取得。依賴 Xcode 的命令(例如 tuist generate)在 Linux 上不可用,但平台無關的命令(如 tuist inspect bundle)則可按預期運作。

Homebrew(僅限 macOS)#

你可以使用 Homebrew 和 我們的 formula 來安裝 Tuist:

bash
brew tap tuist/tuist
brew install --formula tuist
brew install --formula [email protected]
驗證二進位檔的真確性

你可以執行以下命令來驗證安裝的二進位檔是否由我們構建,該命令會檢查證書的團隊 ID 是否為 U6LC622NKF:

bash
curl -fsSL "https://tuist.dev/verify.sh" | bash

HTTP 代理#

如果你的網路將出站流量透過 HTTP 代理路由,請參閱HTTP 代理指南。

下一步#