Is there any way to remove all the breakpoints in Xcode?
Well there's a 3 step way:
Press CMD(⌘)+7 to show all breakpoints.
In Xcode4 press CMD(⌘)+6, in Xcode3 press CMD(⌘)+ALT+B.
Select all breakpoints with CMD(⌘)+A and delete them, like deleting text, with backspace.
There's no step 3 :)
Its very easy to do in new Xcode. Just click on breakpoints Tab then select all then delete.
Xcode 10 Screenshot:
Old Xcode Screenshot:
tap. See attach image for clear reference.
In Xcode, you can also do by right clicking the project name on the breakpoints tab and then you can see the options for deleting all breakpoints including disabling and sharing breakpoints.
In Xcode 4, in the debugger console, type "breakpoint delete" or "br del" for short:
(lldb) br del
About to delete all breakpoints, do you want to do that?: [Y/n] y
All breakpoints removed. (1 breakpoints)
(lldb)
You can't rely on the GUI breakpoint list, since nothing you enter from the command line will show up there.
Other ways:
Select Breakpoints group in Groups and Files tree, click in Detail view, Command-A, Delete
Disclose Breakpoints smartgroup in Groups and Files tree, shift- or command-select breakpoints in outline, press Delete
Run > Console, when app is paused, type "delete breakpoints" and press Return
Xcode 10
The most easiest way is to do ⌘ + y to disable enable breakpoints .
There is another way
go to Xcode project navigations pane
Click on show Breakpoint navigator
Right click on the project file and select disable all break points
In Xcode 9 it's CMD(⌘) + 8 to access all breakpoints, you can also just click here:
Then you can select and delete them.
Additionally, you can customize your Toolbar and put the "Breakpoints" button there. Click this on/off will active/deactivate all breakpoints. While this doesn't remove them, it may be useful if you just don't want them to be hit for a run.
As an addition to mxg 's answer above:
in Xcode 5 it's been changed to CMD(⌘) + 7
For Xcode 5:
In ToolBar, select Navigate -> select Reveal in Project Navigator -> In Navigator area, select Show the Breakpoint Navigator.
Here, You can edit, hide/unhide, share, move the breakpoint for each and every class.
Note: Because of Xcode newbie's, am explained the steps from toolbar to show the Breakpoint Navigator.
For XCode 12:
Press CMD ⌘ + 8
Select All (CMD ⌘ + A)
Right Click and Select "Delete Breakpoints"
For XCode 12.4
Click on Debug in Toolbar
Choose Breakpoints
Then Click on Delete All Breakpoints
That's it!!
CMD(⌘) + a
CMD(⌘) + /
CMD(⌘) + /
In XCode 7 you can just drag a bp into the project view window and an X will appear, release mouse and it will be deleted.
Related
in the past (older version of xcode) I had a plus sign in the top right of an editor to add a tab. Then in the new tab I could click on the second file and I had 2 files open in 2 tabs.
My plus sign is gone (I guess with my last update).
How to rollback this + button or how to have tabbed editors in Xcode 6.4 (6E35b) ?
You can show the tab bar (with the + button you mention) from the View menu:
Alternatively you can press CMD+T to open a new tab, which will automatically show the tab bar.
File -> New -> Tab and the + sign will appear
You can use -- Command + T or you can follow this also
I know how to do this in XCode 3, but just can't find how to add a global (as opposed to at a specific line) breakpoint in XCode 4.
There is a good answer in the apple developer forums (paid account needed): https://devforums.apple.com/thread/68421
To summarise, you have to go to the breakpoints navigator (View->Navigators->Breakpoint Navigator), add a new symbolic breakpoint using the + button at the bottom left corner. To make this breakpoint global, you have to right click it and press "Move Breakpoint to -> User"
Once I start editing my code and adding for loops or if then statements my code indentation is whacked because the previous code maintains its former indentation instead of adjusting automatically.
In Visual Studio you can highlight code and select 'format selection' to fix these issues - is there anything similar in Xcode?
Before Xcode 9 (for Xcode 9 see default shortcut below)
select text
right-click
there's a "Re-indent selection" item in popup menu
In XCode 4 there is one more step:
select text
right-click
Click on "Structure"
there's a "Re-indent selection" and other options in popup menu
Or using the default shortcut:
select text
press ctrl + i
select text
press Control-I (the default keyboard shortcut)
You can do this automatically in Xcode 11
In Xcode 4.6.3, choose Editor > Structure > Re-Indent.
Shortcut: Control + I
(that's 'i', for 'indent')
This works on current selection. If no text selected, choose Edit > Select All (⌘+A) and then perform the re-indent.
(I'm more clearly restating the other answers)
These solutions re-indent text to the default xCode behaviors. To change these behaviors, go to xCode (v.4) > Preferences > Text Editing. Then to Indentation Tab.
Xcode 9.2:
You can select text and press ctrl + i to re-indent code.
You can do it in different ways, but these two are the easiest
select text ( ⌘ +a) :
Using shortcut -> (control)^ + i
Click on "Editor" -> Click on "Structure" -> Click on "Re-indent"
Sometimes setting Xcode global preferences is not enough for ^ + i to do its job accordingly. The reason is that project settings override global ones. You can set indentations for a concrete project or even a file.
Select project (or file) in the Navigation Pane. Then in File Inspector go to Text Settings section and set desired number of tabs or spaces for indents.
To quickly re-indent the whole file:
⌘+a
⌘+x
⌘+v
Edit: No longer working in Xcode 11
You can try my extension Swimat
https://github.com/Jintin/Swimat
It support format on selection.
Simple install by brew cask install swimat
I go to Breakpoints panel in XCode, in the 'Breakpoints' I click a breakpoint and click 'Delete', but it does not remove the breakpoint. And I try go to go to 'Project Breakpoints' and find the same breakpoint and click 'Delete'. But it still does not break the breakpoint.
Drag them out of the bar on the side and they will disappear.
You can also press the shortcut ⌘+\ while your cursor is on the line, or press ⌫ with the breakpoint selected in the navigator:
Also try ⌘+\ to toggle the breakpoint at the current line.
You can also right-click on it and select the "Delete" menu.
When I am at a breakpoint and if I want to ignore all the rest of breakpoints and move on, what shortcut should I use?
You can select "Disable All Breakpoints" from the Debug menu.
This and then continue with F5.
You could set this up as a keyboard shortcut under Tools/Options/Keyboard.
Well, you can:
delete all breakpoints using Ctrl+Shift+F9
disable all breakpoints from the ->Debug menu.
Disabling breakpoints does not have a shortcut defined, but you define your own in ->Tools->Options menu under Environment->Keyboard. Also Shift+F5 stops debugging altogether.
Ctrl+Shift+F9 will delete them all.
To disable all breakpoints - either you do it from the menu - or you go to option -> environment -> keyboard, and create a shortcut there.
Enabled / Disabled just one break point at a time with Ctrl + F9.
Though the cursor has to be on the given line of code.
By default there is no option available to Disable/Enable all breakpoints, so you need to add it. Steps to add Disable/Enable breakpoints are as :-
1) Under Tools tab select Customize.
2) Then under Commands tab, you would find 3 options(drop-downs) - Menu bar, Toolbar and Context menu.
3) So under Menu bar drop-down, scroll down and select option Debug.
4) And now under Controls section, select the command you need to add i.e here you would select command Enable All Breakpoints/Disable All Breakpoints and click Add Command.
5) Close this pop-up and boom, now you would find this option under Debug section of the main console.
No need to thank, just an upvote would work..!! :P :P
Shortcut to delete all break-points: CTRL+SHIFT+F9.