When can I safely delete Xcode DerivedData folder?

You might want to clean derived data when -


  1. When you pull code from remote repository because it might contain new/deleted file which you might be using in other module/project.

Consider there are two project (say ProjectA and ProjectB) in your workspace.

1) You already build your app and their derived data is available.
3) Now consider there is reference to some `Class` of Project A in Project B. You have used static function form  ProjectA classes.
2) Now you pull code from remote repo and it contains changes for Project A only.
3) In this pull, the used static function form ProjectA gets deleted.
3) When you build app again, only Project A gets complied again but not Project B because it has no code change. Inshort, when there is change in code XCode complies that module again not complete app.
4) Now you will you get build issue as dependencies are not correct now. Project B has no idea what happened.
5) So in this case, you should clean derived data.

  1. Correct code coverage report.

Code coverage reports into the default derived data directory located at ~/Library/Developer/Xcode/DerivedData. You can clean code coverge report form DerivedData and regerate it again.


Please correct me if i am wrong. This is as per my understanding.

Will update this answer if i found more reasons.