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:

  1. Create a directory for the emulator parts:
    mkdir emulator
    cd emulator
  2. 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 ..
  3. Create a build directory for a shadow build:
    mkdir build
    cd build
  4. Build the QtSystems module:
    mkdir qtsystems
    pushd qtsystems
      qmake "${EMULATOR_SOURCE_DIR}"/src/qtsystems
      make
      make install
    popd
  5. Build the QtSimulator module:
    mkdir simulator
    pushd simulator
      qmake "${EMULATOR_SOURCE_DIR}"/src/qtsimulator
      make
      make install
    popd
  6. Build the QtGlesStream component:
    mkdir qtglesstream
    pushd qtglesstream
      qmake "${EMULATOR_SOURCE_DIR}"/src/qtglesstream
      make
      make install
    popd
  7. 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:

  1. Make sure that your Qt library is built with GLES support and defaults to eglfs.
  2. Make sure that the virtual machine is reachable with the IP address 192.168.56.101.
  3. Create a shared folder on the virtual machine and mount it to /var/vqvideo by using the 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.
    mkdir -p /var/vqvideo
    mount.vboxsf vqvideo /var/vqvideo
  4. Set up appcontroller, as instructed in Setting Up appcontroller.
  5. Build the emulatorproxy daemon that is located in the emulator sources in the src/helperlibs/proxy directory:
    cd "${EMULATOR_SOURCE_DIR}"/src/helperlibs/proxy
    sdk-qmake && make
  6. Start the emulatorproxy daemon on the device to enable the emulator to perform several tasks on the running machine. The daemon will fork itself.
  7. 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
  8. 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
  9. 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:

  1. Clone the appcontroller sources from git://codereview.qt-project.org/tqtc-boot2qt/appcontroller.
  2. Build appcontroller using qmake and make.
  3. Set appcontroller in the PATH.
  4. 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
baseHas to be linux
platformHas to be emulator
envAll these variables will be added to the environment before starting the application.

Available under certain Qt licenses.
Find out more.