Build Qt for Tizen: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
[toc align_right="yes"]
[toc align_right="yes"]


= [[Tizen|Qt for Tizen]]: Build =
= [[Tizen|Qt for Tizen]]: Build =


Authors: "Jaroslaw Staniek":http://qt.io/member/6526 (staniek at kde.org), "Tomasz Olszak":http://qt.io/mebmer/125046 . Feedback welcome!
Authors: "Jaroslaw Staniek":http://qt.io/member/6526 (staniek at kde.org), "Tomasz Olszak":http://qt.io/mebmer/125046 . Feedback welcome!


== Introduction ==
== 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":https://wiki.tizen.org/wiki/Reference_Device-PQ and emulator), Tizen "NUC":http://www.intel.com/content/www/us/en/nuc/overview.html 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
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":https://wiki.tizen.org/wiki/Reference_Device-PQ and emulator), Tizen "NUC":http://www.intel.com/content/www/us/en/nuc/overview.html 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.
While the process has been highly automatized, it consists of several steps.


== Tizen Common profile (base of IVI profle) ==
== 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)
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":http://wiki.qt.io/Build-Qt-for-Tizen/#e5129e03d708d7fbbe5e3e22b30f2d9a
# Install "tizen development tools":http://wiki.qt.io/Build-Qt-for-Tizen/#e5129e03d708d7fbbe5e3e22b30f2d9a
# Download and install Qt 5.4.0, see instructions in " Qt installation":http://wiki.qt.io/Build-Qt-for-Tizen#e17f66a5cb160b4eb49231b706a325e1
# Download and install Qt 5.4.0, see instructions in " Qt installation":http://wiki.qt.io/Build-Qt-for-Tizen#e17f66a5cb160b4eb49231b706a325e1
# Download appropriate cross compilers:
# Download appropriate cross compilers:
## Arm and i586 cross compilers are available from Tizen Mobile SDK (see "Install Tizen SDK":http://wiki.qt.io/Build-Qt-for-Tizen/#03671ee18b8489596b11f5b70d6ff721)
## Arm and i586 cross compilers are available from Tizen Mobile SDK (see "Install Tizen SDK":http://wiki.qt.io/Build-Qt-for-Tizen/#03671ee18b8489596b11f5b70d6ff721)
## For x86_64 architecture you can use system compiler
## For x86_64 architecture you can use system compiler
# Create developer tools
# Create developer tools
Line 24: Line 24:
## for x86 wayland<br /><code>cd tizenbuildtools/profiles<br />./prepare_developer_tools -b i586 -p common -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake<br /></code>
## for x86 wayland<br /><code>cd tizenbuildtools/profiles<br />./prepare_developer_tools -b i586 -p common -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake<br /></code>
## for x86_64 wayland<br /><code>cd tizenbuildtools/profiles<br />./prepare_developer_tools -b x86_64 -p common -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake<br /></code>
## for x86_64 wayland<br /><code>cd tizenbuildtools/profiles<br />./prepare_developer_tools -b x86_64 -p common -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake<br /></code>
# Configure Qt Creator remote access to &quot;Intel NUC&amp;quot;:http://www.intel.com/content/www/us/en/nuc/overview.html
# Configure Qt Creator remote access to "Intel NUC":http://www.intel.com/content/www/us/en/nuc/overview.html


== Tizen Mobile profile ==
== Tizen Mobile profile ==


