MeeGo 1.2 Harmattan Developer Documentation Develop for the Nokia N9

Configuring runtimes in MADDE

Note: Qt SDK installer sets up a runtime for your target automatically.

Runtime environments are used to run the cross-compiled software. There are two types of runtime environments:

  • device runtimes
  • QEMU runtimes

To run your application on the Harmattan device, you must create a device runtime. Names for the device runtimes are not predefined.

To run your application on the emulator, you must create a QEMU runtime for the platform version for which you are developing applications. A tailored version of QEMU is used to emulate a device. There is a predefined list of QEMU runtimes. Each of the listed runtimes corresponds to a specific target software release in the MADROOT/cache/madde.conf.d directory in the corresponding target configuration file, such as harmattan.conf. The list links a runtime name to the file that contains all the data needed to emulate the specific target in QEMU. The file is searched from MADROOT/cache. For QEMU runtimes, only preconfigured runtime names are used.

Note: In the MADDE terminal user guide, MADROOT refers to the <MADDE install path>.

Viewing runtimes

Before running an application, verify that you have the needed runtime installed in MADDE.

1. To view the available platform versions for QEMU runtimes and see to which targets these are bound, enter the following command:

mad list -v

2. Check the status of the runtime that you want to select.

Note: You can only set the runtime to default by setting the target that the runtime is bound to as the default target. A QEMU runtime cannot be set as default explicitly.

Installing QEMU runtimes

1. To create a runtime, enter the following command

mad-admin create <runtime name>

It can take several minutes to create a QEMU runtime. During command execution, the QEMU runtime is started and it stays open after the command is finished.

2. After the command has finished, enter the following command:

mad list

The created runtime appears on the list as either 'installed' or 'default'.

After the QEMU runtime has been created, it can be switched on and off with the following commands:

mad remote -r <runtime name> poweron 
mad remote -r <runtime name> poweroff

Note that all the changes you make in a QEMU runtime when it is running (such as installing Debian packages or copying, removing, or modifying files) are stored and available after closing (poweroff) and opening (poweron) a QEMU runtime again. To reset a QEMU runtime back to initial (factory) state, remove it and create it again. Enter the following commands:

mad-admin remove <runtime name>
mad-admin create <runtime name>

Cloning QEMU runtimes

To take a snapshot of a QEMU runtime, use the mad-admin clone command. The runtime must not be running when cloning is done. Enter the following command:

mad-admin clone <snapshot name>

If the runtime is not specified with the -r option, a runtime bound to the default target is cloned. To specify a runtime to be cloned, enter the following command:

mad-admin clone -r <runtime name> <snapshot name>

Installing device runtimes

1. Configure the device-to-SDK connection.

2. When your workstation is connected to your device, start the SDK Connectivity tool on your device (if not running yet), select Password, and let the generated password stay on the screen.

3. In the host workstation, enter the following command:

mad-admin create <runtime name> -a <ip-address>

In this command, <ip-address> is the IP address of the used networking interface in the device. Enter the password shown on the SDK Connectivity tool when requested. After the command is executed, select Close in the SDK Connectivity tool and close the application.

4. After the command has finished, enter the following command:

mad list

The created runtime appears on the list as either 'installed' or 'default'.

For example, if you created a device runtime named 'n900', the following line is found in the output of the mad list command under Runtimes:

n900           (installed)

Running runtime commands

Installed runtimes can be managed with the mad remote command. If a QEMU runtime is in the 'default' state, it is not necessary to specify the runtime when giving a command.

For example, to log into a runtime with SSH as a developer user:

mad remote shell

If a QEMU runtime is in 'installed' state, the mad remote command requires the runtime to be explicitly defined:

mad remote -r <runtime name> shell

Note: When using the -r <runtime name> option, ensure that your application is compatible with the defined runtime.

Alternatively, you can define the used QEMU runtime by specifying the target to which the QEMU runtime is bound. Enter the following command:

mad -t <target name> remote shell

When a target is set as 'default', the runtime bound to that target is also set as default. When developing for a target and using a QEMU runtime, it is always safe to use -t <target name> with remote commands. This option guarantees that the application is binary-compatible with the runtime to be used.

Other tasks

You can also use the following commands:

  • To remove files from a runtime, enter the following command:
mad remote -r <runtime name> remove <file>
  • To uninstall Debian packages, enter the following command:
mad remote -r <runtime name> uninstall <Debian package>
  • To check if a runtime is up and connectable, enter the following command:
mad remote -r <runtime name> ping

For a full list of MADDE commands, see MADDE Command reference.