Why aren't Xcode breakpoints functioning?
Solution 1
First of all, I agree 100% with the earlier folks that said turn OFF Load Symbols Lazily
.
I have two more things to add.
(My first suggestion sounds obvious, but the first time someone suggested it to me, my reaction went along these lines: "come on, please, you really think I wouldn't know better...... oh.")
Make sure you haven't accidentally set "Active Build Configuration" to "Release."
Under "Targets" in the graphical tree display of your project, right click on your Target and do "Get Info." Look for a property named "Generate Debug Symbols" (or similar) and make sure this is CHECKED (aka ON). Also, you might try finding (also in Target >> Get Info) a property called "Debug Information Format" and setting it to "Dwarf with dsym file."
There are a number of other properties under Target >> Get Info that might affect you. Look for things like optimizing or compressing code and turn that stuff OFF (I assume you are working in a debug mode, so that this is not bad advice). Also, look for things like stripping symbols and make sure that is also OFF. For example, "Strip Linked Product" should be set to "No" for the Debug target.
Solution 2
In Xcode 7, what worked for me was:
-
Make sure that the
Target > Scheme > Run
- is in Debug mode (was Release) -
Make sure to check the option "Debug executable":
Solution 3
Go to the Xcode Debugging preferences. Make sure that "Load Symbols lazily" is NOT selected.
Solution 4
I was just having this same issue (again). After triple-checking "Load symbols lazily" and stripping and debug info generation flags, I did the following:
- quit Xcode
- open a terminal window and cd to the project directory
- cd into the .xcodeproj directory
- delete everything except the .pbxproj file (I had frank.mode1v3 and frank.pbxuser)
You can accomplish the same task in finder by right/option-clicking on the .xcodeproj bundle and picking "Show Package Contents".
When I restarted Xcode, all of my windows had reset to default positions, etc, but breakpoints worked!
Solution 5
One of the possible solutions for this could be ....go to Product>Scheme>Edit scheme>..Under Run>info>Executable check "Debug executable".
AlanKley
I'm an Android developer converted from a Windows Stack Desktop developer. I enjoy developing my personal projects using Flutter
Updated on February 11, 2022Comments
-
AlanKley about 2 years
I have breakpoints set but Xcode appears to ignore them.
-
taxilian over 11 yearsOn XCode 4.5.2 I had this issue and it turned out to be because I had enabled "Link-time optimization", so that's another thing to check
-
Rémi Doolaeghe almost 11 yearsThis works, but it deletes all your preferences... This should be done when nothing else worked.
-
Oscar over 10 yearsUnfortunately there are no "debugging" preferences in Xcode 6, and "lazily" doesn't appear in the documentation. Sigh.
-
Duck over 9 yearsworked for me, thanks. I wonder why Xcode sucks that much. Xcode is the worst piece of software ever written by Apple.
-
Frank Szczerba over 9 yearsWow, that's 5 years old. Hard to believe it still works, and that it's still an issue!
-
Jeffrey Sun over 9 yearsTo change the Build Configuration, go to Product -> Scheme -> Edit Scheme, under Run - Info. For me what worked was checking "Debug Executable" in that menu.
-
RNA over 9 yearsalright, now I can't find 'Load Symbols Lazily' option in XCode 6
-
Native_Mobile_Arch_Dev over 9 yearsDid not work for me. I am running Xcode 6.01. Now when I build, I receive multiple missing file errors. I'm reverting my code to resolve.
-
Dave over 9 yearsHijacking the top answer to add that Bison syntax seems to be another (exotic) cause of breakpoints not working (see my answer below). Hopefully will save some time to the next person with that problem.
-
dsgrnt over 9 yearsIt's also super easy to inadvertently toggle breakpoint activation with ⌘Y. So watch out for that, kids.
-
user2067021 almost 9 yearsIn 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.
-
user1601259 over 8 yearsI had same issue since working off an open source project which had a appstore release build run config as well as a debug one, you have to make sure to select the debug one.
-
anoop4real over 8 yearsThis is exactly what happened to me, checkbox was unchecked
-
Maheswaran Ravisankar about 8 yearsAfter updating to XCode 7, This setting was somehow
YES
only in mysubproject
and then breakpoints didnt work insubprojects
. And after setting toNO
, it was perfect! -
Ran about 8 yearsThis worked for me only after cleaning the project so a full rebuild will take place.
-
Juan Boero about 8 yearsOnly had to re start Xcode, my case was due to git versioning, when commiting the xcode user interface state data.
-
Michael Osofsky about 7 years"Load Symbols Lazily" is not an option in my Xcode 8. Seems to have disappeared in Xcode 6 stackoverflow.com/questions/26231671/…
-
Michael Osofsky about 7 yearsTo set "Active Build Configuration" to "Debug" instead of "Release" in Xcode 8 go to Product -> Scheme -> Edit Scheme. Click Run on left side. Click Info on top of screen. In Build Configuration drop-down, choose "Debug".
-
Noel Widmer almost 7 years@IshantMrinal Why is this not relevant? The user provided an answer that worked in his scenario.
-
elitalon over 6 yearsAnother setting that might prevent breakpoints to take effect is "Strip Debug Symbols During Copy"
-
dgmz almost 6 yearsSame issue for me. Shouldn't that option be enabled by default (XCode 8.3) ? Aren't we supposed to be all devs, willing to debug anyway ?
-
Kazi Abdullah Al Mamun almost 6 yearsWorked for me in Xcode 9.3, it would be great if you provide another image for option 1.
-
llamacorn almost 5 yearsThis suggestion isn't really relevant for xcode 10.2.1 which is the version I am using.
-
Chewie The Chorkie almost 5 yearsAny Xcode 10 solution? I need to keep building my project until breakpoints finally work.
-
Erkki Nokso-Koivisto almost 5 years@llamacorn ... your comments are delivered to me, but I no longer code on Mac at the moment, so I cannot help with Xcode 10 (sadly). I'm sorry about that! You may need to post a fresh new question with Xcode 10 in the title.
-
Erkki Nokso-Koivisto almost 5 years@chewie-the-chorkie please see my comment to llamacorn just now. Sorry I cannot be of assistance with Xcode 10.
-
Chewie The Chorkie almost 5 years@pestophagous thank you, I coincidentally already posted about it here if anyone can help: stackoverflow.com/questions/57117144/…
-
mrchance over 4 yearsomfg thx @taxilian. that solved it for me. xcode 11, 2019, this was driving me crazy. somewhat incredible that xcode does not warn you about that, facilitate turning off while debugging. lost 1 day "debugging" the user-interface of xcode – ㄈㄟㄈㄟ 23 mins ago
-
Jim75 over 3 yearsThank you! This also fixed the slow responsiveness of debugging logs
-
אורי orihpt about 3 yearsI deleted it while Xcode while running. Now everything is saved and breakpoints are working too! +1
-
Carl G over 2 years
-
Carl G over 2 yearsNote that the get-task-allow entitlement may be included by an Xcode Managed Profile: imgur.com/a/qS27asO
-
Jayprakash Dubey over 2 yearsWhat does 'Always Show Disassembly' mean? This didn't worked for me. :-(
-
elliotching almost 2 yearsUnder "Targets" in the graphical tree display of your project <<<--- can u please attach a screenshot pleassssssee?
-
elliotching almost 2 yearsright click on your Target and do "Get Info." << there is no "Get info" options