# Install &quot;development tools&amp;quot;:http://wiki.qt.io/Build-Qt-for-Tizen/#e5129e03d708d7fbbe5e3e22b30f2d9a
# Install "development tools":http://wiki.qt.io/Build-Qt-for-Tizen/#e5129e03d708d7fbbe5e3e22b30f2d9a
# Download and install Qt 5.4.0, see instructions in &quot; Qt installation&amp;quot;:http://wiki.qt.io/Build-Qt-for-Tizen/#e17f66a5cb160b4eb49231b706a325e1
# Download and install Qt 5.4.0, see instructions in " Qt installation":http://wiki.qt.io/Build-Qt-for-Tizen/#e17f66a5cb160b4eb49231b706a325e1
# Download &quot;Tizen Mobile SDK&amp;quot;:http://wiki.qt.io/Build-Qt-for-Tizen/#03671ee18b8489596b11f5b70d6ff721
# Download "Tizen Mobile SDK":http://wiki.qt.io/Build-Qt-for-Tizen/#03671ee18b8489596b11f5b70d6ff721
# Create developer tools
# Create developer tools
## For arm mobile device ( &quot;RD-PQ&amp;quot;:https://wiki.tizen.org/wiki/Reference_Device-PQ)<br /><code>cd tizenbuildtools/profiles<br />./prepare_developer_tools -b armv7l -p mobile -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake<br /></code>
## For arm mobile device ( "RD-PQ":https://wiki.tizen.org/wiki/Reference_Device-PQ)<br /><code>cd tizenbuildtools/profiles<br />./prepare_developer_tools -b armv7l -p mobile -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake<br /></code>
## for x86 mobile emulator (see -e switch)<br /><code>cd tizenbuildtools/profiles<br />./prepare_developer_tools -b i586 -p mobile -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake <s>e<br /></code><br /># Build &quot;Qt Creator plugin&amp;quot;:http://wiki.qt.io/Build-Qt-for-Tizen/#00b2d759558c279641a474b3190dc4c3<br /># &quot;Configure Qt Creator&amp;quot;:http://wiki.qt.io/Build-Qt-for-Tizen/#dfa8292bf407276a9cc00706b52b7a8e<br /># Please follow the steps described at [[Creating Hello World Application]] to validate configuration
## for x86 mobile emulator (see -e switch)<br /><code>cd tizenbuildtools/profiles<br />./prepare_developer_tools -b i586 -p mobile -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake -e<br /></code><br /># Build "Qt Creator plugin":http://wiki.qt.io/Build-Qt-for-Tizen/#00b2d759558c279641a474b3190dc4c3<br /># "Configure Qt Creator":http://wiki.qt.io/Build-Qt-for-Tizen/#dfa8292bf407276a9cc00706b52b7a8e<br /># Please follow the steps described at [[Creating Hello World Application]] to validate configuration
<br />h2. Qt installation
<br />h2. Qt installation
<br />Download official Qt installer suitable for your architecture. 5.4.0 version is placed in following remote directory:<br />http://download.qt.io/official_releases/qt/5.4/5.4.0<br />Make the binary executable (chmod u+x qt-opensource-linux</s>[x86|x64]–5.4.0.run), and install it in location writable by current user (write access is needed for tizen Qt Creator plugin)
<br />Download official Qt installer suitable for your architecture. 5.4.0 version is placed in following remote directory:<br />http://download.qt.io/official_releases/qt/5.4/5.4.0<br />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 ==
== Tizen Development Tools installation ==
Line 43: Line 43:
Be sure that you have bash as your shell. By default Ubuntu has dash. To change the shell to bash invoke:<br /><code><br />sudo dpkg-reconfigure dash
Be sure that you have bash as your shell. By default Ubuntu has dash. To change the shell to bash invoke:<br /><code><br />sudo dpkg-reconfigure dash


#can be cheked with &quot;file -L $SHELL&amp;quot; should print &quot;:/bin/bash:&quot;<br /></code>
#can be cheked with "file -L $SHELL" should print ":/bin/bash:"<br /></code>


=== Gbs installation ===
=== Gbs installation ===


Use command line for most of steps explained here. Install development tools (such as gbs) as specified at &quot;https://source.tizen.org/documentation/developer-guide/installing-development-tools&amp;quot;:https://source.tizen.org/documentation/developer-guide/installing-development-tools. Please note version of the distribution should be correctly specified when adding repository, so for Ubuntu 13.04:
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":https://source.tizen.org/documentation/developer-guide/installing-development-tools. Please note version of the distribution should be correctly specified when adding repository, so for Ubuntu 13.04:


