如何在XCode下Debug 动态库

相比vs, xcode很多debug方式还是比较"隐藏"的.最近需要debug一些macos下的动态库.在vs下,把动态库直接attach到现有进程就可以.在xcode下如果动态库还没加载这招不行!搜了一下.解决方案如下,记一笔以免日后忘记.

In your bundle project, you should add a custom executable. That executable will launch in the debugger when you do a Build & Debug.

To do this in Xcode 3, right-click on the Executables section in the Groups and Files list in your project and choose Add > New Custom Executable…

You can then select your application in the open dialog.

In Xcode 4, you need to go to Product > Manage Schemes, select your Debug scheme and in theInfo tab for the Debug action you should use the Executable popup to choose a custom executable.

You will also need to change your build settings for your Debug scheme so that the build products are placed in your application's plug-ins folder when the plug-in is built, so that when you Build & Debug the application contains the latest version of your bundle.


你可能感兴趣的:(如何在XCode下Debug 动态库)