[GUIDE] App development directly on your UT device



  • Background Story (SKIP to next section if you're not interested :P)
    I've been dreaming of developing my apps directly on my phone and with convergence, I can do it anywhere (err...that has a spare monitor). I waited for the Ubuntu SDK to be officially released as a convergent app but it never happen.
    Now comes clickable, unfortunately it has no arm builds but hey it's just python so it should be technically possible. Luckily, I just got a 2nd hand 32GB Nexus 5 with MultiROM. I have a spare install of UT that I can mess around. I started by trying to make clickable work in rootfs, meaning I made my image writable and installed the required packages directly on my rootfs. Thanks to the ATU app, I was able to resize my rootfs to a larger one. After some tries, I was able to create and compile a new app then after that, I tried to compile my 2 apps and voila they compiled fine! So I decided to try it out using a container so that you can do it without messing with your rootfs :D

    Installation of clickable:

    1. Install the OnTheRoad app from the OpenStore.

    2. [Temporary solution] Currently, there are issues when installing clickable dependencies in the container created by OnTheRoad app. A bug was filed for this already. For now, create a container using libertine.

    3. Open your Terminal app and run the commands below.

      • otr-ssh
      • otr
    4. Choose 3 (Use a container) then the container name you created via libertine (i.e. vivid).

    5. Choose 1 (Open a bourne again shell). You are now logged-in as root in your created container.

    6. Run the commands below to install clickable dependencies

      • apt-get update
      • apt-get install build-essential cmake intltool git cookiecutter

      Note: I haven't tested all the templates or other apps so it's possible that there are other packages necessary for
      installation. Try to figure it out yourself in case you have errors when compiling your app.

    7. Now it's time to install clickable. Unfortunately, there are no arm builds as of the moment so we will just use the manual way. Skip the installation of Docker(not needed) and Cookiecutter(already installed) and then run the git command as detailed in the clickable wiki.

    8. Follow the step on setting up the clickable path.

    Actual Development:
    Creating new apps:
    [OTR Session] Run the command below and choose whichever template you'd want.

    • clickable init --container-mode

    Compiling your apps:
    [OTR Session] Switch to your app's main directory (i.e. cd ~/Projects/AppAppHurray) then run the command below

    • clickable --container-mode

    Note: Most projects created using Ubuntu SDK should work. My apps used the QML/C++ (qmake) template compiled fine without changing anything!.

    Install your app:
    [Normal Session] Run the command below

    • pkcon install-local --allow-untrusted <path to click file>'

    Note: The generated click file resides inside the container. Its path will have the format below.
    /home/phablet/.cache/libertine-container/vivid/rootfs/<project path>/build/

    Running your app:
    [Normal Session] Run the command below.

    • ubuntu-app-launch <appname.devname_appname_version> (i.e. appapphurray.kugiigi_appapphurray_1.0.0.)

    Of course, you can just go to the Apps Scope and open it there :P

    Terminologies:
    OTR Session - When logged into the container using OTR (OntTheRoad)
    Normal Session - When using you're not inside the container and runs commands directly into your device.

    • Add --debug in clickable to see more detailed log

    Hopefully, this will be useful to someone. I will try to update this guide in case that there are changes.
    Thanks!

    Additional recommendation:
    If you're interested messing around further and brave enough and maybe stuck with Windows?, you can try using X forwarding via USB and run full XFCE, from there you can use text editor/IDE for your codes and compile them using your favorite terminal app like Termnator! :D


Log in to reply
 

Looks like your connection to UBports Forum was lost, please wait while we try to reconnect.