<code>sudo vim /etc/apt/sources.list.d<code>
<code>sudo vim /etc/apt/sources.list.d<code>


In /etc/apt/sources.list.d/tizen.list add the folowing line to add repository (please note space before &quot;/&amp;quot;):
In /etc/apt/sources.list.d/tizen.list add the folowing line to add repository (please note space before "/"):


</code>deb http://download.tizen.org/tools/latest-release/${YOUR_UBUNTU_VERSION} /</code>
</code>deb http://download.tizen.org/tools/latest-release/${YOUR_UBUNTU_VERSION} /</code>
Line 65: Line 65:
this will show:<br /><code>The following extra packages will be installed:<br /> …..<br />The following NEW packages will be installed:<br /> …..<br />Do you want to continue [Y/n]? </code>
this will show:<br /><code>The following extra packages will be installed:<br /> …..<br />The following NEW packages will be installed:<br /> …..<br />Do you want to continue [Y/n]? </code>


Answer &quot;y&amp;quot; here.
Answer "y" here.


This can show:
This can show:
Line 71: Line 71:
<code>WARNING: The following packages cannot be authenticated!<br /> ….<br />Install these packages without verification [y/N]? </code>
<code>WARNING: The following packages cannot be authenticated!<br /> ….<br />Install these packages without verification [y/N]? </code>


Answer &quot;y&amp;quot; here again.
Answer "y" here again.


=== tizenbuildtools installation ===
=== tizenbuildtools installation ===
Line 77: Line 77:
Clone the tizenbuildtools git repository:
Clone the tizenbuildtools git repository:


<code>git clone <s>b alpha7 git://gitorious.org/tizenbuildtools/tizenbuildtools.git<br />cd tizenbuildtools<br />git checkout v_alpha7.0<br /></code>
<code>git clone -b alpha7 git://gitorious.org/tizenbuildtools/tizenbuildtools.git<br />cd tizenbuildtools<br />git checkout v_alpha7.0<br /></code>


