# 手动安装 Flutter

> 了解如何手动安装并配置 Flutter SDK。



Learn how to install and manually set up
your Flutter development environment.

了解如何手动安装并配置
你的 Flutter 开发环境。

:::tip
If you're just looking to quickly install Flutter,
consider [installing Flutter with VS Code][with-vs-code] for
a streamlined setup experience.

若你只想快速安装 Flutter，
可考虑 [使用 VS Code 安装 Flutter][with-vs-code]，
获得更简化的配置体验。
:::

[with-vs-code]: /install/with-vs-code

## Choose your development platform {: #dev-platform}

## 选择你的开发平台

The instructions on this page are configured to cover
installing Flutter on a **Windows**{:.selected-os-text} device.

本页说明默认针对在 **Windows**{:.selected-os-text} 设备上安装 Flutter。

If you'd like to follow the instructions for a different OS,
please select one of the following.

若要查看其他操作系统的说明，
请选择以下选项之一。

<OSSelector />

## Download prerequisite software {: #download-prerequisites}

## 下载必备软件

Before installing the Flutter SDK,
first complete the following setup.

在安装 Flutter SDK 之前，
请先完成以下配置。

 1. <h3>Install Git for Windows</h3>

    <h3>为 Windows 安装 Git</h3>

    Download and install the latest version of [Git for Windows][].

    下载并安装最新版本的 [Git for Windows][]。

    For help installing or troubleshooting Git,
    reference the [Git documentation][git-install].

    有关安装或排查 Git 问题的帮助，
    请参阅 [Git 文档][git-install]。

 1. <h3>Set up an editor or IDE</h3>

    <h3>配置编辑器或 IDE</h3>

    For the best experience developing Flutter apps,
    consider installing and setting up an
    [editor or IDE with Flutter support][editors]{: target="_blank"}.

    为获得最佳的 Flutter 应用开发体验，
    请考虑安装并配置
    [支持 Flutter 的编辑器或 IDE][editors]{: target="_blank"}。

{: .steps .windows-only}

 1. <h3>Install the Xcode command-line tools</h3>

    <h3>安装 Xcode 命令行工具</h3>

    Download the Xcode command-line tools to get access to
    the command-line tools that Flutter relies on, including Git.

    下载 Xcode 命令行工具以获取 Flutter 依赖的命令行工具（包括 Git）。

    To download the tools, run the following command in your preferred terminal:

    要下载这些工具，请在你偏好的终端中运行以下命令：

    ```console
    $ xcode-select --install
    ```

    If you haven't installed the tools already,
    a dialog should open that confirms you'd like to install them.
    Click **Install**, then once the installation is complete, click **Done**.

    若你尚未安装这些工具，
    应会弹出对话框确认你是否要安装。
    点击 **Install**，安装完成后点击 **Done**。

 1. <h3>Set up an editor or IDE</h3>

    <h3>配置编辑器或 IDE</h3>

    For the best experience developing Flutter apps,
    consider installing and setting up an
    [editor or IDE with Flutter support][editors]{: target="_blank"}.

    为获得最佳的 Flutter 应用开发体验，
    请考虑安装并配置
    [支持 Flutter 的编辑器或 IDE][editors]{: target="_blank"}。

{: .steps .macos-only}

 1. <h3>Download and install prerequisite packages</h3>

    <h3>下载并安装必备 package</h3>

    Using your preferred package manager or mechanism,
    install the latest versions of the following packages:

    使用你偏好的 package 管理器或安装方式，
    安装以下 package 的最新版本：

    - `curl`
    - `git`
    - `unzip`
    - `xz-utils`
    - `zip`
    - `libglu1-mesa`

    On Debian-based distros with `apt-get`, such as Ubuntu,
    install these packages using the following commands:

    在基于 Debian 且使用 `apt-get` 的发行版（例如 Ubuntu）上，
    请使用以下命令安装这些 package：

    ```console
    $ sudo apt-get update -y && sudo apt-get upgrade -y
    $ sudo apt-get install -y curl git unzip xz-utils zip libglu1-mesa
    ```

1. <h3>Set up an editor or IDE</h3>

   <h3>配置编辑器或 IDE</h3>

   For the best experience developing Flutter apps,
   consider installing and setting up an
   [editor or IDE with Flutter support][editors]{: target="_blank"}.

   为获得最佳的 Flutter 应用开发体验，
   请考虑安装并配置
   [支持 Flutter 的编辑器或 IDE][editors]{: target="_blank"}。

