在 xcode 中构建库时选择要运行的外部项目
有没有什么方法(在 xcode 中)指定一个外部项目在该项目的依赖库之一中工作时直接构建和运行?当我想测试我的更改时,必须总是切换回主项目,这很烦人 - 了解这样的事情会非常有帮助。
Is there any way (in xcode) to specify an external project to build and run directly while working in one of that project's dependent libraries? It is annoying to have to always switch back to the main project when I want to test my changes - something like this would be very helpful to know.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
项目不是运行,而是构建。 (从技术上讲,目标构建。)您想要的是自定义可执行文件:http://developer.apple.com/mac/library/DOCUMENTATION/DeveloperTools/Conceptual/XcodeProjectManagement/230-Defining_Executable_Environments/executable_environments.html
如果您是仅对共享库或框架进行更改,而不对接口进行更改(即,应用程序不需要针对库标头重新编译或针对库二进制文件重新链接),您可以在库,构建它,然后将应用程序作为库项目中的自定义可执行文件启动。
如果您所做的更改需要重建应用程序,那么您必须转移到应用程序项目来重建它。我不建议让库依赖于应用程序;那是倒退的。
Projects don't run, they build. (Technically, targets build.) What you want is a Custom Executable: http://developer.apple.com/mac/library/DOCUMENTATION/DeveloperTools/Conceptual/XcodeProjectManagement/230-Defining_Executable_Environments/executable_environments.html
If you are only making changes to the shared library or framework, and not to the interface (that is, the app doesn't need to be recompiled against the library headers or re-linked against the library binary), you can make the code changes in the library, build it, and launch the app as a custom executable in the library project.
If you make changes that require the app to be rebuilt, then you have to shift to the app project to rebuild it. I wouldn't recommend making the library dependent on the app; that's backwards.