44

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?.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Uday Singh
  • 441
  • 4
  • 4
  • 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
  • 17
    Finally, 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
  • 1
    this 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
  • 1
    Possible 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 Answers2

21

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.

enter image description here

In Xcode 11.2.1 they switched the below photos to Project, it used to be under Target

enter image description here

Important. The pic below is from Project in Xcode 11.2.1, this where you need to go:

enter image description here

Select Build Settings.

The pic below is from Project in Xcode 10.1, this is where you would need to go:

enter image description here

In the search field type Build Active Architecture and make sure Debug is set to Yes

enter image description here

In the same search field now type in Optimization Level. Change Debug and Release to None

enter image description here

As per @matt’s comments below also do a clean afterwards.

That's it

Lance Samaria
  • 17,576
  • 18
  • 108
  • 256
9

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.

Pei
  • 11,452
  • 5
  • 41
  • 45