<br />h2. Tizen SDK installation
<br />h2. Tizen SDK installation
<br />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:<br />* '''Tizen emulator''' for running Qt applications in emulated environment on the PC workstation without a need to use Tizen device(s)<br />* '''Compilation tools''' for building software (Qt and applications) for both emulator and actual Tizen device(s).
<br />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:<br />* '''Tizen emulator''' for running Qt applications in emulated environment on the PC workstation without a need to use Tizen device(s)<br />* '''Compilation tools''' for building software (Qt and applications) for both emulator and actual Tizen device(s).
<br />These tools are bundled and distributed in a single Tizen SDK so it should be installed first. To do so, perform following steps:
<br />These tools are bundled and distributed in a single Tizen SDK so it should be installed first. To do so, perform following steps:
<br />* Take look at &quot;prerequisites&amp;quot;:https://developer.tizen.org/downloads/sdk/installing-sdk/prerequisites-tizen-sdk. Install required software for your OS.<br />* Download &quot;SDK Image&amp;quot;:https://developer.tizen.org/downloads/tizen-sdk#sdk-images for Ubuntu® 64bits: tizen-sdk-image-2.2.x-ubuntu64.zip, about 1.4GB. It's useful for a kind of &quot;offline installation&amp;quot;, which is recommended.<br />* Download &quot;Install Manager&amp;quot;:https://developer.tizen.org/downloads/tizen-sdk#installmanager for Ubuntu® 64bits: tizen-sdk-ubuntu64-v2.2.x.bin, about 4MB.<br />* Use the Install Manager as explained &quot;here&amp;quot;:https://developer.tizen.org/downloads/sdk/installing-tizen-sdk#sdk to install previously downloaded &quot;SDK Image&amp;quot;.
<br />* Take look at "prerequisites":https://developer.tizen.org/downloads/sdk/installing-sdk/prerequisites-tizen-sdk. Install required software for your OS.<br />* Download "SDK Image":https://developer.tizen.org/downloads/tizen-sdk#sdk-images 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.<br />* Download "Install Manager":https://developer.tizen.org/downloads/tizen-sdk#installmanager for Ubuntu® 64bits: tizen-sdk-ubuntu64-v2.2.x.bin, about 4MB.<br />* Use the Install Manager as explained "here":https://developer.tizen.org/downloads/sdk/installing-tizen-sdk#sdk to install previously downloaded "SDK Image".
<br />About 5 GB of free disk space is needed for these steps.
<br />About 5 GB of free disk space is needed for these steps.
<br />'''Result:''' You should be able to:<br />* run the installed Tizen IDE by clicking &quot;Applications &gt; Tizen SDK &gt; Tizen IDE&amp;quot; in the system menu<br />* run the installed Emulator Manager by clicking &quot;Applications &gt; Tizen SDK &gt; Emulator Manager&amp;quot; in the system menu and then, create Tizen virtual machine that would be used in the development process
<br />'''Result:''' You should be able to:<br />* run the installed Tizen IDE by clicking "Applications > Tizen SDK > Tizen IDE" in the system menu<br />* 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
<br />If you want to develop for mobile profile &amp;#40;Tizen Mobile device or emulator&amp;amp;#41; 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 &quot;here&amp;quot;:https://developer.tizen.org/help/index.jsp?topic=/org.tizen.gettingstarted/html/dev_env/setting_author_certificate.htm.
<br />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":https://developer.tizen.org/help/index.jsp?topic=/org.tizen.gettingstarted/html/dev_env/setting_author_certificate.htm.


<br />h2. Build Tizen plugin for Qt Creator
<br />h2. Build Tizen plugin for Qt Creator
<br />After installing &quot;Qt SDK&amp;quot;:http://wiki.qt.io/Build-Qt-for-Tizen/edit/#e17f66a5cb160b4eb49231b706a325e1 (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.
<br />After installing "Qt SDK":http://wiki.qt.io/Build-Qt-for-Tizen/edit/#e17f66a5cb160b4eb49231b706a325e1 (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.


