Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Beginner - Stand alone console app with macOS
QtWS25 Last Chance

Beginner - Stand alone console app with macOS

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 445 Views
  • 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.
  • F Offline
    F Offline
    Frenchy
    wrote on last edited by
    #1

    Hello!

    I'm starting with Qt on macOS (Sonoma 14).

    1. I created a simple HelloWord in console mode with qmake.
    2. After debugging and building, I have a "Release" folder in which the HelloWorld file (Executable Unix file) is located.
    3. Double-clicking on it correctly displays the message in the Mac Terminal.

    My question
    How to convert this file into a '.app' extension file that can be launched without the presence of the Qt folder?

    Nota:
    Using macdeploy does not generate any files (it seems that this tool only processes files with '.app' extension) and no information was found on the web for console mode with this request "macos qt create stand alone console application".

    Entered command :

    /Users/myName/Qt/6.6.1/macos/bin/macdeployqt6 /Users/myName/Desktop/build-Hello-Qt_6_6_1_for_macOS-Release/Hello
    

    (macdeployqt6 works perfectly for a GUI project.)

    Thanks for your help.

    sierdzioS 1 Reply Last reply
    0
    • F Frenchy

      Hello!

      I'm starting with Qt on macOS (Sonoma 14).

      1. I created a simple HelloWord in console mode with qmake.
      2. After debugging and building, I have a "Release" folder in which the HelloWorld file (Executable Unix file) is located.
      3. Double-clicking on it correctly displays the message in the Mac Terminal.

      My question
      How to convert this file into a '.app' extension file that can be launched without the presence of the Qt folder?

      Nota:
      Using macdeploy does not generate any files (it seems that this tool only processes files with '.app' extension) and no information was found on the web for console mode with this request "macos qt create stand alone console application".

      Entered command :

      /Users/myName/Qt/6.6.1/macos/bin/macdeployqt6 /Users/myName/Desktop/build-Hello-Qt_6_6_1_for_macOS-Release/Hello
      

      (macdeployqt6 works perfectly for a GUI project.)

      Thanks for your help.

      sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      @Frenchy look for CONFIG -= app-bundle in your qmake file and remove it. Then run qmake and rebuild the project.

      (Z(:^

      F 1 Reply Last reply
      2
      • sierdzioS sierdzio

        @Frenchy look for CONFIG -= app-bundle in your qmake file and remove it. Then run qmake and rebuild the project.

        F Offline
        F Offline
        Frenchy
        wrote on last edited by
        #3

        @sierdzio

        Thank you for taking the time to solve my problem.

        The base file has now grown from 23 kB to 70 MB, since it now contains the framework.

        I now need to find a way to launch the .app application so that it appears in the terminal.

        I suppose that double-clicking on the .app file doesn't display anything because macOS doesn't know which application to launch, in this case the Terminal.

        Thanks again for your help.

        sierdzioS S 2 Replies Last reply
        0
        • F Frenchy has marked this topic as solved on
        • F Frenchy

          @sierdzio

          Thank you for taking the time to solve my problem.

          The base file has now grown from 23 kB to 70 MB, since it now contains the framework.

          I now need to find a way to launch the .app application so that it appears in the terminal.

          I suppose that double-clicking on the .app file doesn't display anything because macOS doesn't know which application to launch, in this case the Terminal.

          Thanks again for your help.

          sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          @Frenchy said in Beginner - Stand alone console app with macOS:

          I now need to find a way to launch the .app application so that it appears in the terminal.

          I suppose that double-clicking on the .app file doesn't display anything because macOS doesn't know which application to launch, in this case the Terminal.

          This is exactly why console apps are not compiled inside .app bundle by default :-)

          (Z(:^

          F 1 Reply Last reply
          2
          • F Frenchy

            @sierdzio

            Thank you for taking the time to solve my problem.

            The base file has now grown from 23 kB to 70 MB, since it now contains the framework.

            I now need to find a way to launch the .app application so that it appears in the terminal.

            I suppose that double-clicking on the .app file doesn't display anything because macOS doesn't know which application to launch, in this case the Terminal.

            Thanks again for your help.

            S Offline
            S Offline
            SimonSchroeder
            wrote on last edited by
            #5

            @Frenchy said in Beginner - Stand alone console app with macOS:

            I now need to find a way to launch the .app application so that it appears in the terminal.

            I am not an expert in macOS (and macdeployqt might also not help directly here), but I would try to have the app inside the app bundle be a script (instead of your executable) which launches the terminal and executes your console program.

            However, as @sierdzio alluded console apps are usually not inside app bundles and are not launched by double-clicking. They are launched by typing the command on the command line.

            1 Reply Last reply
            0
            • sierdzioS sierdzio

              @Frenchy said in Beginner - Stand alone console app with macOS:

              I now need to find a way to launch the .app application so that it appears in the terminal.

              I suppose that double-clicking on the .app file doesn't display anything because macOS doesn't know which application to launch, in this case the Terminal.

              This is exactly why console apps are not compiled inside .app bundle by default :-)

              F Offline
              F Offline
              Frenchy
              wrote on last edited by
              #6

              @sierdzio
              OK. I'll make a note of it!
              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