Add Breakpoint on iOS Native Cocoa Touch Static Framework

Developing an iOS Framework and want to use breakpoints within it for debugging and development purposes.

Aman Kesarwani
3 min readMar 29, 2020

Hi friends and fellow developers, this is my first blog post (pilot post). By profession, I am an iOS Application / Native SDK developer.

Being a developer we face multiple challenges daily and more or less it's the best part of the same. One such challenge is to add a breakpoint in the iOS native SDK and wanting the application to halt once the execution reaches the point of breakpoint applied on the iOS SDK. I personally faced this challenge a lot in the phase of SDK development.

So, here I come with a rescue for this problem. Please be with me by the end of this article, I will tell the stepwise solution —

Step 1

Open yours / Make an iOS cocoa-touch framework. In my case, I am creating a new framework named DummyProj.

Step 2

Add the breakpoints in the files as per your specific requirements or needs. Likewise, I did the same here in the file named ViewController.swift

Step 3

Go to the Breakpoint Navigator on the top left of the IDE i.e. Xcode. Follow the red marker as shown in the screenshot.

Step 4

Select on the breakpoint reference on the Breakpoint Navigator panel and press the “Right Click” for more options. Select “Move Breakpoint to” and then select “User” form the extended menu option.

Check the screenshots below.

After selecting the “User” option you will notice the breakpoint is shifted from project hierarchy to the User hierarchy. Repeat the same steps for the every required breakpoints within the SDK.

Step 5

Hurrahhh !! The task is done. Now you can build the iOS SDK and embed within the application and have faith the execution will stop at the desired point within the iOS SDK.

Make sure to enable Breakpoints at the application level.

I have tested the same on XCode 10.2 and above and it works like charm :)

End !! Make sure to give Clap if you find this article helpful. Best of luck !!

--

--