xcode 如何从主项目调试 .framework 源代码?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13836628/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 02:18:10  来源:igfitidea点击:

how to debug .framework source from main project?

iosxcode

提问by Hashmat Khalil

i have a sub project in my main project using xcode 4.5.2 . the sub project produces .framework library. the sub project is embbeded in main project. i have also defined the project header where to look for sub project header(framework header). the sub project build target is set for debug. but still i cannot step in break point in the sub project. i found something but its from 2006 when xcode was different. and i cannot figure it out. http://www.idevgames.com/forums/thread-3985.html

我的主项目中有一个使用 xcode 4.5.2 的子项目。子项目生成 .framework 库。子项目嵌入在主项目中。我还定义了项目标题,在哪里寻找子项目标题(框架标题)。子项目构建目标设置为调试。但我仍然无法进入子项目中的断点。我发现了一些东西,但它是从 2006 年开始的,当时 xcode 是不同的。我想不通。 http://www.idevgames.com/forums/thread-3985.html

does anyone know how to configure xcode in order to use it for debugging the .framwork library?

有谁知道如何配置 xcode 以使用它来调试 .framework 库?

thanks in advance!

提前致谢!

回答by resurrecteds

There is actually a way to debug the an iOS project that uses a .framework, if you have the source code. This worked for me in xcode 4.6.

如果您有源代码,实际上有一种方法可以调试使用 .framework 的 iOS 项目。这在 xcode 4.6 中对我有用。

You can do in the following way:

您可以通过以下方式进行:

  1. Insert breakpoints in your .framework's source code.
  2. Compile the project that uses the framework and run it on your device (iPhone, iPad, etc.). This step is just to make sure you have the most updated project installed on your device.
  3. Stop the process running on your device and go to xcode -> product -> Attach to process -> YourApp. In xcode 6, "Attach to Process" is under the Debug menu.
  1. 在 .framework 的源代码中插入断点。
  2. 编译使用该框架的项目并在您的设备(iPhone、iPad 等)上运行它。这一步只是为了确保您的设备上安装了最新的项目。
  3. 停止在您的设备上运行的进程并转到 xcode -> product -> Attach to process -> YourApp。在 xcode 6 中,“附加到进程”位于“调试”菜单下。

If you don't see your app's name in the applications listed there, go to "By process Identifier (PID) or Name..." and enter the app's name. Now, if you'll run the application in your device, it should break in the breakpoints that are enabled.

如果您在此处列出的应用程序中没有看到您的应用程序名称,请转到“按进程标识符 (PID) 或名称...”并输入应用程序名称。现在,如果您要在设备中运行该应用程序,它应该会在已启用的断点处中断。

回答by Hashmat Khalil

There is no way to debug .framework. I have changed my sub project to produce static lib with public and private headers.

没有办法调试 .framework。我已经更改了我的子项目以生成带有公共和私有标头的静态库。