如何使用命令行获取 xcodeproj 的配置(使用 xcodebuild)
我将使用 xcodebuild 命令创建一个构建脚本。
但是,我想获取项目的配置,例如 PROJECT_DIR
并将其用于下一步操作。或者更好的是,我只想知道 .app 将在哪里创建。
有什么建议吗?或者我必须阅读内部 xcodeproj 文件才能获取它?
I will create a build script with xcodebuild command.
But, I want get the config of my project, like PROJECT_DIR
and use it for next action. Or better, I only want to know where the .app will be create.
Any suggest or I will have to read the internal xcodeproj files to get it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
编辑:
在产品>编辑方案您可以将脚本添加到下拉菜单的“后操作”部分,选中“从程序提供构建设置”并导出 $(BUILD_PRODUCTS_DIR) 变量(或将其写入文件,等等)。
我一开始没明白你问题的意思,抱歉。
老东西:
您可以右键单击目标并选择“在 Finder 中显示”以了解它将在哪里构建。
如果您不喜欢该位置(默认为长路径),您可以更改 Xcode 的首选项以将 DerivedData-Folder 直接保存在项目文件夹中。那么路径将类似于 $(projectfolder)/DerivedData/Build/Product/program。
我假设你使用的是 Xcode4。
Edit:
In Product > Edit Scheme you can add a script to the "post-action" part of the dropdown menu, check "provide build settings from program" and export the $(BUILD_PRODUCTS_DIR) variable (or write it to a file, whatever).
I did not get the meaning of your question at first, sorry.
Old stuff:
You can right-click on the target and select "show in Finder" to know where it is going to be built.
If you don't like the location (default is a long path) you can change the preferences of Xcode to save the DerivedData-Folder directly in the project-folder. Then the path will be something like $(projectfolder)/DerivedData/Build/Product/program.
I assume you are using Xcode4.