Xcode 的 build 文件夹在哪里?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5952782/
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-09 03:56:39  来源:igfitidea点击:

Where is Xcode's build folder?

xcodebuild

提问by aryaxt

Before Xcode 4 the build used to be created in the root folder of my project. I can no longer find it.

在 Xcode 4 之前,构建曾经是在我项目的根文件夹中创建的。我再也找不到了。

Where can i find the build folder?

我在哪里可以找到构建文件夹?

回答by pzearfoss

~/Library/Developer/Xcode/DerivedDatais now the default.
You can set the prefs in Xcode to allow projects to specify their build directories.

~/Library/Developer/Xcode/DerivedData现在是默认设置。
您可以在 Xcode 中设置首选项以允许项目指定其构建目录。

回答by MikeKusold

It should by located in: ~/Library/Developer/Xcode/DerivedData.

它应该位于:~/Library/Developer/Xcode/DerivedData

If you changed the defaults, you can see where the build directory is by going to File->Workspace Settingsthen look at Build Location

如果您更改了默认值,您可以通过转到File->Workspace Settings然后查看Build Location来查看构建目录的位置

回答by sharon ouyang

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明

Configure XCode project settings, it can solve your problem.

配置 XCode 项目设置,它可以解决您的问题。

回答by JKatzbeck

I wondered the same myself. I found that under File(menu) there is an item "Project Settings". It opens a dialog box with 3 choices: "Default Location", "Project-relative Location", and "Custom location" "Project-relative" puts the build products in the project folder, like before. This is not in the Preferences menu and must be set every time a project is created. Hope this helps.

我自己也是这么想的。我发现在文件(菜单)下有一个项目“项目设置”。它会打开一个包含 3 个选项的对话框:“默认位置”、“项目相关位置”和“自定义位置”“项目相关”将构建产品放在项目文件夹中,就像以前一样。这不在首选项菜单中,每次创建项目时都必须设置。希望这可以帮助。

回答by Mark Granoff

With a project previously created in Xcode3, I see an intermediate directory under build/called Foo.buildwhere Foois my project's name, and then in that are the directories you'd expect (Debug-iphonesimulator, Release-iphoneos, etc, assuming you've done a build of that type) containing the object files and products.

对于以前在 Xcode3 中创建的项目,我看到一个中间目录,build/叫做Foo.buildwhere Foois my project's name,然后是您期望的目录(Debug-iphonesimulator、Release-iphoneos 等,假设您已经完成构建)该类型)包含目标文件和产品。

Now, I suspect that if you start a newproject in Xcode4, the default location is under DerivedData, but if you open an Xcode3 project in Xcode4, then Xcode4 uses the build/ directory (as described above). So, there are several correct answers. :-) Under the File menu, Project Settings, you can see you can customize how XCode works in this regard as much or as little as you like.

现在,我怀疑如果您在 Xcode4 中启动一个项目,默认位置在 DerivedData 下,但是如果您在 Xcode4 中打开一个 Xcode3 项目,则 Xcode4 使用 build/ 目录(如上所述)。所以,有几个正确的答案。:-) 在文件菜单的项目设置下,您可以看到您可以根据自己的喜好自定义 XCode 在这方面的工作方式。

回答by yoAlex5

By default Build locationis in Derived Data.

默认Build locationDerived Data.

Please note: a path to a product can be changedif you delete DerivedData during development process and rebuild it again.

请注意:如果在开发过程中删除 DerivedData 并重新构建它,则可以更改产品的路径。

Xcode -> Preferences... -> Locations 

You can change the location of Build location. It will have an effect on the whole workspace

您可以更改 的位置Build location。它会对整个工作区产生影响

File -> Project/Workspace Settings... -> Advanced 

You can change the location of Target using:

您可以使用以下方法更改 Target 的位置:

Project editor -> select a target -> Build Settings -> Per-configuration Build Products Path

The default value is$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)

默认值为$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)

It makes sense if you want to create an autonomic Build location

如果你想创建一个自主的 Build location

Xcode 10.2.1

Xcode 10.2.1

回答by hajunho

In case of Debug Running

调试运行时

~/Library/Developer/Xcode/DerivedData/{your app}/Build/Products/Debug/{Project Name}.app/Contents/MacOS

~/Library/Developer/Xcode/DerivedData/{你的应用}/Build/Products/Debug/{项目名称}.app/Contents/MacOS

You can find standalone executable file(Mach-O 64-bit executable x86_64)

你可以找到独立的可执行文件(Mach-O 64-bit executable x86_64)