You can connect generic Linux devices to the development PC to run, debug, and analyze applications built for them from Qt Creator.
If you have a tool chain for building applications for embedded Linux devices installed on the development PC, you can add it to Qt Creator. You can then select a kit with 嵌入式 Linux device type to build applications for and run them on the devices.
To be able to run and debug applications on generic remote Linux devices, you must add devices and select them in the Qt Creator kit .
You use a wizard to create the connections. You can edit the settings later in 工具 > Options > Devices > Devices .
You can protect the connections between Qt Creator and a device by using an OpenSSH connection. OpenSSH is a connectivity tool for remote login using the SSH protocol. The OpenSSH suite is not delivered with Qt Creator, so you must download it and install it on the development PC. Then, you must configure the paths to the tools in Qt Creator. For more information, see Configuring SSH Connections .
You need either a password or an SSH public and private key pair for authentication. If you do not have an SSH key, you can use the ssh-keygen tool to create it in Qt Creator. For more information, see Generating SSH Keys .
注意: Qt Creator does not store passwords, so if you use password authentication, you may need to enter the password on every connection to the device, or, if caching is enabled, at every Qt Creator restart.
To configure connections between Qt Creator and an embedded Linux device and to specify build and run settings for the device:
%{Device:HostAddress}
.
%{Device:UserName}
.
%{Device:PrivateKeyFile}
.
All of these parameters can be edited later, as well as additional ones that the wizard does not show because there are sensible default values. One of these is the SSH port number, which is available in the variable
%{Device:SshPort}
.
When you run the project, Qt Creator deploys the application as specified by the deploy steps. By default, Qt Creator copies the application files to the device. For more information, see Deploying Applications to Generic Remote Linux Devices .
SSH connections are established via an OpenSSH client running in master mode, if possible. Connection sharing is enabled by default to allow sharing multiple sessions over a single SSH connection. This way, a connection is only established once and then re-used by subsequent run and deploy procedures, saving connection setup overhead particularly with embedded devices. Because connection sharing is not supported on Windows, a new SSH connection is created for each deploy or run procedure.
To create SSH connections, you must install the OpenSSH suite, which includes the ssh, sftp, and ssh-keygen tools on the development PC.
To tell Qt Creator where it can find the tools, specify the paths to the directories where the tools are installed in 工具 > Options > Devices > SSH :
If you do not have an SSH public and private key pair, you can generate it in Qt Creator. The connection wizard can create the key pair for you, or you can create it separately.
You can specify key length and the key algorithm, RSA or ECDSA. If you only use the keys to protect connections to the emulator or device, you can use the default values.
The Public key file field displays the location to save the corresponding public key.
You can view processes running on devices and kill them. Select 工具 > Options > Devices > Devices > Show Running Processes .
You can filter the processes by name or ID in the List of Processes 对话框。
To update the process list, select Update List .
To kill a process, select it in the list, and then select Kill Process .