通过 Scoop 安装

Scoop 是 Windows 的命令行安装器。它可以通过以下 PowerShell 命令安装。

# Optional: Needed to run a remote script the first time
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
# Command for installing Scoop
Invoke-RestMethod get.scoop.sh | Invoke-Expression
  1. 安装通用依赖项

    scoop bucket add versions
    scoop install python39
    
  2. 安装 Windows 平台依赖项

    所需的 C++ 工具链和 Windows SDK 作为 Visual Studio 2022 的一部分安装。以下说明适用于 Community 版本,但您可能希望根据您的使用情况和团队规模使用不同的 Visual Studio 版本

    此代码片段必须在传统的命令提示符 (cmd.exe) 中运行。

    curl -sOL https://aka.ms/vs/17/release/vs_community.exe
    start /w vs_community.exe --passive --wait --norestart --nocache --add Microsoft.VisualStudio.Component.Windows11SDK.22000 --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.VC.Tools.ARM64
    del /q vs_community.exe
    
  3. 安装 Swift

    scoop install swift