3

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.

Velkan
  • 3,616

2 Answers2

2

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 
    
0

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
sdbbs
  • 1,488