安装特定版本的 Aptos CLI(高级)
使用已有发行版本
Section titled “使用已有发行版本”使用 Aptos CLI 安装脚本
Section titled “使用 Aptos CLI 安装脚本”如果已使用 macOS 或 Linux 安装脚本,可以通过以下命令安装指定版本的 Aptos CLI:
curl -fsSL "https://aptos.dev/scripts/install_cli.sh" | sh -s -- --cli-version 7.9.0使用 asdf
Section titled “使用 asdf”如果已使用 asdf,可以通过以下命令安装指定版本的 Aptos CLI:
asdf install aptos 7.9.0使用 mise
Section titled “使用 mise”如果已使用 mise,可以通过以下命令安装指定版本的 Aptos CLI:
mise install aptos@7.9.0如果需要指定版本的 Aptos CLI,可以直接从 Aptos 源码构建。该安装方式主要用于与 Devnet 上尚未进入 Testnet 或 Mainnet 的特定功能交互。如果现有发行版本或预编译二进制文件无法很好地适配你的系统架构,也可以按照这些步骤操作。
如果不需要这种高级安装方式,请参阅常规安装步骤。
在 macOS / Linux 上安装
Section titled “在 macOS / Linux 上安装”-
检出 Aptos 源码。
Terminal window git clone https://github.com/aptos-labs/aptos-core.git -
确保已安装 cargo。
-
构建 Aptos CLI:
Terminal window cargo build --package aptos --profile cli二进制文件位于
target/cli/aptos。 -
(可选)将该可执行文件移动到 PATH 中的目录。
-
验证安装是否成功。
Terminal window target/cli/aptos help这些帮助信息也是特定命令的实用详细指南。
在 Windows 上安装
Section titled “在 Windows 上安装”-
检出 Aptos 源码。
Terminal window git clone https://github.com/aptos-labs/aptos-core.git -
确保已安装 cargo。
-
构建 Aptos CLI。
Terminal window cargo build --package aptos --profile cli二进制文件位于
target\cli\aptos.exe。 -
(可选)将该可执行文件移动到 PATH 中的目录。
-
验证安装是否成功。
Terminal window target\cli\aptos.exe help这些帮助信息也是特定命令的实用详细指南。