C
Building the Emulator from Sources
To build the emulator from source, you need to build the emulator host part and an emulator device image for a VirtualBox virtual machine.
Building Emulator Host Part from Sources
To build the emulator host part from sources:
- Create a directory for the emulator parts:
mkdir emulator cd emulator
- Clone the emulator repositories:
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 ..
- Create a build directory for a shadow build:
mkdir build cd build
- Build the QtSystems module:
mkdir qtsystems pushd qtsystems qmake "${EMULATOR_SOURCE_DIR}"/src/qtsystems make make install popd
- Build the QtSimulator module:
mkdir simulator pushd simulator qmake "${EMULATOR_SOURCE_DIR}"/src/qtsimulator make make install popd
- Build the QtGlesStream component:
mkdir qtglesstream pushd qtglesstream qmake "${EMULATOR_SOURCE_DIR}"/src/qtglesstream make make install popd
- Build the emulator:
mkdir emulator pushd emulator EMULATOR_INSTALL_DIR=../install/ qmake "${EMULATOR_SOURCE_DIR}" PREFIX="${EMULATOR_INSTALL_DIR}" make make install popd
Building Emulator Device Image for VirtualBox VM
To build the emulator device image for a VirtualBox VM:
- Make sure that your Qt library is built with GLES support and defaults to eglfs.
- Make sure that the virtual machine is reachable with the IP address
192.168.56.101
. - Create a shared folder on the virtual machine and mount it to
/var/vqvideo
by using thevboxsf
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.mkdir -p /var/vqvideo mount.vboxsf vqvideo /var/vqvideo
- Set up
appcontroller
, as instructed in Setting Up appcontroller. - Build the
emulatorproxy
daemon that is located in the emulator sources in thesrc/helperlibs/proxy
directory:cd "${EMULATOR_SOURCE_DIR}"/src/helperlibs/proxy sdk-qmake && make
- Start the
emulatorproxy
daemon on the device to enable the emulator to perform several tasks on the running machine. The daemon will fork itself. - Clone the QtSimulator module from
ssh://codereview.qt-project.org/tqtc-boot2qt/qtsimulator
, and then build and deploy it on the device as any Qt module:git clone ssh://codereview.qt-project.org:29418/tqtc-boot2qt/qtsimulator cd qtsimulator sdk-qmake && make && make install
- Clone the QtGlesStream module from
ssh://codereview.qt-project.org/qt/tqtc-qtglesstream
, and then build and deploy it on the device:git clone ssh://codereview.qt-project.org:29418/qt/tqtc-qtglesstream tqtc-qtglesstream sdk-qmake && make && make install
- To enable handling touch and keyboard input, build the emulator specific input plugin from the emulator sources in the
src/helperlibs/vinput
directory using qmake and deploy it to the Qt input plugin folder on the device:cd "${EMULATOR_SOURCE_DIR}"/src/helperlibs/vinput sdk-qmake && make && make install
Setting Up appcontroller
To set up appcontroller
:
- Clone the
appcontroller
sources fromgit://codereview.qt-project.org/tqtc-boot2qt/appcontroller
. - Build
appcontroller
using qmake and make. - Set
appcontroller
in the PATH. - Create a configuration file for
appcontroller
to configure device specific variables for your application.
An example /etc/appcontroller.conf
configuration file looks like this:
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
base | Has to be linux |
platform | Has to be emulator |
env | All these variables will be added to the environment before starting the application. |
Available under certain Qt licenses.
Find out more.