Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to display output from Qt Android service process in QtCreator?
Forum Updated to NodeBB v4.3 + New Features

How to display output from Qt Android service process in QtCreator?

Scheduled Pinned Locked Moved Solved Mobile and Embedded
11 Posts 4 Posters 984 Views 2 Watching
  • 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.
  • M morte

    How to display output from Qt Android service in QtCreator (qDebug() and Log.i() messages) in QtCreator?
    'Application output' shows output from main process but service runs in different process.

    JonBJ Offline
    JonBJ Offline
    JonB
    wrote on last edited by JonB
    #2

    @morte
    QtService seems to be a wrapper for Linux demons or Windows services. By definition you won't be able to access any output it produces, since it's in a quite separate process and any output it produces will go elsewhere (probably nowhere). It would be more usual for any output a service wants to produce to go to a file/the system's "event log", but that is done within the service.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      morte
      wrote on last edited by
      #3

      @JonB I have not specified, QtService for Android (part of QtAndroidExtras), its different process, but maybe its possible somehow to attach it's output

      1 Reply Last reply
      0
      • M Offline
        M Offline
        morte
        wrote on last edited by
        #4

        It's not implemented currently on Qt Creator 4.12/4.13.
        Created bugreport with suggestion to add that feature https://bugreports.qt.io/browse/QTCREATORBUG-24496

        JonBJ 1 Reply Last reply
        0
        • M morte

          It's not implemented currently on Qt Creator 4.12/4.13.
          Created bugreport with suggestion to add that feature https://bugreports.qt.io/browse/QTCREATORBUG-24496

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #5

          @morte
          Good luck for them choosing or being able to do anything about it. Since, as you say, the service is running in a separate process I don't think you'll get the debug output from that process while you are debugging your main process....

          M 1 Reply Last reply
          0
          • JonBJ JonB

            @morte
            Good luck for them choosing or being able to do anything about it. Since, as you say, the service is running in a separate process I don't think you'll get the debug output from that process while you are debugging your main process....

            M Offline
            M Offline
            morte
            wrote on last edited by morte
            #6

            @JonB QtCreator probably takes all output from logcat, what needed is to modify logcat filters that QtCreator output windows uses or add additional output window with own filters for separate process

            1 Reply Last reply
            0
            • C Offline
              C Offline
              CPPUIX
              wrote last edited by
              #7

              So I have to manually search for keywords to get the desired output highlighted in the console, when using adb logcat.

              Some people suggest filtering the output using the app package name, but not all output contains it.

              If anyone has a workaround that detects all of the package's output, that'd be great.

              Thanks

              1 Reply Last reply
              0
              • piervalliP Offline
                piervalliP Offline
                piervalli
                wrote last edited by piervalli
                #8

                On Windows I use
                adb logcat | findstr appname

                Replace the name with tag.
                On the version 5.15.2 there was a bug that not write on console on android, but there is a easy workaround. (Now I am out of my office)
                adb is very powerful you can use shell for example LS or copy in PC logs files

                C 1 Reply Last reply
                1
                • piervalliP piervalli

                  On Windows I use
                  adb logcat | findstr appname

                  Replace the name with tag.
                  On the version 5.15.2 there was a bug that not write on console on android, but there is a easy workaround. (Now I am out of my office)
                  adb is very powerful you can use shell for example LS or copy in PC logs files

                  C Offline
                  C Offline
                  CPPUIX
                  wrote last edited by
                  #9

                  @piervalli But that's text-based filtering, which doesn't fully work because not all output contains the app tag, as I mentioned.

                  1 Reply Last reply
                  0
                  • piervalliP Offline
                    piervalliP Offline
                    piervalli
                    wrote last edited by
                    #10

                    I use a custom qInstallMessageHandler

                    Have you tested with method?
                    __android_log_print(priority, "Qt", "%s", qPrintable(fMessage));

                    C 1 Reply Last reply
                    1
                    • piervalliP piervalli

                      I use a custom qInstallMessageHandler

                      Have you tested with method?
                      __android_log_print(priority, "Qt", "%s", qPrintable(fMessage));

                      C Offline
                      C Offline
                      CPPUIX
                      wrote last edited by
                      #11

                      @piervalli Oh, that's new, I'll try it out.

                      Thanks!

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved