> ## 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.

# 安装 QSC

# 安装 QSC

首先,请在 [Qualcomm](https://myaccount.qualcomm.com/signup) 注册以获取 Qualcomm ID。

## 机器要求

* Linux(Ubuntu 22.04)、Windows、Mac(arm)
* 能够连接 Qualcomm 后端服务器的网络(参见[防火墙要求](https://dragonwingdocs.qualcomm.com/Tools/Qualcomm-Software-Center/troubleshooting#firewall-requirements))。
* 至少 300 GB 的可用存储空间,用于下载和编译软件产品构建。
* 至少 16 GB 内存。

## Windows

### 下载 QSC for Windows

1. 使用您的 Qualcomm ID 登录 [https://softwarecenter.qualcomm.com/catalog/item/Qualcomm\_Software\_Center](https://softwarecenter.qualcomm.com/catalog/item/Qualcomm_Software_Center)。

2. 选择 **Install**。

<img src="https://mintcdn.com/qualcomm-staging/37GrGIPTgl_v0NdQ/Tools/Qualcomm-Software-Center/images/gui-windows.png?fit=max&auto=format&n=37GrGIPTgl_v0NdQ&q=85&s=729095d97ab9dbb6f27cebf4f0ea1837" alt="下载 Software Center" style={{ width: '100%' }} width="2537" height="1243" data-path="Tools/Qualcomm-Software-Center/images/gui-windows.png" />

QSC 可执行文件将下载到您的 Windows 电脑。

### 安装 QSC for Windows

1. 选择 QSC 的 .exe 可执行文件开始安装。

2. 安装完成后,如需打开 Qualcomm Software Center 桌面应用程序,请在 Windows 搜索框中搜索 **Qualcomm Software Center**。

<img src="https://mintcdn.com/qualcomm-staging/37GrGIPTgl_v0NdQ/Tools/Qualcomm-Software-Center/images/search_qsc.png?fit=max&auto=format&n=37GrGIPTgl_v0NdQ&q=85&s=e041cff96591acb2fd2e16b8f0ac8adc" alt="QSC for Windows" style={{ width: '100%' }} width="652" height="236" data-path="Tools/Qualcomm-Software-Center/images/search_qsc.png" />

## Linux

### 下载 QSC for Linux

可通过以下方式下载 Qualcomm Software Center for Linux。

#### GUI

1. 使用您的 Qualcomm ID 登录 [https://softwarecenter.qualcomm.com/catalog/item/Qualcomm\_Software\_Center](https://softwarecenter.qualcomm.com/catalog/item/Qualcomm_Software_Center)。

2. 选择 **Install**。

<img src="https://mintcdn.com/qualcomm-staging/37GrGIPTgl_v0NdQ/Tools/Qualcomm-Software-Center/images/gui-linux.png?fit=max&auto=format&n=37GrGIPTgl_v0NdQ&q=85&s=a774bbe6b61a2355b877d167a3497dd8" alt="gui-linux" style={{ width: '100%' }} width="2543" height="1103" data-path="Tools/Qualcomm-Software-Center/images/gui-linux.png" />

QSC Debian 软件包将下载到您的电脑。

#### CLI

1. 如果尚未安装 curl,请运行以下命令安装。

`sudo apt install curl`

1. 要下载适用于 x86 的 QSC 安装程序,请运行以下命令。

`curl -L https://softwarecenter.qualcomm.com/api/download/software/tools/Qualcomm_Software_Center/Linux/Debian/latest.deb -o qsc_installer.deb`

<Note>
  对于 ARM64,安装程序路径为 `[https://softwarecenter.qualcomm.com/api/download/software/qsc/linux-arm64/latest.deb`.]\([https://softwarecenter.qualcomm.com/api/download/software/qsc/linux-arm64/latest.deb\`](https://softwarecenter.qualcomm.com/api/download/software/qsc/linux-arm64/latest.deb`).)
</Note>

### 安装 QSC for Linux

可通过以下方式安装 Qualcomm Software Center for Linux。

#### GUI

使用 Ubuntu GNOME GUI(GDebi)安装已下载的 QSC Debian 软件包。

要安装 GDebi,请在终端窗口中运行以下命令。

`sudo apt install gdebi`

<img src="https://mintcdn.com/qualcomm-staging/37GrGIPTgl_v0NdQ/Tools/Qualcomm-Software-Center/images/install_package.png?fit=max&auto=format&n=37GrGIPTgl_v0NdQ&q=85&s=d74c55fa8fedea00ce66f35912fe4f7f" alt="install_package.png" style={{ width: '100%' }} width="546" height="275" data-path="Tools/Qualcomm-Software-Center/images/install_package.png" />

#### CLI

要安装 Debian 软件包,请运行以下命令。

`sudo apt update`
`sudo apt install ./qsc_installer.deb`

<Note>
  如果出现以下错误消息,请忽略:

  `o/p::  N: Download is performed unsandboxed as root as file '/home/ubuntu22/qsc_installer.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)`
</Note>

安装成功后,会显示 `Installed Qualcomm Software Center v1.X.X successfully` 消息。

<Note>
  为了让 Launcher 工作流能够检测已连接的设备并烧录软件构建,主机上必须安装 PCAT 和 QUD。请按照说明使用 qsc-cli 安装 PCAT 和 QUD。
</Note>

## Mac (arm)

### 下载 QSC for Mac

1. 使用您的 Qualcomm ID 登录 [Qualcomm Software Center](https://softwarecenter.qualcomm.com/catalog/item/Qualcomm_Software_Center?osArch=ARM64\&osType=macOS)。

2. 选择 **Install**。

   :alt: Download software center
   :scale: 60

   QSC 可执行文件将下载到您的电脑。

### 安装 QSC for Mac

要在 Mac 设备上安装 QSC,请使用以下方式之一。

1. 使用终端,进入 **Downloads** 文件夹并运行以下命令。

`sudo installer -pkg &lt;path_to_downloaded_installer&gt; -target /`

1. 使用 Finder,进入 **Downloads** 位置并双击安装程序。按照屏幕上的说明完成安装。

## Windows Subsystem for Linux (WSL)

### 机器要求

* Windows 11 或 Windows 10 Build 18362.1049 及更高版本。
* 至少 32 GB 内存。请按照"加速 qsc-cli 操作"中的说明为 WSL 分配可用内存。
* 至少 500 GB 的可用存储空间。

### 前提条件

在安装 WSL2 之前,请确保已启用以下 Windows 功能。

* Microsoft-Windows-Subsystem-Linux
* VirtualMachinePlatform

要启用它们,请在 Windows 搜索栏中搜索**启用或关闭 Windows 功能**。将弹出一个新窗口,列出可用功能。请确保如下图所示启用了 Microsoft-Windows-Subsystem-Linux 和 VirtualMachinePlatform 功能:

<img src="https://mintcdn.com/qualcomm-staging/37GrGIPTgl_v0NdQ/Tools/Qualcomm-Software-Center/images/wls_features_enabled.png?fit=max&auto=format&n=37GrGIPTgl_v0NdQ&q=85&s=1a5ef40c41ae6c13d69b02d727ee71a1" alt="启用或关闭 Windows 功能" width="407" height="365" data-path="Tools/Qualcomm-Software-Center/images/wls_features_enabled.png" />

<Note>
  如果您启用了上述任一或全部功能,Windows 可能会要求您重启电脑。请先重启电脑,然后再继续后续步骤。
</Note>

### 安装 QSC for WSL

1. 按照 [https://learn.microsoft.com/en-us/windows/wsl/install.](https://learn.microsoft.com/en-us/windows/wsl/install.) 中的流程安装 WSL。

   要将 WSL2 设为默认 WSL 版本,请在管理员模式的 Windows PowerShell 中运行以下命令。

`wsl --set-default-version 2`

1. 在管理员模式的 Windows PowerShell 中运行以下命令安装 Ubuntu 发行版。

`wsl --install -d Ubuntu-22.04`
安装完成后,创建新的用户名和密码。账户创建后,您将默认以该用户身份登录。

1. 在 Ubuntu 会话中运行以下命令安装 qsc-cli。

`curl -L https://softwarecenter.qualcomm.com/api/download/software/tools/Qualcomm_Software_Center/Linux/Debian/latest.deb -o qsc_installer.deb`
`sudo apt update`
`sudo apt install ./qsc_installer.deb`

<Note>
  如果出现以下错误消息,请忽略:

  `o/p::  N: Download is performed unsandboxed as root as file '/home/ubuntu22/qsc_installer.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)`
</Note>

1. 等待约 5 分钟,然后使用以下命令安装 docker。

`curl -fsSL https://get.docker.com -o get-docker.sh`
`sudo sh get-docker.sh`
`sudo usermod -aG docker $USER`
`sudo service docker start`

1. 打开 `/etc/wsl.conf` 并添加以下行(如果不存在),将 docker 设置为自动启动。

```
[boot]
command = sudo service docker start
```

1. 在管理员模式的 Windows PowerShell 中运行以下命令,使更改生效。

`wsl --shutdown`

<Note>
  为了让 Launcher 工作流能够检测已连接的设备并烧录软件构建,Windows 主机上必须安装 PCAT 和 QUD。请按照说明使用 qsc-cli 安装 PCAT 和 QUD。
</Note>

### 安装后配置

安装 WSL 后,需要进行以下优化。

#### 优化 WSL 性能

默认情况下,Ubuntu 安装在您的 C 盘上,而 C 盘的空间可能不足。如果您有其他存储空间更大的磁盘,
可以更改 Ubuntu 发行版的安装位置以优化性能。

1. 在管理员模式的 Windows PowerShell 中运行以下命令。

`wsl --shutdown`

1. 从 Windows 搜索栏打开**添加或删除程序**。
2. 在应用列表中找到 Ubuntu-22.04。
3. 选择该应用,然后选择**移动**。
4. 使用下拉菜单选择新位置,然后选择**移动**。

<Note>
  移动完成可能需要一些时间。
</Note>

#### 优化 QSC CLI 操作速度

系统将 WSL 的内存使用限制为 Windows 总内存的 50%。例如,即使主机有 32 GB 可用内存,
WSL 也只能分配到 16 GB。解决此限制的方法是更新 .wslconfig 文件,
在其中为 WSL 分配可用内存。

1. 创建一个 `%UserProfile%.wslconfig` 文件,内容如下。

<Note>
  这些值仅供参考。请逐项核对这些设置,使其与您电脑的规格相匹配。
</Note>

```
# Settings apply across all Linux distros running on WSL 2
[wsl2]
# Limits VM memory to use no more than 64 GB, this can be set as whole numbers using GB or MB
memory=64GB
# Sets the VM to use 16 virtual processors.
processors=16
# Sets amount of swap storage space to 64GB, default is 25% of available RAM
swap=64GB
# Sets swapfile path location, default is %USERPROFILE%\AppData\Local\Temp\swap.vhdx
swapfile=E:\\wsl-swap.vhdx
# Enable experimental features
[experimental]
# Automatically releases cached memory after detecting idle CPU usage. Set to gradual for slow release, and dropcache for instant release of cached memory.
autoMemoryReclaim=dropcache
```

1. 在管理员模式的 Windows PowerShell 中运行以下命令。

`wsl --shutdown`

1. 再次启动 Ubuntu 发行版,开始使用 qsc-cli。

<Note>
  WSL 上仅支持 qsc-cli。Qualcomm Software Center 桌面应用程序在 WSL 上可能无法运行。
</Note>

### 支持

* 有关常见的 WSL 相关问题,请参阅 [Microsoft 故障排除](https://learn.microsoft.com/en-us/windows/wsl/troubleshooting)。
* 有关网络相关问题,请参阅 [Microsoft GitHub](https://github.com/microsoft/WSL/issues/8365)。
* 有关其他故障排除,请参阅 WSL 支持。

## UTM for Mac

### 机器要求

* 主机操作系统:macOS Big Sur 11.3 或更高版本
* 架构:ARM64
* 处理器:基于 ARM 的 Apple Silicon 处理器
* 至少 18 GB 内存
* 至少 500 GB 的可用存储空间(300 GB 空闲空间)

### 下载 UTM 并设置虚拟机

1. 从 Ubuntu 网站下载适用的 Ubuntu ISO 镜像。

   如果您的 Mac 笔记本使用 ARM 架构,请下载 ARM ISO 镜像。

   a. 访问 [https://ubuntu.com/download/server/arm.](https://ubuntu.com/download/server/arm.)
   b. 选择 **Alternative and previous releases**。
   c. 下载 22.04 ISO 镜像。

2. 下载并安装 UTM。

   a. 访问 [https://mac.getutm.app/](https://mac.getutm.app/) 并选择 **Download**。
   b. 双击下载的 .dmg 文件,将 UTM 拖放到您的 Applications 文件夹中。
   c. 进入 Applications 并打开 UTM。

3. 安装 Ubuntu。

   a. 选择 **Create a New Virtual Machine**。
   b. 选择 **Virtualize**。
   c. 选择 **Linux** 作为操作系统。对于 **Boot ISO Image**,选择 **Browse** 找到并选择之前下载的 Ubuntu ISO 镜像文件。
   d. 选择 **Continue**
   e. 选择内存和 CPU 核心数(建议最少 10 GB 内存和 6 个核心),然后选择 **Continue**。
   为获得更好性能,请使用主机配置的 70%。

<Note>
  要查看 Mac 的系统配置,请选择苹果菜单 > **系统设置**,然后在侧边栏选择**通用**。您可能需要向下滚动。在右侧选择**关于本机**,然后选择**系统报告**。
</Note>

f. 指定存储大小(建议至少 300 GB,用于下载和编译软件产品构建),然后选择 **Continue**。
g. 选择可在虚拟机内访问的共享目录(例如下载文件夹),然后选择 **Continue**。
h. 更新系统名称(默认为 *Linux*),然后选择 **Save** 保存系统配置。

1. 点击虚拟机的播放按钮,打开并设置 Ubuntu。

<Note>
  Tab 键用于移动光标。空格键用于选择选项。
</Note>

a. 选择 **Try or Install Ubuntu Server**。
b. 选择首选语言。
c. 选择键盘布局。
d. 选择 **Ubuntu Server**(默认)作为安装类型。

<img src="https://mintcdn.com/qualcomm-staging/37GrGIPTgl_v0NdQ/Tools/Qualcomm-Software-Center/images/ubuntu_installation_type.png?fit=max&auto=format&n=37GrGIPTgl_v0NdQ&q=85&s=ed9c728d8139520eb05a8288740804cb" alt="ubuntu_installation_type" style={{ width: '100%' }} width="845" height="550" data-path="Tools/Qualcomm-Software-Center/images/ubuntu_installation_type.png" />

e. 选择默认的网络接口。
f. 选择默认的 Ubuntu 归档镜像源。
g. 选择默认的引导式存储配置。

<img src="https://mintcdn.com/qualcomm-staging/37GrGIPTgl_v0NdQ/Tools/Qualcomm-Software-Center/images/ubuntu_storage_config.png?fit=max&auto=format&n=37GrGIPTgl_v0NdQ&q=85&s=8ec73b89ba06741bbf98c027a183bf31" alt="ubuntu_storage_config" style={{ width: '100%' }} width="845" height="548" data-path="Tools/Qualcomm-Software-Center/images/ubuntu_storage_config.png" />

h. 在 Storage Configuration 页面上,进入 **USED DEVICES**,按 Tab 键选择 **ubuntu-lv new, to be formatted as ext4, mounted at**,然后按回车更改 ubuntu-lv 大小(例如,如果 ubuntu-vg 为 196,则将 ubuntu-lv 保持为 190)。
i. 在 Confirm destructive action 页面上,选择 **Continue**。

<Note>
  这不会擦除 macOS 中的内容。
</Note>

j. 在 Profile setup 页面上,输入 Ubuntu 虚拟机所需的信息。

<Note>
  该用户名和密码将成为虚拟机的登录凭据。
</Note>

k. 在 Upgrade to Ubuntu Pro 页面上,选择 **Skip for now**。
l. 如果要为服务器启用 SSH,请安装 OpenSSH 服务器软件包。要跳过 SSH 设置,请选择 **Done**。
m. Ubuntu 系统将开始安装。完成后,从虚拟机中卸载 CD/DVD 并重启。

<img src="https://mintcdn.com/qualcomm-staging/37GrGIPTgl_v0NdQ/Tools/Qualcomm-Software-Center/images/ubuntu_dismount_cd.png?fit=max&auto=format&n=37GrGIPTgl_v0NdQ&q=85&s=612f045738fd206fd72c29d0e2737173" alt="ubuntu_dismount_cd" style={{ width: '100%' }} width="717" height="604" data-path="Tools/Qualcomm-Software-Center/images/ubuntu_dismount_cd.png" />

1. 要使用虚拟机,请点击播放按钮并登录。显示 Ubuntu 登录界面可能需要一些时间。如果登录界面未出现,请重启 UTM 并重新启动虚拟机。

2. 安装 Ubuntu 桌面。

   a. 在 Ubuntu 终端中运行命令更新系统。

`sudo apt update && sudo apt upgrade -y`
b. 安装 Ubuntu 桌面。

`sudo apt install ubuntu-desktop -y`
c. 重启系统。

`reboot`
Ubuntu 桌面安装完成。

1. 将 USB 连接到电脑。虚拟机会询问是否允许连接该 USB。

   在 Ubuntu 桌面上,点击右上角的 USB 符号可查看最近连接的 USB。
   在 Ubuntu 终端中运行以下命令可查看可用 USB 列表。

`lsusb`

### 安装 QSC-CLI

1. 设置完成后,在 Ubuntu 会话中运行以下命令安装 qsc-cli。

`curl -L https://softwarecenter.qualcomm.com/api/download/software/qsc/linux-arm64/latest.deb -o qsc_installer.deb`
`sudo apt update`
`sudo apt install ./qsc_installer.deb`

<Note>
  如果出现以下错误消息,请忽略:

  `o/p::  N: Download is performed unsandboxed as root as file '/home/ubuntu22/qsc_installer.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)`
</Note>

开始使用 qsc-cli 下载和编译软件产品构建。

<Note>
  为了让 Launcher 工作流能够检测已连接的设备并烧录软件构建,UTM 上必须安装 PCAT 和 QUD。请按照说明使用 qsc-cli 安装 PCAT 和 QUD。
</Note>
