• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
UBports Robot Logo UBports Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

How should I set up my environment for developing?

Scheduled Pinned Locked Moved App Development
20 Posts 7 Posters 1.8k Views 3 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K Offline
      Kanduras
      last edited by 16 Oct 2019, 19:57

      Hi, I want to develop for UT with Atom or the Qt Creator, but are to bad to set up one of them correctly.
      At first I create a project with Clickable.

      On Atom I can open the project, edit some lines of code, save it and compile this via Terminal and Clickable.
      The problem is, that there is no autocompletion and code-hint underlining (for me), what makes it very difficulty. I have the atom-build-clickable package installed, but don't know how to use it.

      On Qt Creator I can develop "normal" Qt programs. If I want to open a Clickable project, there are a lot of Errors with the CMakeLists.txt and I cannot edit this project.

      On this tutorial they set up only the unsupported(?) SDK.
      In the official documentation I cannot find good hints...

      So how did you do it?

      I hope my English is good enough. Thanks a lot!

      A 1 Reply Last reply 16 Oct 2019, 21:28 Reply Quote 0
      • A Offline
        AppLee @Kanduras
        last edited by 16 Oct 2019, 21:28

        @Kanduras
        Hello, you can build a clickable project with F9 or Package>Build>Build Project
        But you need to configure the atom-build-clickable addon. For this go to Edit>Preferences

        Go to "Packages" click on settings for atom-build-clickable
        If you click on "View code" you can edit the plugin to adapt to your configuration.
        I did it to use SSH to push my code instead of ADB, this way my phone can be free from the cable.

        I hope this would help.

        K M 2 Replies Last reply 17 Oct 2019, 10:22 Reply Quote 2
        • K Offline
          Kanduras @AppLee
          last edited by 17 Oct 2019, 10:22

          @AppLee
          Thank you very much!
          On Atom I needed also the 'build' package, but now it works 🙂

          Is there a way for autocompletion and code-hint underlining in qml, on Atom?

          1 Reply Last reply Reply Quote 0
          • L Online
            lduboeuf
            last edited by 18 Oct 2019, 13:17

            @Kanduras said in How should I set up my environment for developing?:

            On Qt Creator I can develop "normal" Qt programs. If I want to open a Clickable project, there are a lot of Errors with the CMakeLists.txt and I cannot edit this project.

            If you want to stay on QtCreator, you can have autocompletion for Ubuntu Components by importing them on your PC:
            (see topic 1 or 2 ) https://gist.github.com/lduboeuf/dcf22607207d5b7abc8ac966d20942ce

            M 1 Reply Last reply 2 Dec 2019, 21:13 Reply Quote 3
            • M Offline
              matteo @AppLee
              last edited by 18 Oct 2019, 16:17

              @AppLee would you kindly explain how did you manage to compile via ssh with the clickable plugin? I followed your instructions and got to look at its code but didn't find out how to enable ssh...it would be very nice for me also not relying anymore on the usb cable 😉

              L 1 Reply Last reply 18 Oct 2019, 21:22 Reply Quote 0
              • L Online
                lduboeuf @matteo
                last edited by lduboeuf 18 Oct 2019, 21:22

                @matteo you can find information about connecting with ssh here : https://docs.ubports.com/en/latest/userguide/advanceduse/ssh.html

                Don't know if phablet-tool still exist, but with that its pretty straight forward

                M 1 Reply Last reply 19 Oct 2019, 07:36 Reply Quote 0
                • M Offline
                  matteo @lduboeuf
                  last edited by matteo 19 Oct 2019, 07:36

                  @lduboeuf thank you for your pointer, it is very appreciated to understand how to set up the ssh between phone and PC. However, what I'm more interested into is how to "force" the Atom clickable plugin to compile via ssh wireless instead than do it in the "normal" way, i.e. by adb tools with usb cable, which is the standard behavior. According to what @AppLee said above, if I didn't misunderstand, he was able to change something in the Atom clickable code, enabling the ssh communication.

                  K 1 Reply Last reply 19 Oct 2019, 08:33 Reply Quote 0
                  • K Offline
                    Kanduras @matteo
                    last edited by 19 Oct 2019, 08:33

                    @matteo click on "View code", go to the clickable.js, in the "settings()" function (Line 99), and add:

                    {
                            name: 'Clickable: Build and run [phone (ssh)]',
                            exec: 'clickable',
                            args: [ '--ssh YOUR_PHONE_IP' ],
                            sh: true,
                            functionMatch: function (terminal_output) {
                              return errorHelper.checkBuildError(terminal_output)
                            }
                          }
                    

                    P.S. don't forget the "," at the beginning or end

                    M 1 Reply Last reply 19 Oct 2019, 10:10 Reply Quote 2
                    • M Offline
                      matteo @Kanduras
                      last edited by 19 Oct 2019, 10:10

                      @Kanduras thank you very much 🙂
                      Before changing the clickable plugin code following your instructions, I wanted to be sure the ssh connection was working but I didn't succeed yet. I also tried to generate again the ssh key and push it to the phone, but no joy up to now.
                      In the PC terminal, if I type the command ssh phablet@<ip-address> (ip-address found typing hostname -i in the terminal), I get an error message stating that the connection is refused on Port 22.
                      Any recommendation about how to fix that? I know ssh is very sensible with authorizing a connection and I believe I'm just slightly off the road....

                      Matteo

                      K 1 Reply Last reply 19 Oct 2019, 10:28 Reply Quote 0
                      • K Offline
                        Kanduras @matteo
                        last edited by 19 Oct 2019, 10:28

                        @matteo I set up the SSH connection with the first answer of this question

                        M 1 Reply Last reply 19 Oct 2019, 14:01 Reply Quote 1
                        • M Offline
                          matteo @Kanduras
                          last edited by 19 Oct 2019, 14:01

                          @Kanduras Great, it works!! Thank you very much 🙂 You made my life much easier 👏 Now the set Atom/clickable really rocks!

                          Kind regards to you all @AppLee, @Kanduras and @lduboeuf

                          Matteo

                          1 Reply Last reply Reply Quote 1
                          • M Offline
                            MarkG_108 @lduboeuf
                            last edited by 2 Dec 2019, 21:13

                            @lduboeuf I have Qt Creator installed on my computer. So, I was interested in setting it up with clickable. However, my computer is Debian, and not Ubuntu. Is this safe to do on Debian?

                            I tried, from way 0, to run the script, but stopped it midway through (see commandline stuff below) since it seemed that it was going to install a bunch of Ubuntu packages on my machine. And I wasn't running it as root, which is normally required for package installation. Odd. I stopped it before it installed all the Ubuntu things it was getting.

                            mark@debian:~/Templates/clickable/ut-qtcreator-master$ cd ut-qtcreator && docker build -t ut-qtcreator:base .
                            Sending build context to Docker daemon     64kB
                            Step 1/3 : FROM clickable/ubuntu-sdk:16.04-amd64
                             ---> 86c5e694130c
                            Step 2/3 : RUN apt-get update && apt-get install -y git qtcreator libxrender1 gdb
                             ---> Running in 31561210b835
                            Get:1 http://archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
                            Get:2 http://ppa.launchpad.net/bhdouglass/clickable/ubuntu xenial InRelease [17.5 kB]
                            Ign:3 http://repo.ubports.com xenial InRelease
                            Get:4 http://repo.ubports.com xenial Release [6317 B]
                            Get:5 http://repo.ubports.com xenial Release.gpg [473 B]
                            Get:6 https://deb.nodesource.com/node_10.x xenial InRelease [4584 B]
                            Get:7 http://ppa.launchpad.net/bhdouglass/clickable/ubuntu xenial/main amd64 Packages [790 B]
                            Get:8 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
                            Get:9 https://deb.nodesource.com/node_10.x xenial/main amd64 Packages [768 B]
                            Get:10 http://repo.ubports.com xenial/main amd64 Packages [1740 kB]
                            Get:11 http://archive.ubuntu.com/ubuntu xenial-security InRelease [109 kB]
                            Get:12 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages [1558 kB]
                            Get:13 http://archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages [176 kB]
                            Get:14 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [9827 kB]
                            Get:15 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [1393 kB]
                            Get:16 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [19.3 kB]
                            Get:17 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [998 kB]
                            Get:18 http://archive.ubuntu.com/ubuntu xenial-security/main amd64 Packages [1005 kB]
                            Get:19 http://archive.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [6283 B]
                            Get:20 http://archive.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [593 kB]
                            Fetched 17.8 MB in 11s (1486 kB/s)
                            Reading package lists...
                            Reading package lists...
                            Building dependency tree...
                            Reading state information...
                            libxrender1 is already the newest version (1:0.9.9-0ubuntu1).
                            libxrender1 set to manually installed.
                            gdb is already the newest version (7.11.1-0ubuntu1~16.5).
                            git is already the newest version (1:2.7.4-0ubuntu1.6).
                            The following additional packages will be installed:
                              binfmt-support clang clang-3.8 libbotan-1.10-1 libclang-common-3.8-dev
                              libclang1-3.8 libclang1-5.0 libffi-dev libllvm3.8 libllvm5.0 libobjc-5-dev
                              libobjc4 libpipeline1 libqbscore1.10 libqbsqtprofilesetup1.10 libtinfo-dev
                              libutempter0 libxft2 libxv1 libxxf86dga1 llvm-3.8 llvm-3.8-dev
                              llvm-3.8-runtime qbs-common qml-module-qtquick-controls qt5-doc qtbase5-doc
                              qtconnectivity5-doc qtcreator-data qtcreator-doc qtdeclarative5-doc
                              qtgraphicaleffects5-doc qtlocation5-doc qtmultimedia5-doc
                              qtquickcontrols5-doc qtscript5-doc qtsensors5-doc qtserialport5-doc
                              qtsvg5-doc qttools5-doc qttranslations5-l10n qtwebkit5-doc
                              qtwebkit5-examples-doc qtwebsockets5-doc qtx11extras5-doc
                              qtxmlpatterns5-dev-tools qtxmlpatterns5-doc x11-utils xbitmaps xterm
                            Suggested packages:
                              gnustep gnustep-devel clang-3.8-doc llvm-3.8-doc kate-data subversion
                              mesa-utils xfonts-cyrillic
                            The following NEW packages will be installed:
                              binfmt-support clang clang-3.8 libbotan-1.10-1 libclang-common-3.8-dev
                              libclang1-3.8 libclang1-5.0 libffi-dev libllvm3.8 libllvm5.0 libobjc-5-dev
                              libobjc4 libpipeline1 libqbscore1.10 libqbsqtprofilesetup1.10 libtinfo-dev
                              libutempter0 libxft2 libxv1 libxxf86dga1 llvm-3.8 llvm-3.8-dev
                              llvm-3.8-runtime qbs-common qml-module-qtquick-controls qt5-doc qtbase5-doc
                              qtconnectivity5-doc qtcreator qtcreator-data qtcreator-doc
                              qtdeclarative5-doc qtgraphicaleffects5-doc qtlocation5-doc qtmultimedia5-doc
                              qtquickcontrols5-doc qtscript5-doc qtsensors5-doc qtserialport5-doc
                              qtsvg5-doc qttools5-doc qttranslations5-l10n qtwebkit5-doc
                              qtwebkit5-examples-doc qtwebsockets5-doc qtx11extras5-doc
                              qtxmlpatterns5-dev-tools qtxmlpatterns5-doc x11-utils xbitmaps xterm
                            0 upgraded, 51 newly installed, 0 to remove and 24 not upgraded.
                            Need to get 195 MB of archives.
                            After this operation, 596 MB of additional disk space will be used.
                            Get:1 http://archive.ubuntu.com/ubuntu xenial/main amd64 libxft2 amd64 2.3.2-1 [36.1 kB]
                            Get:2 http://repo.ubports.com xenial/main amd64 qml-module-qtquick-controls amd64 5.9.5-0ubports1 [713 kB]
                            Get:3 http://archive.ubuntu.com/ubuntu xenial/main amd64 libxv1 amd64 2:1.0.10-1 [10.3 kB]
                            Get:4 http://archive.ubuntu.com/ubuntu xenial/main amd64 libxxf86dga1 amd64 2:1.1.4-1 [13.7 kB]
                            Get:5 http://archive.ubuntu.com/ubuntu xenial/main amd64 libpipeline1 amd64 1.4.1-2 [24.6 kB]
                            Get:6 http://archive.ubuntu.com/ubuntu xenial/main amd64 binfmt-support amd64 2.1.6-1 [50.7 kB]
                            Get:7 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libllvm3.8 amd64 1:3.8-2ubuntu4 [10.3 MB]
                            Get:8 http://repo.ubports.com xenial/main amd64 qbs-common all 1.10.1+dfsg-1 [103 kB]
                            Get:9 http://repo.ubports.com xenial/main amd64 libqbscore1.10 amd64 1.10.1+dfsg-1 [912 kB]
                            Get:10 http://repo.ubports.com xenial/main amd64 libqbsqtprofilesetup1.10 amd64 1.10.1+dfsg-1 [104 kB]
                            Get:11 http://repo.ubports.com xenial/main amd64 qtconnectivity5-doc all 5.9.5-0ubports1 [2516 kB]
                            Get:12 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libobjc4 amd64 5.4.0-6ubuntu1~16.04.12 [111 kB]
                            Get:13 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libobjc-5-dev amd64 5.4.0-6ubuntu1~16.04.12 [381 kB]
                            Get:14 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 libclang1-3.8 amd64 1:3.8-2ubuntu4 [4139 kB]
                            Get:15 http://repo.ubports.com xenial/main amd64 qtgraphicaleffects5-doc all 5.9.1+ubports [13.1 MB]
                            Get:16 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 libclang-common-3.8-dev amd64 1:3.8-2ubuntu4 [1167 kB]
                            Get:17 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 clang-3.8 amd64 1:3.8-2ubuntu4 [21.5 MB]
                            Get:18 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 clang amd64 1:3.8-33ubuntu3.1 [3248 B]
                            Get:19 http://archive.ubuntu.com/ubuntu xenial/universe amd64 libbotan-1.10-1 amd64 1.10.12-1 [957 kB]
                            Get:20 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libllvm5.0 amd64 1:5.0-3~16.04.1 [13.5 MB]
                            Get:21 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libclang1-5.0 amd64 1:5.0-3~16.04.1 [6695 kB]
                            Get:22 http://archive.ubuntu.com/ubuntu xenial/main amd64 libtinfo-dev amd64 6.0+20160213-1ubuntu1 [77.4 kB]
                            Get:23 http://archive.ubuntu.com/ubuntu xenial/main amd64 libutempter0 amd64 1.1.6-3 [7898 B]
                            Get:24 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 llvm-3.8-runtime amd64 1:3.8-2ubuntu4 [72.3 kB]
                            Get:25 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 llvm-3.8 amd64 1:3.8-2ubuntu4 [1524 kB]
                            Get:26 http://archive.ubuntu.com/ubuntu xenial/main amd64 libffi-dev amd64 3.2.1-4 [161 kB]
                            Get:27 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 llvm-3.8-dev amd64 1:3.8-2ubuntu4 [16.7 MB]
                            Get:28 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 qtbase5-doc all 5.5.1-3ubuntu0.1 [26.3 MB]
                            Get:29 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 qtdeclarative5-doc all 5.5.1-3ubuntu0.1 [9705 kB]
                            Get:30 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 qtscript5-doc all 5.5.1-3ubuntu0.1 [381 kB]
                            Get:31 http://archive.ubuntu.com/ubuntu xenial/universe amd64 qtserialport5-doc all 5.5.1-2build1 [300 kB]
                            Get:32 http://archive.ubuntu.com/ubuntu xenial/main amd64 qtsvg5-doc all 5.5.1-2build1 [190 kB]
                            Get:33 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 qttools5-doc all 5.5.1-3ubuntu0.1 [3567 kB]
                            ^C
                            
                            D L 3 Replies Last reply 3 Dec 2019, 12:04 Reply Quote 0
                            • D Offline
                              doniks @MarkG_108
                              last edited by 3 Dec 2019, 12:04

                              @MarkG_108 to me it looks like it would be installing INSIDE a docker container and not into your actual system

                              1 Reply Last reply Reply Quote 1
                              • L Online
                                lduboeuf @MarkG_108
                                last edited by 3 Dec 2019, 20:22

                                @MarkG_108 yes it is safe to use as it install all in a container. Here it seems that clickable image needs to be updated .

                                M 1 Reply Last reply 3 Dec 2019, 21:21 Reply Quote 1
                                • M Offline
                                  MarkG_108 @lduboeuf
                                  last edited by 3 Dec 2019, 21:21

                                  @lduboeuf Great, I'll give it a try then.

                                  1 Reply Last reply Reply Quote 0
                                  • poVoqP Offline
                                    poVoq
                                    last edited by 3 Dec 2019, 21:31

                                    Might be a nice addition:
                                    https://github.com/rschiang/atom-language-qml

                                    It's available in the Atom install dialog.

                                    Fairphone 5 (waiting for port)

                                    1 Reply Last reply Reply Quote 0
                                    • poVoqP Offline
                                      poVoq
                                      last edited by 3 Dec 2019, 21:47

                                      Some other interesting things I found for live preview of QML/QTQuick apps:

                                      https://github.com/penk/terrarium-app (even has a Ubuntu Touch version!)

                                      https://github.com/penk/qml-livereload

                                      Fairphone 5 (waiting for port)

                                      L 1 Reply Last reply 3 Dec 2019, 21:56 Reply Quote 0
                                      • L Online
                                        lduboeuf @poVoq
                                        last edited by 3 Dec 2019, 21:56

                                        @poVoq yes, that one also worked for me : https://open-store.io/app/me.lduboeuf.livecoding

                                        poVoqP 1 Reply Last reply 3 Dec 2019, 22:09 Reply Quote 1
                                        • poVoqP Offline
                                          poVoq @lduboeuf
                                          last edited by 3 Dec 2019, 22:09

                                          @lduboeuf Cool, that seems even better, need to try on my device 🙂 Thanks for that.

                                          Fairphone 5 (waiting for port)

                                          1 Reply Last reply Reply Quote 0
                                          • L Online
                                            lduboeuf @MarkG_108
                                            last edited by lduboeuf 12 Apr 2019, 12:39 4 Dec 2019, 11:20

                                            @MarkG_108 said in How should I set up my environment for developing?:

                                            I tried, from way 0, to run the script

                                            i've just updated the script, i made a mistake regarding volume mapping if you want to see any files under your home directory... ( don't need to rebuild the image though, only the sh script)

                                            1 Reply Last reply Reply Quote 1
                                            • First post
                                              Last post