Large DerivedData folder in ios directory?

I am looking for some help in understanding why one of my projects has a very large DerivedDate folder in the ios directory in my Capacitor project.

For this particular project, there is 1.4 GB of data. Are these folders representing the various Simulators I have tested the app out on?

Is there a way to clean up this data across all of my projects?

Hmm, how odd! Somehow your DerivedData folder got moved from the default location. The default location should be /Users/<USER_NAME>/Library/Developer/Xcode/DerivedData.

You can reset it back to the default location by doing the following

  • Click “Xcode” from the top menu bar
  • Click “Preferences” in the drop-down menu (third from the top)
  • In the Preferences window, click “Locations” (second from the right)
  • In the “DerivedData” section, set this to “Default” or whichever folder path you want.

If for whatever reason, you can’t move the DerivedData folder, it’s safe to delete. The DerivedData folder is a cache of project builds and simulator data.

When I did a search, that is what I came across in the Capacitor documentation, but as I went and looked at my Xcode settings, that is what it showed. Please see screen shots below:

As you can see, the DerivedData is defaulted to my /Users/<USER_NAME>/Library/Developer/Xcode/DerivedData location, but it is also appearing in my projects ios folder.

Any thoughts?

The same problem here with ionic 5 and capacitor. This problem occures today. I am not sure, but I think I removed the whole DervidedData at “/Users/dev/Library/Developer/Xcode/DerivedData“ before that happened. The path is the same like before in the xcode settings, I delete the wrong DerivedData folder in ios folder. But on every “ionic capacitor run ios“ it creates a new one in ios folder.
Can somebody help here?

Very strange. And if you delete the DerivedData folder in your project it comes back? I don’t think I’ve had this happen to me. If you upgrade to the latest Xcode does that still happen?

Yes, after deleting the DerivedData in my projects folder and then running ionic capacitor run ios the folder reappears in the ios directory of my project.

I’m running macOS Catalina 10.15.7 with XCode 12.4. Unfortunately, I am unable to upgrade to both Monterey and XCode 13 due to my systems limitations/storage.