Speeding up QML development on an N950

Others have pointed out that when pushing the “Run” button within QtCreator when the target is set to your N9 or N950, aka Harmattan device it’s very slow. The reason is that it fully builds and packages everything before sending it over. That’s great when you actually want a full package installed, especially when you have modified the C++ internals. However, its a bit over-kill just to install new copies of any QML code. It’s a *slow* process (as is the emulator).

One person has posted a great blog entry for how to speed up the deployment step by not doing the packaging, and just copying the files and running the executable.

But there is even a faster way when it comes to dealing with the QML itself. It involves using sshfs. You simply move your local qml directory aside (assuming that’s where you store your QML code), and mount the n950’s installed filesystem in its place.

devel# cd my-cool-app
devel# mv qml qml.local
devel# sshfs root@myn950:/opt/my-cool-app/qml qml

Now, when you’re inside qtcreator and save the files you’re actually saving them directly to the device. You’ve just upgraded the device with a single Ctrl-S. Done! Now simply launch the app on the N950 and you’re done!

killing/restarting

Of course, the other helpful trick is to launch the application from a terminal window instead.

devel# ssh myn950
n950% killall my-cool-app ; /opt/my-cool-app/bin/my-cool-app &

Just keep hitting the up arrow key to restart the app after you make changes you want to test.

Integrating with git and other foo

git, and most other VCSes, really won’t care if one of the directories has been remotely mounted. It’ll notice the file changes and will let you check in your modifications even though they’re mounted from the phone itself. Just remember when you unmount the phone later (using fusermount -u qmlgit checkout qml), which are likely different than the qml.local directory we saved earlier.

Leave a Comment