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 left side, select the Build & Run tab, click the Add Deploy Step button, then choose Run custom remote command.
  3. On the line 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.
  4. In the Command Line text field under Run custom remote command, enter the line:
    mount –uw /base
    By default, a QNX CAR image has a read-only filesystem. This command makes the filesystem writable, which is necessary to successfully upload files.
  5. Click Add Deploy Step again, choose Run custom remote command, and enter the following command:
    /base/scripts/bar-install /var/tmp/
    This command runs the installer on the target, installing the BAR package in the Apps section of the QNX CAR HMI.

    You should now have the following four deployment steps (where the first two 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/"
  6. 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 in the Apps section. The IDE displays timestamped messages detailing the outcomes of the deployment steps in the Console Output window.