Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start Xcode debugger for a project without any executable?

I have a Xcode project that is building a library and I want to be able to debug the library when it is loaded by the main application.

Run and Debug options from Run menu are disabled and if i try to use attach to process option I get "No launchable executable present at path". When looking at Active Executable I see but I don't know how to tell xcode what to run/debug.

So how should I debug the application? I'm looking for something similar to the project configuration of Visual Studio but I wasn't able to locate this option yet.

like image 772
sorin Avatar asked Jan 07 '10 13:01

sorin


People also ask

How do I start debugging in Xcode?

When you run an application in Xcode, the debugger is automatically started and attached to the process of the application. Click the Run button in the top left or press Command + R. From the moment the application is up and running, we can start inspecting the process and, if necessary, debug it.

What is debugging executable in Xcode?

The “Debug executable” checkbox specifies whether or not you want to run with the debugger enabled. Once running, you can use Debug > Attach to Process on a process that has been launched with debugging disabled if needed. It seems like all this does is start your app with the debugger attached.

Does Xcode have a debugger?

The Xcode debugger provides several methods to step through your code and inspect variables. You can precisely control execution of your code from a breakpoint, stepping into and out of called functions as necessary to determine where your bug occurs.


2 Answers

Add a custom executable to your project.

It is under the Project -> New Custom Executable... menu item.

From there, you can add your application as the custom executable and that will give you the ability to debug the application and the plug-in.

One additional helpful hint; in Xcode's build preferences set up a single common products directory. This will put the symbol files for building your application in the same directory as your application (assuming your main application is one you build) and, thus, you'll be able to step through frames in both your library and your application.

like image 167
bbum Avatar answered Sep 21 '22 01:09

bbum


For those using Xcode 4:

Project > Scheme > Edit Scheme...

Select the Run phase > Info

And set an Executable

like image 39
Izhaki Avatar answered Sep 18 '22 01:09

Izhaki