Instead of having several switches in the qml code to choose between fake and real implementations of components, provide a fake implementation of Ubuntu.Application module instead. That way we have a cleaner QML code that is easier to test and we run exactly the same qml code both on the target device and under a fake environment.