Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to "Build and Run" without attaching to gdb in Xcode?

For both iPhone and desktop applications, when you choose "Build and Run" from the Run menu (or press cmd+return), Xcode launches gdb and then runs the application with gdb attached. This allows you to inspect stack state if the program crashes but adds significant overhead to program launch time, which is somewhat useless if your program doesn't crash.

Is there some way to enable the "Build and Run" command to just do a build and run the app externally, without attachment to gdb? I tried Googling and poking around Xcode help but to no avail...

Thanks!

like image 226
lensovet Avatar asked Dec 04 '25 15:12

lensovet


1 Answers

The correct answer is to choose Project > Edit Active Executable and in the Debugging tab

Uncheck "Auto-attach debugger on crash." When this is checked, Xcode starts your app under gdb even when breakpoints are disabled, even when the Release configuration is built, so that if your app crashes you can see the backtrace in the debugger rather than in CrashTracer. If you uncheck this, it doesn't start in gdb unless you Debug.

like image 149
cdespinosa Avatar answered Dec 07 '25 04:12

cdespinosa



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!