How do I simply run an ubuntu touch app from the terminal?

I’ve got a qml file and I just want to ssh to the phone and do

qmlscene myfile.qml

Is it possible without doing all that stuff with SDK and packages? Just vim and some simple commands that can fit into person’s memory.

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

If you already have your qml file on the phone, it’s pretty easy. All you have to do is to call qmlscene with an extra argument.

  1. Start a connection from your desktop/laptop with phablet-shell.

  2. Run qmlscene with --desktop_file_hint, example:

    $ qmlscene --desktop_file_hint=/usr/share/applications/dialer-app.desktop $HOME/Documents/myfile.qml 
    

Solution 2

Wasn’t so simple on OTA 10.1 (Ubuntu 15.04), BQ E5, with phablet-shell ssh connection, I had to issue this one-liner command line to get it to run:

APP_ID=com.ubuntu.clock_clock_3.7.456 \
QML2_IMPORT_PATH=/usr/share/click/preinstalled/com.ubuntu.clock/3.7.456/lib/arm-linux-gnueabihf \
QML_IMPORT_TRACE=1 \
/usr/bin/qmlscene \
--desktop_file_hint=/usr/share/click/preinstalled/com.ubuntu.clock/3.7.456/share/applications/ubuntu-clock-app.desktop \
/usr/share/click/preinstalled/com.ubuntu.clock/3.7.456/share/qml/ubuntu-clock-app.qml

Note, when you run the app like this, all of its output is dumped to the calling terminal, while there is nothing in ~/.cache/upstart/application-click-com.ubuntu.clock_clock_3.7.456.log. Should start also when the phone is sleeping, and it blocks in terminal, and Ctrl-C will terminate it (and its window on device). The QML2_IMPORT_PATH solves the:

file:///usr/share/click/preinstalled/com.ubuntu.clock/3.7.456/share/qml/ubuntu-clock-app.qml:22 module "Alarm" is not installed
file:///usr/share/click/preinstalled/com.ubuntu.clock/3.7.456/share/qml/ubuntu-clock-app.qml:20 module "WorldClock" is not installed

… see Bug #1338979 “Invalid qmlscene invocation — invalid option — ‘I’” : Bugs : notes-app

Note that without the --desktop_file_hint, you’ll get:

Loading module: 'libubuntu_application_api_touch_mirclient.so.3.0.0'
UbuntuClientIntegration: connection to Mir server failed. Check that a Mir server is
running, and the correct socket is being used and is accessible. The shell may have
rejected the incoming connection, so check its log file
Aborted

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply