Debugging a static library in Xcode

筅森魡賤 提交于 2019-12-04 15:14:49

To use runtime debugger you should add your static library project as subproject to your sample where you want to debug it.

Make sure that GENERATE_DEBUG_SYMBOLS is set to YES (debug mode) for your static lib.

In case of using in project compiled static library (libYourLib.a) you won't be able step into methods but still should see NSLog coming.

If your static library is not a subproject or it is not in the same workspace, first make sure that GENERATE_DEBUG_SYMBOLS is set to YES (debug mode), as @Injectios says. Then go to Breakpoint Navigator, add a new "Symbolic Breakpoint" with the class/method you are interested in, and run your application.

The way I generally do it in my pre-compiled static library is that I would add a breakpoint at viewDidload and then when the breakpoint is hit and if we know which methods to add the breakpoint to, I would add a breakpoint like b <function_name> and then press continue, and when that function is hit during the execution, it would break and we can use regular lldb options to continue, step over and step into the code.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!