Written by Sean Behan on Fri Jun 08th 2018

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 viewDidLoad method.

    print( FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] )

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!

Tagged with..
#ios #macos #swift #xcode #defaults #cache #bundle id

Just finishing up brewing up some fresh ground comments...