2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2022 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
2011-09-27 11:50:21 +02:00
|
|
|
|
|
|
|
|
// **********************************************************************
|
|
|
|
|
// NOTE: the sections are not ordered by their logical order to avoid
|
|
|
|
|
// reshuffling the file each time the index order changes (i.e., often).
|
|
|
|
|
// Run the fixnavi.pl script to adjust the links to the index order.
|
|
|
|
|
// **********************************************************************
|
|
|
|
|
|
|
|
|
|
/*!
|
2014-09-03 16:15:40 +02:00
|
|
|
\page creator-deployment-embedded-linux.html
|
2022-10-27 16:21:22 +02:00
|
|
|
\previouspage creator-deployment-qnx.html
|
2018-08-10 16:15:05 +02:00
|
|
|
\nextpage creator-connecting-mobile.html
|
2011-09-27 11:50:21 +02:00
|
|
|
|
2022-10-27 16:21:22 +02:00
|
|
|
\title Deploying to Remote Linux
|
2011-09-27 11:50:21 +02:00
|
|
|
|
2020-05-20 13:06:11 +02:00
|
|
|
You can specify settings for deploying applications to generic remote
|
2021-12-03 18:29:53 +01:00
|
|
|
Linux devices in the project configuration file and in the
|
|
|
|
|
\uicontrol Projects mode, in \uicontrol {Run Settings}.
|
2011-09-27 11:50:21 +02:00
|
|
|
|
2022-10-27 16:21:22 +02:00
|
|
|
\image qtcreator-embedded-linux-deployment-details.png "Deploy to remote Linux devices"
|
2011-09-27 11:50:21 +02:00
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
The files to be installed are listed in the \uicontrol {Deployment} step,
|
2022-06-02 14:22:25 +02:00
|
|
|
the \uicontrol {Files to deploy} field. The \uicontrol {Source File Path}
|
2011-09-27 11:50:21 +02:00
|
|
|
field displays the location of the file on the development PC. The
|
2022-06-02 14:22:25 +02:00
|
|
|
\uicontrol {Target Directory} field displays the directory where the file is
|
2011-09-27 11:50:21 +02:00
|
|
|
installed on the device. Text in red color indicates that the information is
|
2021-12-03 18:29:53 +01:00
|
|
|
missing.
|
|
|
|
|
|
2022-07-12 11:29:23 +02:00
|
|
|
If the build system did not automatically detect the source and target
|
|
|
|
|
directories, select \uicontrol {Override deployment data from build system},
|
|
|
|
|
and then select \uicontrol Add to enter them manually. To remove the
|
|
|
|
|
selected paths from \uicontrol {Files to deploy}, select \uicontrol Remove.
|
|
|
|
|
|
2021-12-03 18:29:53 +01:00
|
|
|
\section1 Adding Missing Files
|
|
|
|
|
|
|
|
|
|
The process to add files to deploy depends on the build system you use.
|
2022-04-07 14:52:16 +02:00
|
|
|
For more information, see \l{Specifying Project Contents}.
|
2021-12-03 18:29:53 +01:00
|
|
|
|
2022-02-03 15:11:15 +01:00
|
|
|
\section2 CMake Builds
|
2021-12-03 18:29:53 +01:00
|
|
|
|
|
|
|
|
When using CMake as the build system, use the \l{CMake: install command}
|
|
|
|
|
{install} command in the CMakeLists.txt file to add the missing files.
|
|
|
|
|
|
|
|
|
|
For example, add the following lines to the CMakeLists.txt file to install
|
|
|
|
|
the binary of your project to the \c /opt directory on the remote device:
|
|
|
|
|
|
|
|
|
|
\badcode
|
|
|
|
|
set(INSTALL_DESTDIR "/opt")
|
|
|
|
|
|
|
|
|
|
install(TARGETS <target>
|
|
|
|
|
RUNTIME DESTINATION "${INSTALL_DESTDIR}"
|
|
|
|
|
BUNDLE DESTINATION "${INSTALL_DESTDIR}"
|
|
|
|
|
LIBRARY DESTINATION "${INSTALL_DESTDIR}"
|
|
|
|
|
)
|
|
|
|
|
\endcode
|
|
|
|
|
|
2022-02-03 15:11:15 +01:00
|
|
|
\section2 qmake Builds
|
2021-12-03 18:29:53 +01:00
|
|
|
|
|
|
|
|
When using qmake, edit the \l{Variables#installs}{INSTALLS variable} in
|
|
|
|
|
the project \c .pro file.
|
2011-09-27 11:50:21 +02:00
|
|
|
|
2012-04-12 14:33:49 +02:00
|
|
|
When you run the application, \QC copies the necessary files to the device
|
|
|
|
|
and starts the application on it.
|
|
|
|
|
|
2021-12-03 18:29:53 +01:00
|
|
|
For example, add the following lines to the \c .pro file to copy the binary
|
|
|
|
|
of your project to the \c /opt directory on the remote device:
|
2013-03-07 22:40:20 +01:00
|
|
|
|
|
|
|
|
\code
|
2021-12-03 18:29:53 +01:00
|
|
|
target.path = /opt
|
2013-03-07 22:40:20 +01:00
|
|
|
INSTALLS += target
|
|
|
|
|
\endcode
|
|
|
|
|
|
2021-12-03 18:29:53 +01:00
|
|
|
To deploy additional files, add them to further targets that you also add
|
|
|
|
|
to \c INSTALLS.
|
2013-03-07 22:40:20 +01:00
|
|
|
|
2021-12-03 18:29:53 +01:00
|
|
|
\section1 Deploy Steps
|
2012-04-12 14:33:49 +02:00
|
|
|
|
2021-12-03 18:29:53 +01:00
|
|
|
When you run the application on the device, \QC first uploads the
|
|
|
|
|
necessary files to it, as specified by the deploy steps.
|
|
|
|
|
|
2022-07-12 11:29:23 +02:00
|
|
|
\section2 Uploading Files
|
2012-04-12 14:33:49 +02:00
|
|
|
|
2022-07-12 11:29:23 +02:00
|
|
|
By default, \QC copies the application files to the device by
|
|
|
|
|
using the SSH file transfer protocol (SFTP), as specified by
|
|
|
|
|
the \uicontrol {Upload files via SFTP} step.
|
2021-12-03 18:29:53 +01:00
|
|
|
|
|
|
|
|
\note If the SFTP upload fails, make sure that the remote device has SFTP
|
|
|
|
|
enabled in its SSH daemon. Some versions of Dropbear that come without SFTP
|
|
|
|
|
support will crash when an SFTP upload is being attempted. This is not a bug
|
|
|
|
|
in \QC.
|
|
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
If you have a lot of data to copy, select \uicontrol Details in the
|
|
|
|
|
\uicontrol {Upload Files via SFTP} step, and then select the
|
2015-06-18 13:45:04 +02:00
|
|
|
\uicontrol {Incremental deployment} check box. \QC takes note of the
|
|
|
|
|
deployment time and only copies files that have changed since the last
|
|
|
|
|
deployment. However, when you make major changes on the device, such as
|
|
|
|
|
removing files from the device manually or flashing a new disk image, or
|
|
|
|
|
when you use another device with the same IP address, deselect the check box
|
|
|
|
|
once, to have \QC deploy all files again.
|
2012-04-12 14:33:49 +02:00
|
|
|
|
2021-12-03 18:29:53 +01:00
|
|
|
\section2 Creating a Tarball
|
|
|
|
|
|
2012-04-12 14:33:49 +02:00
|
|
|
To only create a tarball and not copy the files to the device, select
|
2015-06-18 13:45:04 +02:00
|
|
|
\uicontrol {Add Deploy Step} > \uicontrol {Create tarball}. Then remove all
|
|
|
|
|
other deploy steps.
|
2012-04-12 14:33:49 +02:00
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
The \uicontrol {Deploy tarball via SFTP upload} step specifies that \QC
|
2012-04-12 14:33:49 +02:00
|
|
|
uploads the tarball to the device and extracts it.
|
2011-09-27 11:50:21 +02:00
|
|
|
*/
|