I have a xcode project which includes few cocoa pod files. When i put breakpoints in cocoa pod files, the debugger does not stops at those breakpoints, why? Could anyone have any idea about the same?.
-
Please show us your code so we can see if there are any issues. – Deepend Apr 04 '16 at 09:47
-
I am using a third party control using pods. while debugging the code i put breakpoint in some file which is under pods projects. – Uday Singh Apr 04 '16 at 16:27
-
17Finally, i have found the solution. 1.We have set the Active build architecture settings to YES for debug. 2.Set Optimization Level to None for both Debug and release. That's all. Thanks – Uday Singh Apr 05 '16 at 03:59
-
1this could also help, you usually get in the console "was compiled with optimization - stepping may behave oddly; variables may not be available." take a look into this link https://stackoverflow.com/questions/32772573/project-name-was-compiled-with-optimization-stepping-may-behave-oddly-varia/32892914#32892914 – Congruent Tech. UG Apr 23 '18 at 13:11
-
I had to add the framework lib to Build Phases -> Embed Pods Frameworks: ${BUILT_PRODUCTS_DIR}/mypod/libmypod_pods.a – Chris Hobbs Oct 16 '18 at 17:16
-
1Possible duplicate of ['Project Name' was compiled with optimization - stepping may behave oddly; variables may not be available](https://stackoverflow.com/questions/32772573/project-name-was-compiled-with-optimization-stepping-may-behave-oddly-varia) – Cœur Dec 18 '18 at 11:41
-
You can debug. just make 1 changes in your file which you want to debug - unlock the file. Q - How to unlock - A: Just make changes in your profile like add print line etc. – James Smith Jul 05 '21 at 09:16
2 Answers
I followed @UdaySingh's comment and it worked, I'm not sure why he didn't post an answer but I realize there are people who sometimes need a step by step and a visual guide tremendously helps. Here's the visual version of his comment.
In the project navigator select the blue project icon.
In Xcode 11.2.1 they switched the below photos to Project, it used to be under Target
Important. The pic below is from Project
in Xcode 11.2.1, this where you need to go:
Select Build Settings
.
The pic below is from Project
in Xcode 10.1, this is where you would need to go:
In the search field type Build Active Architecture
and make sure Debug
is set to Yes
In the same search field now type in Optimization Level
.
Change Debug
and Release
to None
As per @matt’s comments below also do a clean afterwards.
That's it

- 17,576
- 18
- 108
- 256
-
8
-
1Clean is mandatory, I did it without clean and it didn't work, so thanks Matt, Lance and OP. – Darko Apr 10 '19 at 12:32
-
Could you explain why optimization needs to be turned off for `Release` as well please? – superarts.org Feb 16 '22 at 18:42
-
I believe it's because the pods are compiled for release even though the embedding project is compiled for debug – Phill Apley Aug 09 '22 at 16:33
In my case, cleaning Pods directory and installing pods again worked. Spent hours for this so hope it would be helpful for someone who couldn't find a solution yet.

- 11,452
- 5
- 41
- 45