{: .steps .linux-only}

 1. <h3>Set up Linux support</h3>

    <h3>配置 Linux 支持</h3>

    If you haven't set up Linux support on your Chromebook before,
    [Turn on Linux support][chromeos-linux].

    若你此前未在 Chromebook 上配置 Linux 支持，
    请参阅 [开启 Linux 支持][chromeos-linux]。

    If you've already turned on Linux support,
    ensure it's up to date following the
    [Fix problems with Linux][chromeos-linux-update] instructions.

    若你已开启 Linux 支持，
    请按照 [修复 Linux 相关问题][chromeos-linux-update] 的说明确保其为最新状态。

 1. <h3>Download and install prerequisite packages</h3>

    <h3>下载并安装必备 package</h3>

    Using `apt-get` or your preferred installation mechanism,
    install the latest versions of the following packages:

    使用 `apt-get` 或你偏好的安装方式，
    安装以下 package 的最新版本：

    - `curl`
    - `git`
    - `unzip`
    - `xz-utils`
    - `zip`
    - `libglu1-mesa`

    If you want to use `apt-get`,
    install these packages using the following commands:

    若要使用 `apt-get`，
    请使用以下命令安装这些 package：

    ```console
    $ sudo apt-get update -y && sudo apt-get upgrade -y
    $ sudo apt-get install -y curl git unzip xz-utils zip libglu1-mesa
    ```

 1. <h3>Set up an editor or IDE</h3>

    <h3>配置编辑器或 IDE</h3>

    For the best experience developing Flutter apps,
    consider installing and setting up an
    [editor or IDE with Flutter support][editors]{: target="_blank"}.

    为获得最佳的 Flutter 应用开发体验，
    请考虑安装并配置
    [支持 Flutter 的编辑器或 IDE][editors]{: target="_blank"}。

{: .steps .chromeos-only}

[editors]: /tools/editors
[Git for Windows]: https://git-scm.com/downloads/win
[git-install]: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
[chromeos-linux]: https://support.google.com/chromebook/answer/9145439
[chromeos-linux-update]: https://support.google.com/chromebook/answer/9145439?hl=en#:~:text=Fix%20problems%20with%20Linux

## Install and set up Flutter {: #install-flutter}

## 安装并配置 Flutter

To install the Flutter SDK,
download the latest bundle from the SDK archive,
then extract the SDK to where you want it stored.

要安装 Flutter SDK，
请从 SDK 归档下载最新 bundle，
然后将其解压到你希望存放的位置。

 1. <h3>Download the Flutter SDK bundle</h3>

    <h3>下载 Flutter SDK bundle</h3>

    Download the following installation bundle to get the
    latest stable release of the Flutter SDK.

    下载以下安装 bundle 以获取
    Flutter SDK 的最新稳定版。

    <DownloadLatestButton os="windows" />

 1. <h3>Create a folder to store the SDK</h3>

    <h3>创建用于存放 SDK 的文件夹</h3>

    Create or find a folder to store the extracted SDK in.
    Consider creating and using a directory at
    `%USERPROFILE%\develop` (`C:\Users\{username}\develop`).

    创建或找到一个用于存放解压后 SDK 的文件夹。
    可考虑在 `%USERPROFILE%\develop`（`C:\Users\{username}\develop`）创建并使用该目录。

    :::note
    Select a location that
    doesn't have special characters or spaces in its path and
    doesn't require elevated privileges.

    选择的路径中不要包含特殊字符或空格，
    且不需要提升权限。
    :::

 1. <h3>Extract the SDK</h3>

    <h3>解压 SDK</h3>

    Extract the SDK bundle you downloaded into
    the directory you want to store the Flutter SDK in.

    将你下载的 SDK bundle 解压到
    你希望存放 Flutter SDK 的目录。

    1. Copy the following command.

       复制以下命令。

    1. Replace `<sdk_zip_path>` with the path to the bundle you downloaded.

       将 `<sdk_zip_path>` 替换为你下载的 bundle 路径。

    1. Replace `<destination_directory_path>` with the path to the
       folder you want the extracted SDK to be in.

       将 `<destination_directory_path>` 替换为
       你希望存放解压后 SDK 的文件夹路径。

    1. Run the edited command in your preferred terminal.

       在你偏好的终端中运行编辑后的命令。

    ```console
    $ Expand-Archive –Path <sdk_zip_path> -Destination <destination_directory_path>
    ```

    For example, if you downloaded the bundle for Flutter 3.29.3 into
    the `%USERPROFILE%\Downloads` directory and want to
    store the extracted SDK in the `%USERPROFILE%\develop` directory:

    例如，若你将 Flutter 3.29.3 的 bundle 下载到
    `%USERPROFILE%\Downloads` 目录，并希望将解压后的 SDK 存放在
    `%USERPROFILE%\develop` 目录：

    ```console
    $ Expand-Archive `
      -Path $env:USERPROFILE\Downloads\flutter_windows_3.29.3-stable.zip `
      -Destination $env:USERPROFILE\develop\
    ```

    :::note
    If the `flutter.bat` file is missing from the `bin` directory
    after extraction, your antivirus software might have quarantined it.
    If this happens, configure your antivirus to trust the Flutter SDK directory,
    then extract the bundle again.

    若解压后 `bin` 目录中缺少 `flutter.bat` 文件，
    可能是杀毒软件将其隔离了。
    若出现此情况，请将 Flutter SDK 目录加入杀毒软件信任列表，
    然后重新解压 bundle。
    :::

