如何删除 Xcode 8 中的派生数据?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38016143/
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
How can I delete derived data in Xcode 8?
提问by Antoine
The projects page seems to be disappeared from Xcode 8. I used this page for deleting the derived data.
项目页面似乎从 Xcode 8 中消失了。我使用此页面删除派生数据。
Any idea how can I delete derived data from within Xcode 8?
知道如何从 Xcode 8 中删除派生数据吗?
采纳答案by Antoine
Many different solutions for this problem. Most of them work as well. Another shortcut seems to be added as well:
这个问题有许多不同的解决方案。他们中的大多数也能工作。似乎还添加了另一个快捷方式:
Shift+ alt+ command ?+ K
Shift+ alt+ command ?+K
Will ask you to:
会要求你:
Are you sure you want to clean the build folder for “MyProject”?
This will delete all of the products and intermediate files in the build folder.
您确定要清除“MyProject”的构建文件夹吗?
这将删除构建文件夹中的所有产品和中间文件。
In most cases this would be enough to solve your problems.
在大多数情况下,这足以解决您的问题。
UPDATE
更新
As of Xcode 9 you'll be able to access the Derived Data folder by navigating to
从 Xcode 9 开始,您将能够通过导航到“派生数据”文件夹
File -> Project Settings
文件 -> 项目设置
or if you use a Workspace:
或者如果您使用工作区:
File -> Workspace Settings
文件 -> 工作区设置
回答by Bisca
(Working in Xcode 11)
(在 Xcode 11 中工作)
You can go to File
> Workspace Settings
if you are in a workspace environment or File
> Project Settings
for a regular project environment.
你可以去File
>Workspace Settings
如果你在一个工作区的环境或File
>Project Settings
的常规项目的环境。
Then click over the little grey arrow under Derived data
section and select your project folder to delete it.
然后单击Derived data
部分下的小灰色箭头并选择您的项目文件夹以将其删除。
回答by zirinisp
The simplest and fastest way is the following (if you have not changed the defaults folder for DerivedData).
最简单和最快的方法如下(如果您没有更改 DerivedData 的默认文件夹)。
Open terminal and past the following:
打开终端并通过以下内容:
rm -rf ~/Library/Developer/Xcode/DerivedData
回答by tesla
In Xcode 8, all the derived data is automatically cleaned. If you want to do it by hand, go to Locations
tab from the Preferences
, locate project's derived data folder, and delete files related to the project.
在 Xcode 8 中,所有派生数据都会自动清理。如果您想手动完成,请转到 中的Locations
选项卡Preferences
,找到项目的派生数据文件夹,并删除与项目相关的文件。
In macOS 10.12 and later, Xcode cleans up stale derived data, precompiled headers, and module caches. (23282174)
在 macOS 10.12 及更高版本中,Xcode 会清理陈旧的派生数据、预编译头文件和模块缓存。(23282174)
Credits to @charmingToad
归功于@charmingToad
But from what I observed, the same behaviour is typical when using Xcode 8 on OS X 10.11.5/6
但据我观察,在 OS X 10.11.5/6 上使用 Xcode 8 时,同样的行为是典型的
回答by Azik Abdullah
回答by Niklas Berglund
Manual removal of derived data
手动删除派生数据
If you want to remove derived data manually just run:
如果要手动删除派生数据,只需运行:
rm -rf ~/Library/Developer/Xcode/DerivedData
rm -rf ~/Library/Developer/Xcode/DerivedData
If you want to free up more disk space there's a few other directories you might want to clear out as well though.
如果您想释放更多磁盘空间,您可能还想清除一些其他目录。
Automatic removal of Xcode generated files
自动删除 Xcode 生成的文件
I have created a Bash script for removing all kinds of files generated by Xcode. Removing DerivedData content can be done by running:
我创建了一个 Bash 脚本来删除由 Xcode 生成的各种文件。删除 DerivedData 内容可以通过运行:
./xcode-clean.sh -d
More info at https://github.com/niklasberglund/xcode-clean.sh
回答by Ghulam Rasool
Method 1:
方法一:
- Close Xcode
Open Terminal and enter this command
rm -rf ~/Library/Developer/Xcode/DerivedData
- 关闭 Xcode
打开终端并输入此命令
rm -rf ~/Library/Developer/Xcode/DerivedData
Method 2:
方法二:
- Click on Xcode menu
- Go to Preference
- Select Locations (as shown in image)
- Click on the arrow below the Derived Data (as shown in image).
- 单击 Xcode 菜单
- 转到首选项
- 选择位置(如图所示)
- 单击派生数据下方的箭头(如图所示)。
It will bring you to the location of derived data and you can just delete it manually.
它会将您带到派生数据的位置,您可以手动删除它。
回答by Hemant Solanki
回答by Ansyar Hafid
Another way to go to your derived data folder is by right click on your App under "Products" folder in xcode and click "Show in Finder".
转到派生数据文件夹的另一种方法是右键单击 xcode 中“产品”文件夹下的应用程序,然后单击“在 Finder 中显示”。
回答by Siddhesh Bhide
Steps For Delete DerivedData:
删除派生数据的步骤:
- Open Finder
- From menu click on
Go
>Go to Folder
- Enter ~/Library/Developer/Xcode/DerivedDatain textfield
- Click on
Go
button - You will see the folders of your
Xcode projects
Delete
the folders of projects, which you don't need.
- 打开查找器
- 从菜单中单击
Go
>Go to Folder
- 在文本字段中输入~/Library/Developer/Xcode/DerivedData
- 点击
Go
按钮 - 你会看到你的文件夹
Xcode projects
Delete
您不需要的项目文件夹。