Meego Wiki
Views

SDK/Setup/Debugging MeeGo Applications

From MeeGo wiki
(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
In Qt Creator you setup MeeGo device configurations to deploy your application to either a real hardware device or to a virtual machine, such as QEMU, running on your host.  Qt Creator treats these configurations in the same way.  When you start to debug your application Qt Creator will package your applications as an RPM, deploy it to the device you've selected in your project settings, install it, and run the executable.  The mad-developer package must be installed on the target OS.
In Qt Creator you setup MeeGo device configurations to deploy your application to either a real hardware device or to a virtual machine, such as QEMU, running on your host.  Qt Creator treats these configurations in the same way.  When you start to debug your application Qt Creator will package your applications as an RPM, deploy it to the device you've selected in your project settings, install it, and run the executable.  The mad-developer package must be installed on the target OS.
-
The developer follows these steps:
+
Steps to start debugging an application:
<ol>
<ol>
  <li>Create one or more MeeGo Device Configurations</li>
  <li>Create one or more MeeGo Device Configurations</li>
  <li>Select one of the configurations for the current project</li>
  <li>Select one of the configurations for the current project</li>
  <li>Start the device (boot the hardware or virtual machine)</li>
  <li>Start the device (boot the hardware or virtual machine)</li>
-
  <li>Start debugging the application.  Qt Creator deploys and starts the application on the remote system or virtual machine</li>
+
<li>(Optional) Set breakpoints in your code</li>
 +
  <li>Start debugging the application</li>
</ol>
</ol>
=== 1. Create MeeGo Device Configurations ===
=== 1. Create MeeGo Device Configurations ===
Open ''Tools'' > ''Options'' > ''Projects'' > ''MeeGo Device Configurations''
Open ''Tools'' > ''Options'' > ''Projects'' > ''MeeGo Device Configurations''
-
 
<table>
<table>
  <tr><td valign="top">
  <tr><td valign="top">
-
'''Create a QEMU virtual machine device configuration:'''
+
'''Create a hardware device configuration:'''
# In the dialog box, create a new Device Configuration by clicking on '''Add'''.
# In the dialog box, create a new Device Configuration by clicking on '''Add'''.
# Give the new Device Configuration a name in the Configuration Name text field, and add the following settings in the other test fields:
# Give the new Device Configuration a name in the Configuration Name text field, and add the following settings in the other test fields:
-
#* Device type: choose MeeGo emulator
+
#* Device type: Remote device
#* Authentication type: Password
#* Authentication type: Password
-
#* Host name: 127.0.0.1
+
#* Host name: <IP Address of remote device>
#* Ports, SSH: 6666
#* Ports, SSH: 6666
#*: Note that the emulator is setup with a redirect from port 6666 on localhost to the SSH port (22) of the emulated device.
#*: Note that the emulator is setup with a redirect from port 6666 on localhost to the SSH port (22) of the emulated device.
#* Ports, Gdb Server: 13219 (the default)
#* Ports, Gdb Server: 13219 (the default)
#: '''Note:''' If this port is not free, you can select another one.
#: '''Note:''' If this port is not free, you can select another one.
-
#* Connection Timeout: 30s
+
#* Connection Timeout: 30
#* User Name: root
#* User Name: root
#* Password: meego
#* Password: meego
# Click '''Apply'''
# Click '''Apply'''
-
  </td>
+
  </td>
-
  <td valign="bottom">[[File:sdk-docs-QtCreator-configuring-emulator-access.png|thumb|500px]]</td>
+
  <td valign="top">[[File:Qt-config-device-config.jpg|thumb|500px]]</td>
  </tr>
  </tr>
</table>
</table>
<table>
<table>
-
  <tr><td>
+
  <tr><td valign="top">
-
'''Create a hardware device configuration:'''
+
'''Create a QEMU virtual machine device configuration:'''
# In the dialog box, create a new Device Configuration by clicking on '''Add'''.
# In the dialog box, create a new Device Configuration by clicking on '''Add'''.
# Give the new Device Configuration a name in the Configuration Name text field, and add the following settings in the other test fields:
# Give the new Device Configuration a name in the Configuration Name text field, and add the following settings in the other test fields:
-
#* Device type: choose MeeGo emulator
+
#* Device type: MeeGo emulator
#* Authentication type: Password
#* Authentication type: Password
-
#* Host name: <IP Address of remote device>
+
#* Host name: 127.0.0.1
#* Ports, SSH: 6666
#* Ports, SSH: 6666
#*: Note that the emulator is setup with a redirect from port 6666 on localhost to the SSH port (22) of the emulated device.
#*: Note that the emulator is setup with a redirect from port 6666 on localhost to the SSH port (22) of the emulated device.
#* Ports, Gdb Server: 13219 (the default)
#* Ports, Gdb Server: 13219 (the default)
#: '''Note:''' If this port is not free, you can select another one.
#: '''Note:''' If this port is not free, you can select another one.
-
#* Connection Timeout: 30
+
#* Connection Timeout: 30s
#* User Name: root
#* User Name: root
#* Password: meego
#* Password: meego
# Click '''Apply'''
# Click '''Apply'''
-
  </td>
+
  </td>
-
  <td>[[File:Qt-config-device-config.jpg|thumb|500px]]</td>
+
  <td valign="top">[[File:sdk-docs-QtCreator-configuring-emulator-access.png|thumb|500px]]</td>
  </tr>
  </tr>
</table>
</table>
'''Test the settings''' <br>
'''Test the settings''' <br>
-
# To test the settings, ensure that the emulated device is running, then click '''Test'''.
+
To test the settings, ensure that the emulated device is running, then click '''Test'''.
-
# If successful, you'll see a dialog box with the message "Device configuration successful".
+
If successful, you'll see a dialog box with the message "Device configuration successful".
-
# If the message "Could not connect to host" is displayed, check your setting selections and make sure that the network is connected.
+
If the message "Could not connect to host" is displayed, check your setting selections and make sure that the network is connected.
=== 2. Select one of the configurations for the current project ===
=== 2. Select one of the configurations for the current project ===
Line 102: Line 102:
=== 4. Start debugging the application ===
=== 4. Start debugging the application ===
 +
Qt Creator deploys and starts the application on the remote system or virtual machine.  You can view/step-through the code in the IDE while your application runs on the remote device or virtual machine.

Revision as of 22:55, 30 March 2011

In Qt Creator you setup MeeGo device configurations to deploy your application to either a real hardware device or to a virtual machine, such as QEMU, running on your host. Qt Creator treats these configurations in the same way. When you start to debug your application Qt Creator will package your applications as an RPM, deploy it to the device you've selected in your project settings, install it, and run the executable. The mad-developer package must be installed on the target OS.

Steps to start debugging an application:

  1. Create one or more MeeGo Device Configurations
  2. Select one of the configurations for the current project
  3. Start the device (boot the hardware or virtual machine)
  4. (Optional) Set breakpoints in your code
  5. Start debugging the application

Contents

1. Create MeeGo Device Configurations

Open Tools > Options > Projects > MeeGo Device Configurations

Create a hardware device configuration:

  1. In the dialog box, create a new Device Configuration by clicking on Add.
  2. Give the new Device Configuration a name in the Configuration Name text field, and add the following settings in the other test fields:
    • Device type: Remote device
    • Authentication type: Password
    • Host name: <IP Address of remote device>
    • Ports, SSH: 6666
      Note that the emulator is setup with a redirect from port 6666 on localhost to the SSH port (22) of the emulated device.
    • Ports, Gdb Server: 13219 (the default)
    Note: If this port is not free, you can select another one.
    • Connection Timeout: 30
    • User Name: root
    • Password: meego
  3. Click Apply
Qt-config-device-config.jpg

Create a QEMU virtual machine device configuration:

  1. In the dialog box, create a new Device Configuration by clicking on Add.
  2. Give the new Device Configuration a name in the Configuration Name text field, and add the following settings in the other test fields:
    • Device type: MeeGo emulator
    • Authentication type: Password
    • Host name: 127.0.0.1
    • Ports, SSH: 6666
      Note that the emulator is setup with a redirect from port 6666 on localhost to the SSH port (22) of the emulated device.
    • Ports, Gdb Server: 13219 (the default)
    Note: If this port is not free, you can select another one.
    • Connection Timeout: 30s
    • User Name: root
    • Password: meego
  3. Click Apply
Sdk-docs-QtCreator-configuring-emulator-access.png

Test the settings
To test the settings, ensure that the emulated device is running, then click Test. If successful, you'll see a dialog box with the message "Device configuration successful". If the message "Could not connect to host" is displayed, check your setting selections and make sure that the network is connected.

2. Select one of the configurations for the current project

5. Set Run Configuration

  • Click "Projects" again on the left side. Select "Run" in the MeeGo Build/Run box at the top. If the "Device configuration" is set to "MeeGo tablet emulator". This will ensure that QEMU is started when you run your application.
  • You can now launch the QEMU MeeGo emulator. Click the "Start Meego emulator" icon near the bottom left corner of Qt Creator
    <img src="https://otcshare.org/meego-tablet/system/files/qtcreator_runtime_configure.png" width=650 alt="Qt Creator - choose runtime option"/>
  • if the "Device configuration" is set to "real device". This will ensure the application run in the tablet device.

6. Build, run and deploy the application

  • Click the "Run" icon to run your application. Qt Creator will package and deploy your application to QEMU or tablet device and start it on the target.
  • You can see the window of your application in QEMU or tablet device.
    <img src="ttps://otcshare.org/meego-tablet/system/files/meego_emulator_mtf.png" width=650 alt="MeeGo emulator - MTF sample"/>

7. Debug the application

Known Issues

  • The meegotouch development library has a bug which makes it conflict with the host Qt library. If you have installed another Qt library, you have to move the Qt libraries in /usr/lib to other place:
    1. sudo mkdir /usr/lib/qtbak
    2. sudo mv /usr/lib/libQt* /usr/lib/qtbak
  • Qt application can be built & deployed to the emulator, but it cannot be shown correctly. Only a black screen.
  • For QEMU, it is important to check your graphics capability. See <a href="https://otcshare.org/meego-tablet/node/586">SDK Graphics Acceleration</a>

3. Start the device (boot the hardware or virtual machine)

4. Start debugging the application

Qt Creator deploys and starts the application on the remote system or virtual machine. You can view/step-through the code in the IDE while your application runs on the remote device or virtual machine.

Personal tools