Beginner - Stand alone console app with macOS
-
Hello!
I'm starting with Qt on macOS (Sonoma 14).
- I created a simple HelloWord in console mode with qmake.
- After debugging and building, I have a "Release" folder in which the HelloWorld file (Executable Unix file) is located.
- 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.
-
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.
-
-
@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 :-)
-
@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.