MeeGo 1.2 Harmattan Developer Documentation Develop for the Nokia N9

Using QEMU in Scratchbox

The Harmattan emulator (QEMU) provides access to an authentic Harmattan system without an actual Harmattan device. QEMU allows you to run and test applications in an environment practically identical to the device. Threre are separate versions of QEMU available for each Harmattan release:

  • PR1.0
  • PR1.1
  • PR1.2

Installing QEMU

  1. Download the compressed tar file. There are separate QEMU images available for each Harmattan release, and an i686 32-bit and x86 64-bit version of each of them for different processors:
    • PR1.0 i686 32-bit
    • PR1.0 x86 64-bit
    • PR1.1 i686 32-bit
    • PR1.1 x86 64-bit
    • PR1.2 i686 32-bit
    • PR1.2 x86 64-bit
  2. To extract the file, enter the following command:
    $ tar -C <your installation path> -xvf <qemu archive name>

Running applications in QEMU

To run an application in QEMU, you must package the application and copy it to QEMU. For instructions on packaging the application using MeeGo 1.2 Harmattan Platform SDK, see Creating and running your first application with Platform SDK.

  1. To start QEMU, enter the following command:
    $ <your installation path>/
  2. To copy the created Debian package inside QEMU, enter the following command:
    $ scp -P6666 <path>/<your application>.deb root@localhost:/home/user
  3. To log into QEMU and install your application, enter the following command:
    $ ssh -p6666 root@localhost
  4. To install your package inside QEMU, enter the following command:
    QEMU_MR0:~# dpkg -i /home/user/<your application>.deb
  5. To change the user to normal user and start the application, enter the following commands:
    QEMU_MR0:~# su - user
    QEMU_MR0:~# <your application>

Using QEMU with mouse and keyboard

You can use QEMU to emulate the device touch screen:

  • To emulate touch-screen use, click the desired place on the emulator with the left mouse button.

To close QEMU, click on the QEMU window's X button. QEMU displays the text "Shutting down" in the QEMU window title pane and closes shortly after this.

Internet connection for QEMU is created automatically at QEMU run-time startup. The connection can only be used through the root console, not through QEMU graphical user interface.

Emulating the Harmattan device keys with the computer keyboard

The following table summarises how to emulate device keys or functions by using computer keyboard keys.

Key mapping between device and computer keyboard
Device key or function Computer key or shortkey
  • alphabet keys
  • comma (,)
  • period (.)
  • space
  • arrow keys
  • enter
  • backspace
Respective keys on the computer keyboard
Shift Shift key
Ctrl Ctrl key
Mode Alt key
power Esc
keypad slider open/close F1
camera focus F4
camera take picture F5

Note: The actual camera function is not emulated.

volume down F7
volume up F8
accelerometer X axis, negative 1 (in the numeric keypad)
accelerometer X axis, positive 2 (in the numeric keypad)
accelerometer Z axis, negative 4 (in the numeric keypad)
accelerometer Z axis, positive 5 (in the numeric keypad)
accelerometer Y axis, negative 7 (in the numeric keypad)
accelerometer Y axis, positive 8 (in the numeric keypad)

Note: One push of the accelerometer key turns the acceleration by 50 %.