Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode copy-paste breakpoints

Is there any way to copy-paste breakpoints in Xcode?

The reason I am asking is, I have a breakpoint set to "automatically continue after evaluating", with some actions associated. I want to have the same breakpoint behavior/action in multiple places in the code. Instead of re-doing it (Setting breakpoint, customizing it) 10 times (or even more which can be cumbersome), just copy-paste it!?

like image 928
Canopus Avatar asked Apr 16 '13 16:04

Canopus


People also ask

How do you set breakpoints in Xcode?

Navigate to a line in your code where you want execution to pause, then click the gutter or line number in the source editor to set a breakpoint. Xcode displays a breakpoint icon to indicate the location. Drag a breakpoint up or down to move it to another location; drag it away from the gutter to remove it.

Why breakpoints are not working in Xcode?

You might be pushing "Run" instead of "Debug" in which case your program is not running with the help of gdb, in which case you cannot expect breakpoints to work! In Xcode 6.4, there is now only a Run button and whether it runs a debug configuration or not depends on the currently selected scheme settings.

How do I debug 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.

How do I inspect a variable in Xcode?

When your app pauses at a breakpoint, hover over a variable in your source code to view its current value. If the variable is an image or other type that isn't expressible as text, click the Quick Look button at the upper-right to see a preview of the variable.


1 Answers

I've found a solution, though it might not be easier. All of the breakpoints are saved in an XML file inside your Xcode project. To find the file, select your project file and choose "Show Package Contents", then go to:

xcuserdata/(YourNameHere).xcuserdatad/xcdebugger/

You can open the breakpoints file and copy /paste their XML. You can then change the file and line numbers of the breakpoints.

like image 92
BradB Avatar answered Sep 24 '22 05:09

BradB