SQLTerminal.app
now available

XPath.app
now available
Want fresh tech tips in your inbox?

How to Flush or Erase Cache of Your XCode iOS or MacOS Cocoa App

       

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 w/ #ios #macos #swift #xcode #defaults #cache #bundle id

Apps I've Built

XPath Expression Editor
Practice and improve your XPath skills with XPath Editor
Click to buy on the App Store
Photo Location Changer
Easily change the location on your photos and videos
Click here for more info about the app
Photo Date Changer
Easily change the dates and times on your photos and videos
Click here for more info about the app
VocabReminder
English dictionary with notifications so you won't forget what you're studying!
Click here for more info about the app
VocabQuiz
The app that quizzes and scores you on your vocabulary!
Click here for more info about the app