运行应用程序
在本地和远程桌面系统上运行应用程序,以及在连接到计算机的嵌入式和移动设备上运行应用程序。
默认情况下,运行应用程序时会同时对其进行构建,并将其部署到某个位置,以便在桌面、设备模拟器或仿真器上,或者在连接到计算机的设备上运行。
要运行应用程序:
- 选择“Build and Run Kit Selector ”图标,或转至“Build ” > “Open Build and Run Kit Selector ”以选择构建和运行套件。

- 选择“
”(Run )。
在移动设备和嵌入式设备上运行
如果您已将移动设备或嵌入式设备连接到计算机,或添加了虚拟设备(例如Android 虚拟设备 (AVD)),则可以在套件选择器中选择它们。
选择“Manage ”以管理设备设置。例如,您可以添加 AVD 或手动启动已断开连接的 AVD。
选择运行目标
如果您的项目定义了多个运行目标(例如测试),您可以在套件选择器中选择它们。

无需部署即可运行
若要运行可执行文件而无需先进行部署,请转至“Build ”,然后选择“Run Without Deployment ”。
若要将此设置为默认选项,请转至Preferences >Build & Run >General ,并取消勾选“Always deploy project before running it ”。
不进行构建直接运行
“Application Output” 会在应用程序运行时显示其状态。

选择“
”(Run )可在不先进行构建的情况下重新运行应用程序。
这在开发Qt Quick 应用程序时非常有用,因为 QML 文件是在运行时解释执行的。因此,如果您仅编辑了 QML 文件,则无需重新构建应用程序。这可以节省时间,特别是当应用程序包含大型图像文件时——这些文件在运行应用程序之前需要打包到资源文件中。
另请参阅 《如何:运行项目》、《配置项目以供运行》、《自定义构建过程》和《支持的平台》。
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.