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

Beginner - Stand alone console app with macOS

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 448 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 27 Mar 2024, 10:50 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.

    S 1 Reply Last reply 27 Mar 2024, 10:55
    0
    • F Frenchy
      27 Mar 2024, 10:50

      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.

      S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 27 Mar 2024, 10:55 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 27 Mar 2024, 17:42
      2
      • S sierdzio
        27 Mar 2024, 10:55

        @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 27 Mar 2024, 17:42 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.

        S S 2 Replies Last reply 28 Mar 2024, 06:04
        0
        • F Frenchy has marked this topic as solved on 27 Mar 2024, 17:45
        • F Frenchy
          27 Mar 2024, 17:42

          @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
          sierdzio
          Moderators
          wrote on 28 Mar 2024, 06:04 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 28 Mar 2024, 09:45
          2
          • F Frenchy
            27 Mar 2024, 17:42

            @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 28 Mar 2024, 08:29 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
            • S sierdzio
              28 Mar 2024, 06:04

              @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 28 Mar 2024, 09:45 last edited by
              #6

              @sierdzio
              OK. I'll make a note of it!
              Thanks.

              1 Reply Last reply
              0

              4/6

              28 Mar 2024, 06:04

              • Login

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