Important: Please read the Qt Code of Conduct -

Qt Creator remote - how to upload via SFTP?

  • Hi all!

    I'm struggling with the deployment configuration for Qt Creator. My development platform is a Debian 8 Jessie (64bit) and the target platform for deployment is the Raspberry Pi 2 (latest Raspbian; will call it RPi2 for short from now on). I have successfully installed the Emdebian Toolchain with its arm-linux-gnueabihf-g++ (armhf is the one used on the RPi2), defined a new generic Linux device, a kit (the compiler + a debugger) and connected to my RPi2 via Qt Creator. After some issues I finally got Qt Creator to compile binaries for the ARM architecture (I missed setting the system name, architecture and compiler in the CMakeLists.txt. However I am still trying to figure out how the upload of my binary works from within Qt Creator.

    I have added a QtCreatorDeployment.txt to the root of my CMake project containing the following (should be correct based on the documentation):


    The first line is supposed to represent the deployment prefix. The second line defines local (on my Debian 8) path to the executable on the left of the colons ":" (I have a build folder inside my project's root folder and it seems that Qt Creator automatically attaches the path to the project) and a remote path (on my RPi2) on the right side. From what I understand this is supposed to tell the SFTP "take the binary from the local and upload it to the remote". Well, for some reason it doesn't work.

    When I deploy my project (in the deployment settings I have selected the second path from my QtCreatorDeployment.txt file, which is the home of the RPi2 user I'm ssh-ing to through Qt Creator) it tells me that everything went fine (I even added a remote command at the end of the deployment chain which just echos a string to a text file and the text file does indeed appear on the RPi2) however upon looking at the messages in Qt Creator it tells me that the project was deployed in my build directory - on my Debian 8! No binary is transferred to the RPi2 either. Additional confirmation to this is when I try to run the project. It fails with Failed to start program. Path or permissions wrong? and it also states that it tries to start it from (again!) the build directory - on my Debian. Obviously it won't work since my Debian 8 is x86-64 and the RPi2 is an ARM architecture though the error seems to be very confusing. I did research what it means but all I got is "Check if you have access (read/write) permissions to the remote location. Well, I have both since I am logging in successfully via SSH through Qt so I am basically becoming that user. However in order to double checked by assigning my build directory to be on the RPi2 too. In that case it all works (files are written there) but as I've mentioned before this is not my understanding of remote deployment. I want to compile and link on my desktop and then simply upload, run and possibly debug the binary on the RPi2.

    Any advice guys? I have asked this question on stackoverflow but since this is a very Qt Creator specific question I decided to post it here too.

  • Got it. The documentation quite frankly is bad written when it comes to the QtCreatorDeployment.txt What you actually write in this file is just the remote path and without the sftp://IP_ADDRESS so now I simply have:


    and the binary from my Debian 8 lands right in there on the RPi2. I posted a detailed explanation on stackoverflow (link in my first post).