本页内容

连接 HarmonyOS 设备

Qt Creator 通过 SDK 的hdc 接口查找 HarmonyOS 设备,因此hdc 列出的设备无需单独配置。

  1. 在设备上开启无线调试,并记下设备报告的地址和端口。该端口每次都会变化。
  2. 请通过命令行使用 SDK 中的 `hdc ` 方法与其建立一次连接:
    hdc tconn <address>:<port>
    hdc list targets
  3. 转至Preferences >Devices >Devices 。该设备会出现在列表中,其页面显示已准备就绪。

此外,还提供了一台 HarmonyOS 设备作为构建设备,用于源代码和工具链均位于设备本地的项目。

创建开发套件

在Preferences >Kits >Qt Versions >Add 中注册 Qt for HarmonyOS,并选择其“qmake ”。运行Qt Creator 将为此创建一个开发套件,该套件将该设备设为运行设备并使用 SDK 中的编译器,无需进一步编辑。

另请参阅 《HarmonyOS 设备开发》、《如何:进行 HarmonyOS 开发》、《如何:管理开发套件》以及《管理开发套件》。

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.