Build-Qt-5-for-Tizen-Emulator
Qt for Tizen: Build
Authors: Jaroslaw Staniek [qt.io] (staniek at kde.org), Tomasz Olszak [qt.io] . Feedback welcome!
Introduction
This HOWTO explains full process of installation and configuration Qt SDK for Tizen, needed for developing software with Qt for Tizen smartphone (developer device RD-PQ [wiki.tizen.org] and emulator), Tizen NUC [intel.com] which is reference device for Tizen Common profile and Tizen IVI devices. This process applies to Qt for Tizen Alpha 7 and has been tested with Ubuntu 14.04 64bit. Other versions have not been tested (feedback is welcome). Version of Tizen SDK is 2.2.1. Version of Qt
While the process has been highly automatized, it consists of several steps.
Tizen Common profile (base of IVI profle)
Following steps describe creating Tizen Common cross compilation tools. But you can also use the same steps for IVI (just change profile parameter passed to prepare_developer_tools script)
- Install tizen development tools [qt.io]
- Download and install Qt 5.4.0, see instructions in Qt installation [qt.io]
- Download appropriate cross compilers:
- Arm and i586 cross compilers are available from Tizen Mobile SDK (see Install Tizen SDK [qt.io])
- For x86_64 architecture you can use system compiler
- Create developer tools
- for arm wayland
- for x86 wayland
- for x86_64 wayland
- for arm wayland
- Configure Qt Creator remote access to Intel NUC [intel.com]
Tizen Mobile profile
- Install development tools [qt.io]
- Download and install Qt 5.4.0, see instructions in Qt installation [qt.io]
- Download Tizen Mobile SDK [qt.io]
- Create developer tools
- For arm mobile device ( RD-PQ [wiki.tizen.org])
- for x86 mobile emulator (see -e switch)
- For arm mobile device ( RD-PQ [wiki.tizen.org])
- Build Qt Creator plugin [qt.io]
- Configure Qt Creator [qt.io]
- Please follow the steps described at Creating Hello World Application to validate configuration
Qt installation
Download official Qt installer suitable for your architecture. 5.4.0 version is placed in following remote directory:
http://download.qt.io/official_releases/qt/5.4/5.4.0
Make the binary executable (chmod u+x qt-opensource-linux-[x86|x64]-5.4.0.run), and install it in location writable by current user (write access is needed for tizen Qt Creator plugin)
Tizen Development Tools installation
Bash installation
Be sure that you have bash as your shell. By default Ubuntu has dash. To change the shell to bash invoke:
Gbs installation
Use command line for most of steps explained here. Install development tools (such as gbs) as specified at https://source.tizen.org/documentation/developer-guide/installing-development-tools [source.tizen.org]. Please note version of the distribution should be correctly specified when adding repository, so for Ubuntu 13.04:
In /etc/apt/sources.list.d/tizen.list add the folowing line to add repository (please note space before “/”):
All most recent Ubuntu and debian) versions are supported. See http://download.tizen.org/tools/latest-release
Then:
and:
this will show:
Answer “y” here.
This can show:
Answer “y” here again.
tizenbuildtools installation
Clone the tizenbuildtools git repository:
Tizen SDK installation
Even while Qt developers prefer using Qt Creator (or their beloved text editor plus command line) over Tizen SDK’s Eclipse-based Integrated development environment, at least two tools are still needed:
- Tizen emulator for running Qt applications in emulated environment on the PC workstation without a need to use Tizen device(s)
- Compilation tools for building software (Qt and applications) for both emulator and actual Tizen device(s).
These tools are bundled and distributed in a single Tizen SDK so it should be installed first. To do so, perform following steps:
- Take look at prerequisites [developer.tizen.org]. Install required software for your OS.
- Download SDK Image [developer.tizen.org] for Ubuntu® 64bits: tizen-sdk-image-2.2.x-ubuntu64.zip, about 1.4GB. It’s useful for a kind of “offline installation”, which is recommended.
- Download Install Manager [developer.tizen.org] for Ubuntu® 64bits: tizen-sdk-ubuntu64-v2.2.x.bin, about 4MB.
- Use the Install Manager as explained here [developer.tizen.org] to install previously downloaded “SDK Image”.
About 5 GB of free disk space is needed for these steps.
Result: You should be able to:
- run the installed Tizen IDE by clicking “Applications > Tizen SDK > Tizen IDE” in the system menu
- run the installed Emulator Manager by clicking “Applications > Tizen SDK > Emulator Manager” in the system menu and then, create Tizen virtual machine that would be used in the development process
If you want to develop for mobile profile (Tizen Mobile device or emulator) you need to add author certificate. The certificate generator tool is a cross-platform command line tool used to generate developer private keys and certificates from their intermediate CA certificates. The private keys and certificates are used for signing and verifying Tizen applications. To create and register certificate in the Tizen IDE as explained here [developer.tizen.org].
Build Tizen plugin for Qt Creator
After installing Qt SDK [qt.io] (by default to $HOME/Qt5.4.0 directory), follow the README file placed in tizenbuildtools/README. After that start Qt Creator. The Tizen plugin should be available.
Configure Qt Creator
Tizen Common and IVI
Follow this steps to build,. deploy, debug and run Qt applications on Tizen Common or Tizen IVI (or other Tizen profiles where ssh server is available on device)
Prepare device
By default “app” user (used for development) doesn’t have a password, so if you want to connect using ssh you need to set password:
and (if you want to log in without password) copy you public key:
Also you need to install Qt libraries on device:
Connect device to Qt Creator
- Go to Tools-Options
- In Build&Run section
- Add corresponding Qt version (like in mobile profile)
- Add New Kit
- Set previously added Qt Version
- As compiler set cross compilers from Tizen SDK or host compiler in case if device and host architectures are the same
- The same with debugger
- As device type set Generic Linux Device
- Click manage button in device section to add Generic Linux Device, next click add, choose Generic Linux Device. In dialog box set name of a device (like Tizen NUC), device’s IP, user name to log in using ssh and password or key authentication.
Qt Creator Generic Device configuration - After adding the device Qt Creator will test if connection work.
- Create new test project:
- File->New File or Project->Qt Quick Application
- Choose name and directory, then Next, check The kit you created before and click Finish.
- Edit *.pro file and add
before - It should be possible to build and run application on device from Qt Creator. If you have debugger set you should also be able to debug applications.
Tizen Mobile
All configuration steps listed below should be performed and in specified order.
- Tizen configuration:
- Run Emulator Manager by clicking “Applications > Tizen SDK > Emulator Manager” in the system menu and then use it to run the Emulator virtual machine you have created before. Note: Always run Emulator before running Qt Creator, not the other way around.
- Run the installed Qt Creator
- Click Tools -> Options, and in the dialog select “Tizen” item
- Near “Tizen SDK Path” click Browse button
- Select Tizen SDK’s instalation directory (default is $HOME/tizen-sdk), click OK; this will automatically fill several entries: SDK data directory, sdb executable, native-packaging executable
- Near “Author certificate” click Browse button
- Select author certificate, by default a file in $HOME/tizen-sdk-data/keystore/author/
- Fill the “Author certificate password” field with password you have provided in the step “Configure Development Tools” before
- Tizen emulator-related configuration:
- In the Options dialog, select “Devices” item
- In the Device combo box select “tizen (default for Tizen Device)
- Change Name to Tizen Emulator to indicate the device
- In the Options dialog, select “Build & Run” item
- Click “Qt Versions” tab
- Click “Add” button
- Select qmake for working for tizen emulator builds. The path should be $HOME/dev/src/tizenbuildtools/emulator/qt5CrossCompileToolsBUILD_ARCHEmulator/bin/qmake. Please change $HOME/dev/src to your top level source code directory if you have picked different one in the beginning.
- Click “Apply” button on the bottom of the dialog to accept addition of the new Qt version.
- Click “Kits” tab
- Click “Add” button to add a new kit. It will be used for building and deploying apps to Tizen emulator.
- By default the new kit has name “Unnamed”, change it in the “Name” text box to “Tizen Emulator”
- In “Device type” combo box select “Tizen Device”
- In “Compiler” combo box select “Tizen GCC (x86)”
- In “Qt Version” combo box select “Qt 5.4.0 (Tizen emulator)”
- Click “Apply” button on the bottom of the dialog to accept addition of the new kit.