{: .steps .windows-only}

<div class="macos-only">

:::warning
**Note for Intel Macs:**
Flutter is deprecating support for Intel-based Macs (x64).
Future Flutter releases will require Apple Silicon.
For details, check out the
[macOS Intel deprecation strategy](https://docs.google.com/document/d/1ty3js_Eg2sNIbDuyYS_aV7h4jYdx1hEpX_mV135gO4s/edit?tab=t.0#heading=h.cx7d8y57ce6p).

**关于 Intel Mac 的说明：**
Flutter 正在逐步停止对基于 Intel 的 Mac (x64) 的支持。
未来的 Flutter 版本将要求使用 Apple Silicon。
详情请查看 
[macOS Intel 弃用策略](https://docs.google.com/document/d/1ty3js_Eg2sNIbDuyYS_aV7h4jYdx1hEpX_mV135gO4s/edit?tab=t.0#heading=h.cx7d8y57ce6p).
:::

</div>

 1. <h3>Download the Flutter SDK bundle</h3>

    <h3>下载 Flutter SDK bundle</h3>

    To choose the correct bundle,
    you need to know your Mac's processor type.
    *(To check, go to **Apple menu () > About This Mac**
    and look at the **Processor** or **Chip** section.)*

    你需要了解你的 Mac 处理器类型，来选择正确的软件包。
    （前往 **Apple 菜单 () > 关于本机**，
    并查看 **处理器** 或 **芯片** 部分。）

    Depending on your macOS device's cpu architecture,
    download one of the following installation bundles to get the
    latest stable release of the Flutter SDK.

    根据你的 macOS 设备的 CPU 架构，
    下载以下任一安装 bundle 以获取
    Flutter SDK 的最新稳定版。

    | Apple Silicon (ARM64)                                                 | Intel                                                               |
    | --------------------------------------------------------------------- | ------------------------------------------------------------------- |
    | <DownloadLatestButton os="macos" arch="arm64"></DownloadLatestButton> | <DownloadLatestButton os="macos" arch="x64"></DownloadLatestButton> |

 1. <h3>Create a folder to store the SDK</h3>

    <h3>创建用于存放 SDK 的文件夹</h3>

    Create or find a folder to store the extracted SDK in.
    Consider creating and using a directory at `~/develop/`.

    创建或找到一个用于存放解压后 SDK 的文件夹。
    可考虑在 `~/develop/` 创建并使用该目录。

 1. <h3>Extract the SDK</h3>

    <h3>解压 SDK</h3>

    Extract the SDK bundle you downloaded into
    the directory you want to store the Flutter SDK in.

    将你下载的 SDK bundle 解压到
    你希望存放 Flutter SDK 的目录。

    1. Copy the following command.

       复制以下命令。

    1. Replace `<sdk_zip_path>` with the path to the bundle you downloaded.

       将 `<sdk_zip_path>` 替换为你下载的 bundle 路径。

    1. Replace `<destination_directory_path>` with the path to the
       folder you want the extracted SDK to be in.

       将 `<destination_directory_path>` 替换为
       你希望存放解压后 SDK 的文件夹路径。

    1. Run the edited command in your preferred terminal.

       在你偏好的终端中运行编辑后的命令。

    ```console
    $ unzip <sdk_zip_path> -d <destination_directory_path>
    ```

    For example, if you downloaded the bundle for Flutter 3.29.3 into
    the `~/Downloads` directory and want to
    store the extracted SDK in the `~/develop` directory:

    例如，若你将 Flutter 3.29.3 的 bundle 下载到
    `~/Downloads` 目录，并希望将解压后的 SDK 存放在 `~/develop` 目录：

    ```console
    $ unzip ~/Downloads/flutter_macos_3.29.3-stable.zip -d ~/develop/
    ```

{: .steps .macos-only}

 1. <h3>Download the Flutter SDK bundle</h3>

    <h3>下载 Flutter SDK bundle</h3>

    Download the following installation bundle to get the
    latest stable release of the Flutter SDK.

    下载以下安装 bundle 以获取
    Flutter SDK 的最新稳定版。

    <DownloadLatestButton os="linux" />

 1. <h3>Create a folder to store the SDK</h3>
    <h3>创建用于存放 SDK 的文件夹</h3>

    Create or find a folder to store the extracted SDK in.
    Consider creating and using a directory at `~/develop/`.

    创建或找到一个用于存放解压后 SDK 的文件夹。
    可考虑在 `~/develop/` 创建并使用该目录。

 1. <h3>Extract the SDK</h3>

    <h3>解压 SDK</h3>

    Extract the SDK bundle you downloaded into
    the directory you want to store the Flutter SDK in.

    将你下载的 SDK bundle 解压到
    你希望存放 Flutter SDK 的目录。

    1. Copy the following command.

       复制以下命令。

    1. Replace `<sdk_zip_path>` with the path to the bundle you downloaded.

       将 `<sdk_zip_path>` 替换为你下载的 bundle 路径。

    1. Replace `<destination_directory_path>` with the path to the
       folder you want the extracted SDK to be in.

       将 `<destination_directory_path>` 替换为
       你希望存放解压后 SDK 的文件夹路径。

    1. Run the edited command in your preferred terminal.

       在你偏好的终端中运行编辑后的命令。

    ```console
    $ tar -xf <sdk_zip_path> -C <destination_directory_path>
    ```

    For example, if you downloaded the bundle for Flutter 3.29.3 into
    the `~/Downloads` directory and want to
    store the extracted SDK in the `~/develop` directory:

    例如，若你将 Flutter 3.29.3 的 bundle 下载到
    `~/Downloads` 目录，并希望将解压后的 SDK 存放在 `~/develop` 目录：

    ```console
    $ tar -xf ~/Downloads/flutter_linux_3.29.3-stable.tar.xz -C ~/develop/
    ```

{: .steps .linux-only .chromeos-only}

## Add Flutter to your PATH {: #add-to-path}

## 将 Flutter 添加到 PATH

Now that you've downloaded the SDK,
add the Flutter SDK's `bin` directory to your `PATH` environment variable.
Adding Flutter to your `PATH` allows you to use the
`flutter` and `dart` command-line tools in terminals and IDEs.

现在你已经下载了 SDK，
请将 Flutter SDK 的 `bin` 目录添加到你的 `PATH` 环境变量。
将 Flutter 添加到你的 `PATH` 后，你就可以在终端和 IDE 中使用
`flutter` 和 `dart` 命令行工具。

<div class="windows-only">


 1. <h3>Determine your Flutter SDK installation location</h3>

    <h3>确定 Flutter SDK 安装位置</h3>

    Copy the absolute path to the directory that you
    downloaded and extracted the Flutter SDK into.

    复制你下载并解压 Flutter SDK 所在目录的绝对路径。

 1. <h3>Navigate to the environment variables settings</h3>

    <h3>进入环境变量设置</h3>

    1. Press <kbd>Windows</kbd> + <kbd>Pause</kbd>.

       按下快捷键 <kbd>Windows</kbd> + <kbd>Pause</kbd>。

       If your keyboard lacks a <kbd>Pause</kbd> key,
       try <kbd>Windows</kbd> + <kbd>Fn</kbd> + <kbd>B</kbd>.

       如果你的键盘上没有 <kbd>Pause</kbd> 键，
       请尝试 <kbd>Windows</kbd> + <kbd>Fn</kbd> + <kbd>B</kbd>。

       The **System > About** dialog opens.

       这将会显示 **系统 > 系统信息** 的窗口。

    1. Click **Advanced System Settings**
       <span aria-label="and then">></span> **Advanced**
       <span aria-label="and then">></span> **Environment Variables...**.

       单击 **高级系统设置**
       <span aria-label="and then">></span> **高级**
       <span aria-label="and then">></span> **环境变量…**

       The **Environment Variables** dialog opens.

       这将会显示 **环境变量** 的窗口。

 1. <h3>Add the Flutter SDK bin to your path</h3>

    <h3>将 Flutter SDK 的 bin 添加到你的 PATH</h3>

    1. In the **User variables for (username)** section
       of the **Environment Variables** dialog,
       look for the **Path** entry.

       在 **环境变量** 对话框的 **（用户名）的用户变量** 区域中，
       查找 **Path** 条目。

    1. If the **Path** entry exists, double-click it.

       若 **Path** 条目已存在，请双击它。

       The **Edit Environment Variable** dialog should open.

       此时应会打开 **编辑环境变量** 对话框。

       1. Double-click inside an empty row.

          双击空白行。

       1. Type the path to the `bin` directory of your Flutter installation.

          输入 Flutter 安装目录下 `bin` 的路径。

          For example, if you downloaded Flutter into a
          `develop\flutter` folder inside your user directory,
          you'd type the following:

          例如，若你将 Flutter 下载到用户目录下的
          `develop\flutter` 文件夹，则应输入：

          ```plaintext
          %USERPROFILE%\develop\flutter\bin
          ```

       1. Click the Flutter entry you added to select it.

          点击你添加的 Flutter 条目以将其选中。

       1. Click **Move Up** until the Flutter entry sits at the top of the list.

          点击 **上移**，直到 Flutter 条目位于列表顶部。

       1. To confirm your changes, click **OK** three times.

          要确认更改，请点击三次 **确定**。

       {: type="a"}

    1. If the entry doesn't exist, click **New...**.

       若该条目不存在，请点击 **新建…**。

       The **Edit Environment Variable** dialog should open.

       此时应会打开 **编辑环境变量** 对话框。

       1. In the **Variable Name** box, type `Path`.

          在 **变量名** 框中输入 `Path`。

       1. In the **Variable Value** box,
          type the path to the `bin` directory of your Flutter installation.

          在 **变量值** 框中，
          输入 Flutter 安装目录下 `bin` 的路径。

          For example, if you downloaded Flutter into a
          `develop\flutter` folder inside your user directory,
          you'd type the following:

          例如，若你将 Flutter 下载到用户目录下的
          `develop\flutter` 文件夹，则应输入：

          ```plaintext
          %USERPROFILE%\develop\flutter\bin
          ```

       1. To confirm your changes, click **OK** three times.

          要确认更改，请点击三次 **确定**。

       {: type="a"}

 1. <h3>Apply your changes</h3>

    <h3>应用你的更改</h3>

    To apply this change and get access to the `flutter` tool,
    close and reopen all open command prompts,
    sessions in your terminal apps, and IDEs.

    要应用此更改并访问 `flutter` 工具，
    请关闭并重新打开所有已打开的命令提示符、
    终端应用中的会话以及 IDE。

 1. <h3>Validate your setup</h3>

    <h3>验证你的配置</h3>

    To ensure you successfully added the SDK to your `PATH`,
    open command prompt or your preferred terminal app,
    then try running the `flutter` and `dart` tools.

    为确保你已成功将 SDK 添加到 `PATH`，
    请打开命令提示符或你偏好的终端应用，
    然后尝试运行 `flutter` 和 `dart` 工具。

    ```console
    $ flutter --version
    $ dart --version
    ```

    If either command isn't found,
    check out [Flutter installation troubleshooting][troubleshoot].

    若任一命令未找到，
    请参阅 [Flutter 安装问题排查][troubleshoot]。

{: .steps}

[troubleshoot]: /install/troubleshoot


</div>

<div class="macos-only">

:::note
The following steps assume you're
using the [default shell][zsh-mac] on macOS, Zsh.

以下步骤假定你在 macOS 上使用
[默认 shell][zsh-mac] Zsh。

If you use another shell besides Zsh,
check out [this tutorial on setting your PATH][other-path].

若你使用的不是 Zsh，
请参阅 [这篇设置 PATH 的教程][other-path]。
:::

 1. <h3>Determine your Flutter SDK installation location</h3>

    <h3>确定 Flutter SDK 安装位置</h3>

    Copy the absolute path to the directory that you
    downloaded and extracted the Flutter SDK into.

    复制你下载并解压 Flutter SDK 所在目录的绝对路径。

 1. <h3>Open or create the Zsh environment variable file</h3>

    <h3>打开或创建 Zsh 环境变量文件</h3>

    If it exists, open the [Zsh environment variable file][zsh-files]
    `~/.zprofile` in your preferred text editor.
    If it doesn't exist, create the `~/.zprofile` file.

    若存在，请在你偏好的文本编辑器中打开
    [Zsh 环境变量文件][zsh-files] `~/.zprofile`。
    若不存在，请创建 `~/.zprofile` 文件。

 1. <h3>Add the Flutter SDK bin to your path</h3>

    <h3>将 Flutter SDK 的 bin 添加到你的 PATH</h3>

    At the end of your `~/.zprofile` file,
    use the built-in `export` command to update the `PATH` variable
    to include the `bin` directory of your Flutter installation.

    在 `~/.zprofile` 文件末尾，
    使用内置 `export` 命令更新 `PATH` 变量，
    使其包含 Flutter 安装目录下的 `bin`。

    Replace `<path-to-sdk>` with the path to your Flutter SDK installation.

    将 `<path-to-sdk>` 替换为你的 Flutter SDK 安装路径。

    ```bash
    export PATH="<path-to-sdk>/bin:$PATH"
    ```

    For example, if you downloaded Flutter into a
    `develop/flutter` folder inside your user directory,
    you'd add the following to the file:

    例如，若你将 Flutter 下载到用户目录下的
    `develop/flutter` 文件夹，可向文件添加：

    ```bash
    export PATH="$HOME/develop/flutter/bin:$PATH"
    ```

 1. <h3>Save your changes</h3>

    <h3>保存你的更改</h3>

    Save, then close, the `~/.zprofile` file you edited.

    保存并关闭你编辑的 `~/.zprofile` 文件。

 1. <h3>Apply your changes</h3>

    <h3>应用你的更改</h3>

    To apply this change and get access to the `flutter` tool,
    close and reopen all open Zsh sessions in your terminal apps and IDEs.

    要应用此更改并访问 `flutter` 工具，
    请在终端应用和 IDE 中关闭并重新打开所有已打开的 Zsh 会话。

 1. <h3>Validate your setup</h3>

    <h3>验证你的配置</h3>

    To ensure you successfully added the SDK to your `PATH`,
    open a Zsh session in your preferred terminal,
    then try running the `flutter` and `dart` tools.

    为确保你已成功将 SDK 添加到 `PATH`，
    请在你偏好的终端中打开 Zsh 会话，
    然后尝试运行 `flutter` 和 `dart` 工具。

    ```console
    $ flutter --version
    $ dart --version
    ```

    If either command isn't found,
    check out [Flutter installation troubleshooting][troubleshoot].

    若任一命令未找到，
    请参阅 [Flutter 安装问题排查][troubleshoot]。

{: .steps}

[zsh-mac]: https://support.apple.com/en-us/102360
[zsh-files]: https://zsh.sourceforge.io/Intro/intro_3.html
[other-path]: https://www.cyberciti.biz/faq/unix-linux-adding-path/
[troubleshoot]: /install/troubleshoot


</div>

<div class="linux-only">

 1. <h3>Determine your Flutter SDK installation location</h3>

    <h3>确定 Flutter SDK 安装位置</h3>

    Copy the absolute path to the directory that you
    downloaded and extracted the Flutter SDK into.

    复制你下载并解压 Flutter SDK 所在目录的绝对路径。

 1. <h3>Determine your default shell</h3>

    <h3>确定你的默认 shell</h3>

    If you don't know what shell you use,
    check which shell starts when you open a new console window.

    若你不确定自己使用哪种 shell，
    可查看打开新控制台窗口时启动的是哪一种。

    ```console
    $ echo $SHELL
    ```

 1. <h3>Add the Flutter SDK bin to your path</h3>

    <h3>将 Flutter SDK 的 bin 添加到你的 PATH</h3>

    To add the `bin` directory of your Flutter installation to your `PATH`:

    要将 Flutter 安装目录下的 `bin` 添加到 `PATH`：

    1. Expand the instructions for your default shell.

       展开与你默认 shell 对应的说明。

    1. Copy the provided command.

       复制提供的命令。

    1. Replace `<path-to-sdk>` with the path to your Flutter SDK install.

       将 `<path-to-sdk>` 替换为你的 Flutter SDK 安装路径。

    1. Run the edited command in your preferred terminal with that shell.

       在使用该 shell 的你偏好的终端中运行编辑后的命令。

    <hr>

    <details>
    <summary>展开 <code>bash</code> 相关说明</summary>

    ```console
    $ echo 'export PATH="<path-to-sdk>/bin:$PATH"' >> ~/.bashrc
    ```

    For example, if you downloaded Flutter into a
    `develop/flutter` folder inside your user directory,
    you'd run the following:

    例如，若你将 Flutter 下载到用户目录下的
    `develop/flutter` 文件夹，可运行：

    ```console
    $ echo 'export PATH="$HOME/develop/flutter/bin:$PATH"' >> ~/.bashrc
    ```

    </details>

    <details>
    <summary>展开 <code>zsh</code> 相关说明</summary>

    ```console
    $ echo 'export PATH="<path-to-sdk>/bin:$PATH"' >> ~/.zshenv
    ```

    For example, if you downloaded Flutter into a
    `develop/flutter` folder inside your user directory,
    you'd run the following:

    例如，若你将 Flutter 下载到用户目录下的
    `develop/flutter` 文件夹，可运行：

    ```console
    $ echo 'export PATH="$HOME/develop/flutter/bin:$PATH"' >> ~/.zshenv
    ```

    </details>

    <details>
    <summary>展开 <code>fish</code> 相关说明</summary>

    ```console
    $ fish_add_path -g -p <path-to-sdk>/bin
    ```

    For example, if you downloaded Flutter into a
    `develop/flutter` folder inside your user directory,
    you'd run the following:

    例如，若你将 Flutter 下载到用户目录下的
    `develop/flutter` 文件夹，可运行：

    ```console
    $ fish_add_path -g -p ~/develop/flutter/bin
    ```

    </details>

    <details>
    <summary>展开 <code>csh</code> 相关说明</summary>

    ```console
    $ echo 'setenv PATH "<path-to-sdk>/bin:$PATH"' >> ~/.cshrc
    ```

    For example, if you downloaded Flutter into a
    `develop/flutter` folder inside your user directory,
    you'd run the following:

    例如，若你将 Flutter 下载到用户目录下的
    `develop/flutter` 文件夹，可运行：

    ```console
    $ echo 'setenv PATH "$HOME/develop/flutter/bin:$PATH"' >> ~/.cshrc
    ```

    </details>

    <details>
    <summary>展开 <code>tcsh</code> 相关说明</summary>

    ```console
    $ echo 'setenv PATH "<path-to-sdk>/bin:$PATH"' >> ~/.tcshrc
    ```

    For example, if you downloaded Flutter into a
    `develop/flutter` folder inside your user directory,
    you'd run the following:

    例如，若你将 Flutter 下载到用户目录下的
    `develop/flutter` 文件夹，可运行：

    ```console
    $ echo 'setenv PATH "$HOME/develop/flutter/bin:$PATH"' >> ~/.tcshrc
    ```

    </details>

    <details>
    <summary>展开 <code>ksh</code> 相关说明</summary>

    ```console
    $ echo 'export PATH="<path-to-sdk>/bin:$PATH"' >> ~/.profile
    ```

    For example, if you downloaded Flutter into a
    `develop/flutter` folder inside your user directory,
    you'd run the following:

    例如，若你将 Flutter 下载到用户目录下的
    `develop/flutter` 文件夹，可运行：

    ```console
    $ echo 'export PATH="$HOME/develop/flutter/bin:$PATH"' >> ~/.profile
    ```

    </details>

    <details>
    <summary>展开 <code>sh</code> 相关说明</summary>

    ```console
    $ echo 'export PATH="<path-to-sdk>/bin:$PATH"' >> ~/.profile
    ```

    For example, if you downloaded Flutter into a
    `develop/flutter` folder inside your user directory,
    you'd run the following:

    例如，若你将 Flutter 下载到用户目录下的
    `develop/flutter` 文件夹，可运行：

    ```console
    $ echo 'export PATH="$HOME/develop/flutter/bin:$PATH"' >> ~/.profile
    ```

    </details>

 1. <h3>Apply your changes</h3>

    <h3>应用你的更改</h3>

    To apply this change and get access to the `flutter` tool,
    close and reopen all open shell sessions in your terminal apps and IDEs.

    要应用此更改并访问 `flutter` 工具，
    请在终端应用和 IDE 中关闭并重新打开所有已打开的 shell 会话。

 1. <h3>Validate your setup</h3>

    <h3>验证你的配置</h3>

    To ensure you successfully added the SDK to your `PATH`,
    open your preferred terminal with your default shell,
    then try running the `flutter` and `dart` tools.

    为确保你已成功将 SDK 添加到 `PATH`，
    请使用默认 shell 打开你偏好的终端，
    然后尝试运行 `flutter` 和 `dart` 工具。

    ```console
    $ flutter --version
    $ dart --version
    ```

    If either command isn't found,
    check out [Flutter installation troubleshooting][troubleshoot].

    若任一命令未找到，
    请参阅 [Flutter 安装问题排查][troubleshoot]。

{: .steps}

[troubleshoot]: /install/troubleshoot


</div>

<div class="chromeos-only">

:::note
The following steps assume
you've already [turned on Linux support][chromeos-linux] and that
you're using Bash or the default shell on ChromeOS.

以下步骤假定
你已 [开启 Linux 支持][chromeos-linux]，并且
你使用的是 ChromeOS 上的 Bash 或默认 shell。

If you're using a different shell besides the default or Bash, follow the
[add to path instructions for Linux][linux-path]{: target="_blank"} instead.

若你使用的不是默认 shell 或 Bash，请改为按照
[Linux 的添加到 PATH 说明][linux-path]{: target="_blank"} 操作。
:::

 1. <h3>Determine your Flutter SDK installation location</h3>

    <h3>确定 Flutter SDK 安装位置</h3>

    Copy the absolute path to the directory that you
    downloaded and extracted the Flutter SDK into.

    复制你下载并解压 Flutter SDK 所在目录的绝对路径。

 1. <h3>Add the Flutter SDK bin to your path</h3>

    <h3>将 Flutter SDK 的 bin 添加到你的 PATH</h3>

    To add the `bin` directory of your Flutter installation to your `PATH`:

    要将 Flutter 安装目录下的 `bin` 添加到 `PATH`：

    1. Copy the following command.

       复制以下命令。

    1. Replace `<path-to-sdk>` with the path to your Flutter SDK install.

       将 `<path-to-sdk>` 替换为你的 Flutter SDK 安装路径。

    1. Run the edited command in your preferred terminal.

       在你偏好的终端中运行编辑后的命令。

    ```console
    $ echo 'export PATH="<path-to-sdk>:$PATH"' >> ~/.bash_profile
    ```

    For example, if you downloaded Flutter into a
    `develop/flutter` folder inside your user directory,
    you'd run the following:

    例如，若你将 Flutter 下载到用户目录下的
    `develop/flutter` 文件夹，可运行：

    ```console
    $ echo 'export PATH="$HOME/develop/flutter/bin:$PATH"' >> ~/.bash_profile
    ```

 1. <h3>Apply your changes</h3>

    <h3>应用你的更改</h3>

    To apply this change and get access to the `flutter` tool,
    close and reopen all open Zsh sessions in your terminal apps and IDEs.

    要应用此更改并访问 `flutter` 工具，
    请在终端应用和 IDE 中关闭并重新打开所有已打开的 Zsh 会话。

 1. <h3>Validate your setup</h3>

    <h3>验证你的配置</h3>

    To ensure you successfully added the SDK to your `PATH`,
    open a Zsh session in your preferred terminal,
    then try running the `flutter` and `dart` tools.

    为确保你已成功将 SDK 添加到 `PATH`，
    请在你偏好的终端中打开 Zsh 会话，
    然后尝试运行 `flutter` 和 `dart` 工具。

    ```console
    $ flutter --version
    $ dart --version
    ```

    If either command isn't found,
    check out [Flutter installation troubleshooting][troubleshoot].

    若任一命令未找到，
    请参阅 [Flutter 安装问题排查][troubleshoot]。

{: .steps}

[chromeos-linux]: https://support.google.com/chromebook/answer/9145439
[linux-path]: /install/add-to-path#linux
[troubleshoot]: /install/troubleshoot


</div>

## Continue your Flutter journey {: #next-steps}

## 继续你的 Flutter 之旅

Now that you've successfully installed Flutter,
set up development for at least one target platform
to continue your journey with Flutter.

现在你已经成功安装了 Flutter，
请至少为一个目标平台配置开发环境，
以继续你的 Flutter 学习之旅。

:::recommend
If you don't yet have a preferred platform
to target during development,
the Flutter team recommends you first try out
[developing on the web][web-setup]!

若你尚未确定开发时要面向的平台，
Flutter 团队建议你首先尝试
[在 Web 上开发][web-setup]！
:::

[web-setup]: /platform-integration/web/setup

<div class="card-grid link-cards">
  <div class="card filled-card list-card">
    <div class="card-leading">
      <img src="/assets/images/decorative/flutter-on-phone.svg"
           height="160" aria-hidden="true"
           alt="A representation of Flutter on multiple devices.">
    </div>
    <div class="card-header">
      <span class="card-title"><t>Set up a target platform</t><t>配置目标平台</t></span>
    </div>
    <div class="card-content">
      <ul>
        <li>
          <a class="text-button" href="/platform-integration/web/setup"><t>Target the web</t><t>面向 Web</t></a>
        </li>
        <li>
          <a class="text-button" href="/platform-integration/android/setup"><t>Target Android</t><t>面向 Android</t></a>
        </li>
        <li class="macos-only">
          <a class="text-button" href="/platform-integration/ios/setup"><t>Target iOS</t><t>面向 iOS</t></a>
        </li>
        <li class="macos-only">
          <a class="text-button" href="/platform-integration/macos/setup"><t>Target macOS</t><t>面向 macOS</t></a>
        </li>
        <li class="windows-only">
          <a class="text-button" href="/platform-integration/windows/setup"><t>Target Windows</t><t>面向 Windows</t></a>
        </li>
        <li class="linux-only">
          <a class="text-button" href="/platform-integration/linux/setup"><t>Target Linux</t><t>面向 Linux</t></a>
        </li>
      </ul>
    </div>
  </div>

  <div class="card filled-card list-card">
    <div class="card-leading">
      <img src="/assets/images/decorative/pointing-the-way.png"
           height="160" aria-hidden="true"
           alt="Dash helping you explore Flutter learning resources.">
    </div>
    <div class="card-header">
      <span class="card-title"><t>Learn Flutter development</t><t>学习 Flutter 开发</t></span>
    </div>
    <div class="card-content">
      <ul>
        <li>
          <a class="text-button" href="/learn/pathway"><t>Learn the fundamentals</t><t>学习基础知识</t></a>
        </li>
        <li>
          <a class="text-button" href="https://www.youtube.com/watch?v=b_sQ9bMltGU&list=PLjxrf2q8roU23XGwz3Km7sQZFTdB996iG"><t>Explore Flutter widgets</t><t>探索 Flutter widget</t></a>
        </li>
      </ul>
    </div>
  </div>

  <div class="card filled-card list-card">
    <div class="card-leading">
      <img src="/assets/images/decorative/up-to-date.png" height="160"
           aria-hidden="true" alt="Keep up to date with Flutter">
    </div>
    <div class="card-header">
      <span class="card-title"><t>Stay up to date with Flutter</t><t>跟进 Flutter 最新动态</t></span>
    </div>
    <div class="card-content">
      <ul>
        <li>
          <a class="text-button" href="/install/upgrade"><t>Update Flutter</t><t>升级 Flutter</t></a>
        </li>
        <li>
          <a class="text-button" href="/release/release-notes"><t>Find out what's new</t><t>了解新特性</t></a>
        </li>
        <li>
          <a class="text-button" href="https://www.youtube.com/@flutterdev"><t>Subscribe on YouTube</t><t>在 YouTube 上订阅频道</t></a>
        </li>
      </ul>
    </div>
  </div>
</div>