<br />h2. Configure Qt Creator
<br />h2. Configure Qt Creator
Line 94: Line 94:
<br />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)
<br />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)
<br />h5. Prepare device
<br />h5. Prepare device
<br />By default &quot;app&amp;quot; user (used for development) doesn't have a password, so if you want to connect using ssh you need to set password:<br /><code>ssh root<code>${device_ip}<br />#password tizen<br />$&amp;gt; passwd app<br /></code><br />and (if you want to log in without password) copy you public key:<br /><code><br />#on your host<br />ssh-copy-id app</code>device_ip<br /><code><br />Also you need to install Qt libraries on device:<br /></code><br />#invoke on device from rot account<br />zypper in qt*<br /><code>
<br />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:<br /><code>ssh root<code>${device_ip}<br />#password tizen<br />$> passwd app<br /></code><br />and (if you want to log in without password) copy you public key:<br /><code><br />#on your host<br />ssh-copy-id app</code>device_ip<br /><code><br />Also you need to install Qt libraries on device:<br /></code><br />#invoke on device from rot account<br />zypper in qt*<br /><code>
<br />h5. Connect device to Qt Creator
<br />h5. Connect device to Qt Creator
<br /># Go to Tools-Options<br /># In Build&amp;amp;Run section<br />## Add corresponding Qt version (like in mobile profile)<br />## Add New Kit<br />### Set previously added Qt Version<br />### As compiler set cross compilers from Tizen SDK or host compiler in case if device and host architectures are the same<br />### The same with debugger<br />### As device type set Generic Linux Device<br />### 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.<br />[[Image:https://drive.google.com/uc?id=0Bwa77UXf_zhhcEl5bjFZX2gyZ28|Qt Creator Generic Device configuration]]<br />### After adding the device Qt Creator will test if connection work.<br /># Create new test project:<br />## File</s>&gt;New File or Project-&gt;Qt Quick Application<br />## Choose name and directory, then Next, check The kit you created before and click Finish.<br />## Edit '''.pro file and add<br /></code>target.path = /home/app/temporary/deploy</code><br />before<br /><code>include(deployment.pri)<code><br />## 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.
<br /># Go to Tools-Options<br /># In Build&amp;amp;Run section<br />## Add corresponding Qt version (like in mobile profile)<br />## Add New Kit<br />### Set previously added Qt Version<br />### As compiler set cross compilers from Tizen SDK or host compiler in case if device and host architectures are the same<br />### The same with debugger<br />### As device type set Generic Linux Device<br />### 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.<br />[[Image:https://drive.google.com/uc?id=0Bwa77UXf_zhhcEl5bjFZX2gyZ28|Qt Creator Generic Device configuration]]<br />### After adding the device Qt Creator will test if connection work.<br /># Create new test project:<br />## File->New File or Project->Qt Quick Application<br />## Choose name and directory, then Next, check The kit you created before and click Finish.<br />## Edit '''.pro file and add<br /></code>target.path = /home/app/temporary/deploy</code><br />before<br /><code>include(deployment.pri)<code><br />## 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.
<br />h3. Tizen Mobile
<br />h3. Tizen Mobile
<br />All configuration steps listed below should be performed and in specified order.
<br />All configuration steps listed below should be performed and in specified order.
<br />''' Tizen configuration:<br />'''''' Run Emulator Manager by clicking &quot;Applications &gt; Tizen SDK &gt; Emulator Manager&amp;quot; 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.'''<br />'''''' Run the installed Qt Creator<br />'''''' Click Tools -&gt; Options, and in the dialog select &quot;Tizen&amp;quot; item<br />'''''' Near &quot;Tizen SDK Path&amp;quot; click Browse button<br />'''''' 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<br />'''''' Near &quot;Author certificate&amp;quot; click Browse button<br />'''''' Select author certificate, by default a file in $HOME/tizen-sdk-data/keystore/author/<br />'''''' Fill the &quot;Author certificate password&amp;quot; field with password you have provided in the step &quot;Configure Development Tools&amp;quot; before
<br />''' Tizen configuration:<br />'''''' 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.'''<br />'''''' Run the installed Qt Creator<br />'''''' Click Tools -> Options, and in the dialog select "Tizen" item<br />'''''' Near "Tizen SDK Path" click Browse button<br />'''''' 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<br />'''''' Near "Author certificate" click Browse button<br />'''''' Select author certificate, by default a file in $HOME/tizen-sdk-data/keystore/author/<br />'''''' Fill the "Author certificate password" field with password you have provided in the step "Configure Development Tools" before


