summaryrefslogtreecommitdiffstats
path: root/src/doc/src/qtee-build-emulator.qdoc
blob: f87354df56c5b4fbee027507e015be8e2ceba780 (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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** All rights reserved.
** For any questions to The Qt Company, please use the contact form at
** http://www.qt.io/contact-us
**
** This file is part of Qt for Device Creation.
**
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
****************************************************************************/

/*!
    \page qtee-build-emulator.html
    \title Building the Emulator from Sources
    \previouspage qtee-static-linking.html
    \nextpage qtee-changelog.html

    To build the emulator from source, you need to build the emulator host part
    and an emulator device image for a VirtualBox virtual machine.

    \section1 Building Emulator Host Part from Sources

    To build the emulator host part from sources:

    \list 1
        \li Create a directory for the emulator parts:

            \badcode
            mkdir emulator
            cd emulator
            \endcode

        \li Clone the emulator repositories:

            \badcode
            git clone ssh://codereview.qt-project.org/tqtc-boot2qt/emulator-scripts.git scripts
            git clone ssh://codereview.qt-project.org/tqtc-boot2qt/emulator emulator
            cd emulator
            git submodule update --init
            cd ..
            \endcode

        \li Create a build directory for a shadow build:

            \badcode
            mkdir build
            cd build
            \endcode

        \li Build the QtSystems module:

            \badcode
            mkdir qtsystems
            pushd qtsystems
              qmake "${EMULATOR_SOURCE_DIR}"/src/qtsystems
              make
              make install
            popd
            \endcode

        \li Build the QtSimulator module:

            \badcode
            mkdir simulator
            pushd simulator
              qmake "${EMULATOR_SOURCE_DIR}"/src/qtsimulator
              make
              make install
            popd
            \endcode

        \li Build the QtGlesStream component:

            \badcode
            mkdir qtglesstream
            pushd qtglesstream
              qmake "${EMULATOR_SOURCE_DIR}"/src/qtglesstream
              make
              make install
            popd
            \endcode

        \li Build the emulator:

            \badcode
            mkdir emulator
            pushd emulator
              EMULATOR_INSTALL_DIR=../install/
              qmake "${EMULATOR_SOURCE_DIR}" PREFIX="${EMULATOR_INSTALL_DIR}"
              make
              make install
            popd
            \endcode

    \endlist

    \section1 Building Emulator Device Image for VirtualBox VM

    To build the emulator device image for a VirtualBox VM:

    \list 1
        \li Make sure that your Qt library is built with GLES support and
            defaults to eglfs.
         \li Make sure that the virtual machine is reachable with the IP address
            \c 192.168.56.101.
        \li Create a shared folder on the virtual machine and mount it to
            \c /var/vqvideo by using the \c vboxsf kernel module and a mount
            tool for the folder. You can get these from the VirtualBox addons
            provided by Oracle or compile them yourself from the VirtualBox
            sources.

            \badcode
                mkdir -p /var/vqvideo
                mount.vboxsf vqvideo /var/vqvideo
            \endcode

        \li Set up \c appcontroller, as instructed in
            \l{Setting Up appcontroller}.
        \li Build the \c emulatorproxy daemon that is located in the emulator
            sources in the \c src/helperlibs/proxy directory:

            \badcode
            cd "${EMULATOR_SOURCE_DIR}"/src/helperlibs/proxy
            sdk-qmake && make
            \endcode

        \li Start the \c emulatorproxy daemon on the device to enable the
            emulator to perform several tasks on the running machine. The daemon
            will fork itself.
        \li Clone the QtSimulator module from
            \c ssh://codereview.qt-project.org/tqtc-boot2qt/qtsimulator, and
            then build and deploy it on the device as any Qt module:

            \badcode
            git clone ssh://codereview.qt-project.org:29418/tqtc-boot2qt/qtsimulator
            cd qtsimulator
            sdk-qmake && make && make install
            \endcode

        \li Clone the QtGlesStream module from
            \c ssh://codereview.qt-project.org/qt/tqtc-qtglesstream, and then
            build and deploy it on the device:

            \badcode
            git clone ssh://codereview.qt-project.org:29418/qt/tqtc-qtglesstream
            tqtc-qtglesstream
            sdk-qmake && make && make install
            \endcode

        \li To enable handling touch and keyboard input, build the emulator
            specific input plugin from the emulator sources in the
            \c src/helperlibs/vinput directory using qmake and deploy it to the
            Qt input plugin folder on the device:

            \badcode
            cd "${EMULATOR_SOURCE_DIR}"/src/helperlibs/vinput
            sdk-qmake && make && make install
            \endcode

    \endlist

    \section2 Setting Up appcontroller

    To set up \c appcontroller:

    \list 1
        \li Clone the \c appcontroller sources from
            \c git://codereview.qt-project.org/tqtc-boot2qt/appcontroller.
        \li Build \c appcontroller using qmake and make.
        \li Set \c appcontroller in the PATH.
        \li Create a configuration file for \c appcontroller to configure device
            specific variables for your application.
    \endlist

    An example \c /etc/appcontroller.conf configuration file looks like this:

    \badcode
    env=QT_QPA_GENERIC_PLUGINS=simulator
    env=QT_QPA_EGLFS_HIDECURSOR=1
    env=QML2_IMPORT_PATH=/data/user/qt/qmlplugins
    env=QT_IM_MODULE=qtvirtualkeyboard
    env=QTGLESSTREAM_DISPLAY=192.168.56.1
    env=QT_QUICK_CONTROLS_STYLE=Flat
    base=linux
    platform=emulator
    \endcode

    \table
    \row
        \li \c base
        \li Has to be \c linux
    \row
        \li \c platform
        \li Has to be \c emulator
    \row
        \li \c env
        \li All these variables will be added to the environment before
            starting the application.
    \endtable
*/