Skip to content

命令行选项 ​

您可以使用命令行选项启动QGroundControl。 这些用于启用日志记录,运行单元测试以及模拟不同的主机环境以进行测试。 These are used to enable logging, run unit tests, and simulate different host environments for testing.

使用选项启动QGroundControl ​

You will need to open a command prompt or terminal, change directory to where the QGroundControl executable is stored, and then run it. This is shown below for each platform (using the --logging:full --log-output options):

Windows Command Prompt (QGroundControl is a GUI application with no console window, so redirect stderr to a file to capture the output):

sh
cd "%ProgramFiles%\QGroundControl\bin"
QGroundControl --logging:full --log-output > "%USERPROFILE%\qgc_log.txt" 2>&1

macOS Terminal app (Applications/Utilities):

sh
cd /Applications/QGroundControl.app/Contents/MacOS
./QGroundControl --logging:full --log-output

Linux终端:

sh
./QGroundControl-<arch>.AppImage --logging:full --log-output

Options take their value either after a colon (--logging:full) or as the next argument (--logging full). Run with --help to list the options available in your build.

选项 ​

选项/命令行参数列在下表中。

选项描述
--help, --versionPrints the available options or the version, then exits.
--clear-settingsClears the app settings (reverts QGroundControl back to default settings).
--clear-cacheClears the cached parameter and airframe data.
--logging:fullTurns on full logging. See Console Logging.
--logging:Comms.LinkManager,FactSystem.ParameterManagerTurns on the specified comma separated logging categories. A category prefix such as Comms also turns on its sub-categories.
--log-outputWrites log messages to stderr (the terminal on macOS/Linux).
--system-id:idSets the MAVLink system ID used by QGroundControl.
--simple-boot-testInitializes the application subsystems and exits (a quick startup check).
--fake-mobile(Desktop only) Simulates running on a mobile device.
--allow-multiple(Desktop only) Allows more than one instance of QGroundControl to run at a time.
--swrast(Windows and macOS only) Forces software rendering.
--no-windows-assert-ui(Windows only) Disables the assert dialog boxes.

Unit Test Options ​

These options are only available in builds with unit tests (QGC_BUILD_TESTING, on by default in Debug builds). See Unit Tests.

OptionDescription
--unittest:nameRuns the specified unit test. Leave off :name to run all tests.
--unittest-stress:countRepeats unit tests count times (count > 0). Combine with --unittest:name to select a test.
--unittest-output:fileWrites the results to file in JUnit XML format.
--unittest-shard:index/countRuns every count-th test function of a single test, starting at index (1-based).
--label:labelsSelects tests by comma separated labels, for example --label:Unit,Vehicle.
--list-testsLists the registered tests (combine with --label to filter) and exits.
--onscreenShows test windows on screen instead of running offscreen.

笔记:

  • For example, --unittest:ParameterManagerTest --unittest-stress:20 runs ParameterManagerTest 20 times.
  • When running unit tests, QGroundControl runs under the control of the unit test (it does not start normally).