* Tizen emulator-related configuration:
* Tizen emulator-related configuration:
** In the Options dialog, select &quot;Devices&amp;quot; item
** In the Options dialog, select "Devices" item
** In the Device combo box select &quot;tizen (default for Tizen Device)
** In the Device combo box select "tizen (default for Tizen Device)
** Change Name to Tizen Emulator to indicate the device  
** Change Name to Tizen Emulator to indicate the device  
** In the Options dialog, select &quot;Build &amp; Run&amp;quot; item
** In the Options dialog, select "Build &amp; Run" item
** Click &quot;Qt Versions&amp;quot; tab
** Click "Qt Versions" tab
** Click &quot;Add&amp;quot; button
** 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.
** 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 &quot;Apply&amp;quot; button on the bottom of the dialog to accept addition of the new Qt version.
** Click "Apply" button on the bottom of the dialog to accept addition of the new Qt version.
** Click &quot;Kits&amp;quot; tab
** Click "Kits" tab
** Click &quot;Add&amp;quot; button to add a new kit. It will be used for building and deploying apps to Tizen emulator.
** 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 &quot;Unnamed&amp;quot;, change it in the &quot;Name&amp;quot; text box to &quot;Tizen Emulator&amp;quot;
** By default the new kit has name "Unnamed", change it in the "Name" text box to "Tizen Emulator"
** In &quot;Device type&amp;quot; combo box select &quot;Tizen Device&amp;quot;
** In "Device type" combo box select "Tizen Device"
** In &quot;Compiler&amp;quot; combo box select &quot;Tizen GCC (x86)&quot;
** In "Compiler" combo box select "Tizen GCC (x86)"
** In &quot;Qt Version&amp;quot; combo box select &quot;Qt 5.4.0 (Tizen emulator)&quot;
** In "Qt Version" combo box select "Qt 5.4.0 (Tizen emulator)"
** Click &quot;Apply&amp;quot; button on the bottom of the dialog to accept addition of the new kit.
** Click "Apply" button on the bottom of the dialog to accept addition of the new kit.

Revision as of 14:13, 24 February 2015

[toc align_right="yes"]

Qt for Tizen: Build

