When using the iOS Simulator, I can simply delete the app and re-run the app to start fresh. How is this done for mac os apps? I can’t find it out. There is a folder for the project inside "DerivedData", but deleting this also messes with the entire project and I have to re-fetch all dependencies and stuff.
Thanks!
3
Answers
If the app is storing something at say
~/Library/Caches/yourapp
or~/Library/Application Support/yourapp
, it’s trivial to set up an Automator Service, or bash alias to clean them up.~/Library/Developer/Xcode/DerivedData
is meant for the Xcode project and the things Xcode creates, not the things that your app creates such as user preferences.Alternatively, you can create a listener for a flag in the app itself like
--run-fresh
that can be set in scheme settings as launch argument. This flag will (if you code it) stop the app from looking into user data folder.Had the same question, found the answer in another question on Stack Overflow: Nicolas Miari and superfell’s answer did the trick for me and my Mac Catalyst app:
For anyone who comes here later for solution:
brew install fd
fd com.thisIsYour.bundleId
You should see something likes this:
Library/Containers/B155E847-3026-484D-8CC1-165E3CA1E9CD/Data/Library/…
Library/Containers/B155E847-3026-484D-8CC1-165E3CA1E9CD/Data/Library/…
Library/Containers/B155E847-3026-484D-8CC1-165E3CA1E9CD/Data/Library/…
rm -rf Library/Containers/B155E847-3026-484D-8CC1-165E3CA1E9CD