summaryrefslogtreecommitdiffstats
path: root/src/doc/src/qtee-building-running.qdoc
blob: f9c3dd162f37a37185b2883154c826650192489f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc
** All rights reserved.
** For any questions to Digia, please use the contact form at
** http://www.qt.io
**
** This file is part of Qt Enterprise Embedded.
**
** Licensees holding valid Qt Enterprise licenses may use this file in
** accordance with the Qt Enterprise License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia.
**
** If you have questions regarding the use of this file, please use
** the contact form at http://www.qt.io
**
****************************************************************************/
/*!
    \page qtee-building-and-running.html
    \title Building and Running Embedded Applications
    \previouspage qtee-preparing-hardware.html
    \nextpage qtee-custom-build-steps.html

    \section1 Building and Running an Example

    After you complete the installation and configuration steps for \SDK and the
    target devices, you can test the setup by creating a simple \l{Qt Quick}
    application and running it on the device:

    \list 1
        \li Make sure that your device is powered on and connected to the
            development host.
        \li In Qt Creator, select \b File > \b {New File or Project} >
            \b Applications > \b{Qt Quick Application} > \b{Choose}.
        \li Choose a location for your new project.
        \li In the \b{Qt Quick Component Set} dialog, select \b{Qt Quick 2.2}
            or \b{Qt Quick 2.2 Boot2Qt}.
        \li In the \b{Kit Selection} dialog, select the kits for your
            devices. You can also select the emulator kit to test running the
            project in the emulator.
        \li Click \b{Next} and finish the wizard.
        \li In \b Projects > \b {Build & Run}, select the correct kit for your
            connected device.
        \li To build and run the project, click \inlineimage qtcreator-run.png
    \endlist

    \section1 Building and Running \B2Q Demos

    You can find the \B2Q demo applications in Qt Creator.

    \list 1
        \li Go to \b Welcome > \b Examples.
        \li Select a \e Boot2Qt Qt version from the drop-down list.
        \li Select a demo you want to build.
        \li In \b Projects > \b {Build & Run}, select the correct kit for your
            connected device or emulator.
        \li To build and run the project, click \inlineimage qtcreator-run.png
    \endlist

    \section1 Setting Up an Already Existing Project for Deployment

    New Qt Quick application projects generated by Qt Creator always have the correct
    settings for deployment on the device or emulator. However, other projects need
    some changes. This includes projects created using the
    \b File > \b {New File or Project} > \b Applications > \b{Qt Widget Application}
    template.

    As a general rule, application binaries and resources are deployed to the
    \c {/data/user/qt/<APPLICATION_NAME>} directory. Therefore, the \c path variable for
    the \c INSTALLS targets needs to be adjusted accordingly in .pro files.

    Open the .pro file and define the \c target.path and \c INSTALLS variables as follows:

    \badcode
        target.path = /data/user/qt/$$TARGET
        INSTALLS   += target
    \endcode

    Above, \c {$$TARGET} expands to the application target (executable) name.

    \section2 Deploying Application Resources

    If the application depends on additional resources (such as QML files and
    images), you need to deploy them as well. For example:

    \badcode
        appFiles.files = *.png qml
        appFiles.path  = /data/user/qt/$$TARGET
        INSTALLS      += appFiles
    \endcode

    Above, all PNG images from the application source directory, and the entire
    \e qml subdirectory are included in the deployment.

    Alternatively, the files used by the application can be stored into the application
    executable using the \l{The Qt Resource System}{Qt resource system}. This way, simply
    deploying the application binary is all that's required.
*/

/*!
    \page qtee-custom-build-steps.html
    \title Special Build & Run Options
    \previouspage qtee-building-and-running.html
    \nextpage qtee-customization.html

    Qt Creator allows you to execute custom commands on the embedded device connected
    to the development host, both during the build process and during deployment of your
    application.

    \section1 Custom Build Steps

    To add a custom step to be executed during the build:

    \list 1
        \li In Qt Creator, go to \b Projects > \b {Build Settings}
        \li Select \b Build configuration for the \e {\B2Q} version you want to customize.
        \li Click \b {Add Build Step} and select \b {Custom Remote Command (via adb shell)}.
        \li Enter the command to be executed.
    \endlist

    \section1 Custom Deployment Steps

    To add a custom step to be executed during deployment:

    \list 1
        \li In Qt Creator, go to \b Projects > \b {Run Settings}
        \li Select \b Run configuration for the \e {\B2Q} version you want to customize.
        \li Click \b {Add Deploy Step} and select \b {Custom Remote Command (via adb shell)}.
        \li Enter the command to be executed.
    \endlist

    \sa {Booting to a Custom Application}
*/