> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs-staging.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 使用 Fastboot 刷写软件

Fastboot 允许您刷写软件镜像（例如引导加载程序），并有助于系统恢复。

Linux 和 Windows 主机均支持 Fastboot。要进入 Fastboot 模式，您可以使用 Fastboot 热键。

<Note>
  请使用 36.0.0 或更早版本的 fastboot 主机工具。
</Note>

## **使用热键进入 Fastboot**

设备通电后，按下 VOL-。

下图显示了设备进入 Fastboot 模式时的 Fastboot 日志。

<div style={{ textAlign: 'center', width: '100%' }}>
  <img src="https://mintcdn.com/qualcomm-staging/uWQLnBcS9sxlZhgB/System/Boot/media/k2c-qli-boot/fastboot-dectection.PNG?fit=max&auto=format&n=uWQLnBcS9sxlZhgB&q=85&s=3de43fd5f3c126ec12d6878bed82a1f7" alt="Fastboot 检测" style={{ display: 'block', margin: '0 auto' }} width="646" height="417" data-path="System/Boot/media/k2c-qli-boot/fastboot-dectection.PNG" />
</div>

## **Fastboot 命令**

当系统检测到 Fastboot 模式时，您可以运行相应的 Fastboot 命令。

<Frame caption="**表：Fastboot 命令**" />

| **命令**                                                        | **用法**                                                                                                                                                                                                                               | **示例或用例**                                                                                                                                                                           |
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `fastboot reboot`                                             | 允许您重新启动设备。                                                                                                                                                                                                                           | 示例命令：<br /><br />`fastboot reboot`<br /><br />在以下情况后可能需要重新启动系统：<br /><ul><li>刷写软件镜像</li><li>完成软件更新</li></ul>                                                                        |
| `fastboot devices`                                            | 如果识别并连接到设备，Fastboot 会显示设备信息。                                                                                                                                                                                                         | 示例命令：<br /><br />`fastboot devices`                                                                                                                                                 |
| `fastboot getvar <variable>`                                  | 从各个分区检索数据。<br /><br />以下是支持的 `getvar` 命令。<br /><ul><li>`fastboot getvar partition-size:system`</li><li>`fastboot getvar partition-size:xbl_a`</li><li>`fastboot getvar kernel`</li><li>`fastboot getvar max-download-size`</li></ul> | Fastboot 支持多个变量。可以通过此命令检索这些变量的数据。<br /><br />示例命令：<br /><br />`fastboot getvar version`                                                                                             |
| `fastboot flash <partition name> <full path to the SW image>` | 刷写软件镜像。                                                                                                                                                                                                                              | 要刷写 `xbl_config.elf` 镜像，请运行：<br /><br />`fastboot flash xbl_config_a xbl_config.elf`<br /><br />其中：<br /><ul><li>`xbl_config_a` 表示分区标签</li><li>`xbl_config.elf` 是要刷写的软件镜像</li></ul> |
| `fastboot erase`                                              | 擦除分区。                                                                                                                                                                                                                                | 示例命令：<br /><br />`fastboot erase xbl_config_a`<br /><br />擦除 `xbl_config_a` 分区。                                                                                                     |
| `fastboot continue`                                           | 继续启动。                                                                                                                                                                                                                                | 示例命令：<br /><br />`fastboot continue`<br /><br />启动 OS。                                                                                                                              |

## **使用 Fastboot 进行恢复**

当 systemd-boot 镜像和 ESP 损坏时，Fastboot 可作为恢复解决方案。

systemd-boot 镜像从 EFI 系统分区（ESP）启动。在这种情况下，Fastboot 会自动作为恢复选项启动，允许您重新刷写 ESP。