Authors: "Jaroslaw Staniek":http://qt.io/member/6526 (staniek at kde.org), "Tomasz Olszak":http://qt.io/mebmer/125046 . 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":https://wiki.tizen.org/wiki/Reference_Device-PQ and emulator), Tizen "NUC":http://www.intel.com/content/www/us/en/nuc/overview.html 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)

  1. Install "tizen development tools":http://wiki.qt.io/Build-Qt-for-Tizen/#e5129e03d708d7fbbe5e3e22b30f2d9a
  2. Download and install Qt 5.4.0, see instructions in " Qt installation":http://wiki.qt.io/Build-Qt-for-Tizen#e17f66a5cb160b4eb49231b706a325e1
  3. Download appropriate cross compilers:
    1. Arm and i586 cross compilers are available from Tizen Mobile SDK (see "Install Tizen SDK":http://wiki.qt.io/Build-Qt-for-Tizen/#03671ee18b8489596b11f5b70d6ff721)
    2. For x86_64 architecture you can use system compiler
  4. Create developer tools
    1. for arm wayland
      cd tizenbuildtools/profiles<br />./prepare_developer_tools -b armv7l -p common -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake<br />
      
    2. for x86 wayland
      cd tizenbuildtools/profiles<br />./prepare_developer_tools -b i586 -p common -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake<br />
      
    3. for x86_64 wayland
      cd tizenbuildtools/profiles<br />./prepare_developer_tools -b x86_64 -p common -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake<br />
      
  5. Configure Qt Creator remote access to "Intel NUC":http://www.intel.com/content/www/us/en/nuc/overview.html

Tizen Mobile profile

  1. Install "development tools":http://wiki.qt.io/Build-Qt-for-Tizen/#e5129e03d708d7fbbe5e3e22b30f2d9a
  2. Download and install Qt 5.4.0, see instructions in " Qt installation":http://wiki.qt.io/Build-Qt-for-Tizen/#e17f66a5cb160b4eb49231b706a325e1
  3. Download "Tizen Mobile SDK":http://wiki.qt.io/Build-Qt-for-Tizen/#03671ee18b8489596b11f5b70d6ff721
  4. Create developer tools
    1. For arm mobile device ( "RD-PQ":https://wiki.tizen.org/wiki/Reference_Device-PQ)
      cd tizenbuildtools/profiles<br />./prepare_developer_tools -b armv7l -p mobile -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake<br />
      
    2. for x86 mobile emulator (see -e switch)
      cd tizenbuildtools/profiles<br />./prepare_developer_tools -b i586 -p mobile -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake -e<br />
      

      # Build "Qt Creator plugin":http://wiki.qt.io/Build-Qt-for-Tizen/#00b2d759558c279641a474b3190dc4c3
      # "Configure Qt Creator":http://wiki.qt.io/Build-Qt-for-Tizen/#dfa8292bf407276a9cc00706b52b7a8e
      # Please follow the steps described at Creating Hello World Application to validate configuration


h2. 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:

<br />sudo dpkg-reconfigure dash

#can be cheked with "file -L $SHELL" should print ":/bin/bash:"<br />

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":https://source.tizen.org/documentation/developer-guide/installing-development-tools. Please note version of the distribution should be correctly specified when adding repository, so for Ubuntu 13.04:

sudo vim /etc/apt/sources.list.d<code>

In /etc/apt/sources.list.d/tizen.list add the folowing line to add repository (please note space before "/"):

deb http://download.tizen.org/tools/latest-release/${YOUR_UBUNTU_VERSION} /

All most recent Ubuntu and debian) versions are supported. See http://download.tizen.org/tools/latest-release

Then:

sudo apt-get update<code>

and:

sudo apt-get install gbs this will show:

The following extra packages will be installed:<br /> ..<br />The following NEW packages will be installed:<br /> ..<br />Do you want to continue [Y/n]?

Answer "y" here.

This can show:

WARNING: The following packages cannot be authenticated!<br /> .<br />Install these packages without verification [y/N]?

Answer "y" here again.

tizenbuildtools installation

Clone the tizenbuildtools git repository:

git clone -b alpha7 git://gitorious.org/tizenbuildtools/tizenbuildtools.git<br />cd tizenbuildtools<br />git checkout v_alpha7.0<br />


h2. 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":https://developer.tizen.org/downloads/sdk/installing-sdk/prerequisites-tizen-sdk. Install required software for your OS.
* Download "SDK Image":https://developer.tizen.org/downloads/tizen-sdk#sdk-images 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":https://developer.tizen.org/downloads/tizen-sdk#installmanager for Ubuntu® 64bits: tizen-sdk-ubuntu64-v2.2.x.bin, about 4MB.
* Use the Install Manager as explained "here":https://developer.tizen.org/downloads/sdk/installing-tizen-sdk#sdk 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":https://developer.tizen.org/help/index.jsp?topic=/org.tizen.gettingstarted/html/dev_env/setting_author_certificate.htm.


h2. Build Tizen plugin for Qt Creator
After installing "Qt SDK":http://wiki.qt.io/Build-Qt-for-Tizen/edit/#e17f66a5cb160b4eb49231b706a325e1 (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.


h2. Configure Qt Creator
h3. 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)
h5. 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:

ssh root<code>${device_ip}<br />#password tizen<br />$> passwd app<br />


and (if you want to log in without password) copy you public key:

<br />#on your host<br />ssh-copy-id app

device_ip

<br />Also you need to install Qt libraries on device:<br />


#invoke on device from rot account
zypper in qt*

<br />h5. Connect device to Qt Creator
<br /># Go to Tools-Options<br /># In Build&amp;amp;Run section<br />## Add corresponding Qt version (like in mobile profile)<br />## Add New Kit<br />### Set previously added Qt Version<br />### As compiler set cross compilers from Tizen SDK or host compiler in case if device and host architectures are the same<br />### The same with debugger<br />### As device type set Generic Linux Device<br />### 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.<br />[[Image:https://drive.google.com/uc?id=0Bwa77UXf_zhhcEl5bjFZX2gyZ28|Qt Creator Generic Device configuration]]<br />### After adding the device Qt Creator will test if connection work.<br /># Create new test project:<br />## File->New File or Project->Qt Quick Application<br />## Choose name and directory, then Next, check The kit you created before and click Finish.<br />## Edit '''.pro file and add<br />

target.path = /home/app/temporary/deploy
before
include(deployment.pri)
## 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.


h3. 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.