Xcode opens multiple Terminal windows when running app

Whenever I run anything in xcode it opens an extra terminal that runs the program then exits immediately, but the app still runs through the normal xcode launch. It's not a huge issue but It's getting really annoying to realize I have like 7 windows of terminal open that are just doing nothing.

Has anyone had this issue before?

That is not normal behaviour. The only time I've seen that is when Xcode is configured to run the app in a separate terminal for something like ncurses that won't work in the debug console. Check the run scheme's "Options" setting for "Console".

In my case, in Xcode 16 or later, I open the project and reproduce it on the second and subsequent RUNs. This phenomenon did not exist until Xcode 15.4.

Check the run scheme's "Options" setting for "Console".

This setting opens a window that displays the normal log, and a separate window that runs for a short time and then quits.

Does anyone know how to fix it?

I found a workaround in the case of a Command Line Tool which opens a window with SDL2.

Create an App project. However, main() does not call NSApplicationMain().

"-NSDocumentRevisionsDebugMode" and "YES" are passed to argv, so ignore them.

Xcode opens multiple Terminal windows when running app
 
 
Q