If you're working with an XCode application, either iOS or MacOS, and want to do a completely clean build and delete the cache, it's simple.
Execute this command from the command line..
defaults delete your.apps.bundle.id
Where "your.apps.bundle.id" is the actual bundle id of your app.
This will not by itself delete any files in that your app may have written in its Documents directory. To delete these files you'll need to find the path to it. You can print it to the XCode console when running your app with this snippet in your
print( FileManager.default.urls(for: .documentDirectory, in: .userDomainMask) )
Then just cd to the location and delete any files, if necessary. Of course you'll need to do that and then run defaults delete again bc your app was just booted. But that's it!