4

As the title already states, I want to clear the cache and all data of an app, but not everything on the actual iOS Simulator itself. All I can find on StackOverflow is posts like these:

Reset iOS Simulator application data to run app for first time

Where it tells me to reset the entire phone which takes quite a bit of time. I can clear the cache on the actual iPhone, I can't fathom why I wouldn't be able to on the simulator, it feels so basic.

Jeff Lee
  • 41
  • 1
  • 2
  • You can long press the app to delete it as you would on the device, if that’s what you mean. That cleans the entire sandbox for the app. – Warren Burton May 20 '19 at 21:52
  • True, but reinstalling the app takes a long time. I don't want to uninstall anything, I just want to clear the cache – Jeff Lee May 21 '19 at 22:29
  • Reinstalling doesn’t take significantly longer than a launch but maybe your app is big? Run recursive deletes on the relevant folders using FileManager. – Warren Burton May 21 '19 at 22:36

1 Answers1

2

Use xcrun simctl get_app_container <device> <bundleid> data to get the path to your app's data container.

You can navigate to that directory and delete whatever content you want to delete.

russbishop
  • 16,587
  • 7
  • 61
  • 74
  • Use _booted_ command controls if you want to clear the cache of an app with simulator active booted. `xcrun simctl get_app_container booted data` https://www.iosdev.recipes/simctl/#locate-an-app-bundle-app-data-or-app-group-data – alf_red Feb 01 '22 at 10:32