Deploying the BAR file on the target

Before you can run an app on the target system, you must copy the app's BAR file to a temporary location on the target and then run the installation script to set up the app. You can configure Qt Creator to automate deploying the BAR file and installing the app.

The steps shown here define commands for Qt Creator to issue to the target as part of the deployment process, automating part of the app development process for convenience. You could also issue these commands manually through a QNX Neutrino terminal connected to the target and the result would be the same.
To deploy an app on the target from Qt Creator:
  1. Open the project file ( for editing and add the following lines to the end:
    barfile.path = /var/tmp
    barfile.files = $$OUT_PWD/
    INSTALLS += barfile

    This addition to the INSTALLS command instructs Qt Creator to copy to /var/tmp on the target. The target is represented in Qt Creator as a QNX device, as explained in "Configuring a QNX device in Qt Creator".

  2. Click the Projects icon on the left side, select the Build & Run tab, then click the Run button to switch to the Run Settings page.
  3. Click the Add Deploy Step button, then choose Run custom remote command.
  4. In the newly displayed box that reads Run custom remote command, click the "Move up" button (which has an arrowhead pointing upwards), to ensure that this step is done before the Upload files via SFTP step.
  5. In the Command Line text field under Run custom remote command, enter the line:
    mount –uw /base
    By default, a QNX Apps and Media image has a read-only filesystem. This command makes the filesystem writable, which is necessary to successfully upload files.
  6. Click Add Deploy Step again, choose Run custom remote command, and enter the following command in the newly displayed Command Line field:
    /base/scripts/bar-install /var/tmp/

    This command runs the installer on the target, installing the BAR package in a location accessible to the Home screen.

    You should have the following deployment steps (where the first and third were predefined):

    1. Check for a configured device (default)
    2. Run custom remote command: "mount -uw /base"
    3. Upload files via SFTP (default)
    4. Run custom remote command: "/base/scripts/bar-install /var/tmp/"
  7. Click the Edit icon on the left side, select the Build menu, then choose Deploy Project "QtApp".

    Qt Creator performs the configured deployment steps, first copying the BAR file to the specified target location, and then running the installer script to unpackage the app so it's visible to the Home screen app. The IDE displays timestamped messages detailing the outcomes of the deployment steps in the Compile Output window.