如何使用命令行获取 xcodeproj 的配置(使用 xcodebuild)

发布于 2024-12-08 18:17:22 字数 164 浏览 6 评论 0原文

我将使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

焚却相思 2024-12-15 18:17:22

编辑:
在产品>编辑方案您可以将脚本添加到下拉菜单的“后操作”部分,选中“从程序提供构建设置”并导出 $(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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文