How to speed up app development?
I want to make an app UT, but clickable is really slow. Every time I run it (with
clickable desktop) it starts a new docker container and it has to completely rebuild the project. Is there a way to make this faster? It currently takes way too long between making a change in the QML and actually testing it.
You can run clickable with the --dirty flag. That stops it from cleaning the build folder between runs.
@arubislander Thanks for the suggestion. I tried that but it didn't seem to make much of a difference at all. Is there any more ways to speed it up? How long does it take for your setup to build the default 'pure qml' application template/cookie cutter?
arubislander last edited by arubislander
The first time it takes a while because the container images need to be downloaded and the containers need to be started.
I have noticed lately that lots of gcc checks are performed even when 'building' a pure qml app. Inam not certain that was always the case. But it doesn't ever take overly long on my Slimbook PRO...
But I will give it a proper benchmarking when I get home.
Very good question! I'd love to hear others tips as well. I do the following:
If I want to develop a new feature I sometimes start in a new empty project, e.g. a qml app created in qtcreator, or maybe even just a qml file that I run with
qmlscene. Once I iterated long enough to think I have the right design I copy/paste stuff over into the UT app.
For my last project where I write the business logic in a c++ library, I wrote a tiny cli program. I
cmakethe lib and the cli program until I'm convinced of the feature before I embed it into the UT app and fire up
Another trick is to use
sudo nanoand edit the qml in the installed app on the phone itself. Then I just need to close reopen instead of compile, package, install. If you need to do more than
nanois suitable for, you can
sshfs, so you can work with your favorite editor on your laptop. I guess that trick could be applied to a python app as well, but I haven't tried. Also, I think the same should be possible with
clickable desktop, by somehow getting into the docker container, but i haven't figured out how.
So I did some tests on the pure-qml template. On my setup it takes around 50 seconds to build (which indeed is long for something that does not really need compiling).
--dirtyflag did indeed not make much difference. My guess is this is because there is nothing to compile, and so there is no compile steps to skip.
@doniks You could do
clickable --skip-build desktopafter the initial
clickable desktopand from there on edit the qml directly in the
build/x86_64-linux-gnu/app/install/qmlfolder. If you dynamically load your qml you could probably even get by without having to restart your app.
Why not just build and run your app locally instead of with
clickable desktopif your goal is to do local testing of it on your PC? This is much faster than using any docker and such.
True, but depending on what the distro is, the versions of packages installed locally could be different to those needed by the app being developed.
Well, because no one manages to install and build with the Ubuntu SDK except on that 16.04 version of Ubuntu ... or at least that was my understanding ... but if you are questioning that then I got to wonder ...
I run (.... I think) 19.04 on my laptop, use qtcreator as an editor but it is always barking at all the Ubuntu sdk imports. And I thought that is basically the reality for everyone and we all gave up on trying to port the SDK to any other distro / Ubuntu version, because we kinda expect there to be some other light at the end of the tunnel when we outgrow 16.04 on the devices ...
Is this not the case? how/where are you building apps?
@arubislander But one can make an Ubuntu 16.04 chroot/lxc/VM/whatever, install the
ubuntu-sdk-libs-devpackages in it, and then build and run from there. This is roughly what
clickableis doing anyway with docker.
@doniks I'm trying to build apps without using
Ubuntu.Componentsand instead using Ergo (the toolkit I've started) with
QtQuick.Controls2.x, with Qt 5.9 on Ubuntu 18.04. So I just build and run locally.
For other things, I have an Ubuntu 16.04 VM with Unity8, and I can run the apps under Unity 8 there, or ssh into the VM and run the app forwarded to the host.
Pay no mind to the old Ubuntu SDK that is no longer maintained. It was never a requirement for building apps. All you need is the necessary QML components, and depending on the type of app you're building, the development libraries and compilers to build your app. For pure QML apps, you can just run straight from the source tree generally, with the same command you'd put in the
@dobey I am going to try the lxd route with that... Thanks!
lduboeuf last edited by
@arubislander If you only work on QML, you can use directly QML Creator from the app store or even work with QML live app ( didn't had success with QtCreator because it can't save the save trought MTP or SSH AFAIK)
If working on a standard project, you can try first locally and then setup the build for UT ( examples here : https://docs.ubports.com/en/latest/appdev/guides/cookbook.html