9

Are there any ways/methods for clearing application cache in iOS? (I am not asking about Is there a quicker way to clear cache on Safari mobile? )

In Android OS, after taking application manager and then selecting a specific app, there's an option to clear cache.

I would like to know if there is any way (like in Android) to clear cache other than closing the application and reopening the same multiple times or uninstalling the application and then reinstalling the same.

2 Answers 2

6

If you have installed the app directly from Xcode you can remove the data from the app in the xcode device manager.

  1. Connect iPhone with an USB cable to your MAC
  2. Launch Xcode
  3. Press Shift+Cmd+2
  4. Click on your iPhone in the list
  5. Click on your app in the installed apps list,
  6. Click the "Gear" icon
  7. Click download container
  8. Select where to store the container
  9. Open the container remove the unwanted files,
  10. In Xcode device manager click replace container (Below download container)

Then the cache will be reset.

1
  • Hi @Harcher, Thanks for the response. We're developing a cloud application (the app inside the cloud app).There's a need to test the same in multiple devices (iPad, iPhone) at once. Is there a quicker way to clear the cache without following the above method?
    – SE_User
    Commented Aug 10, 2016 at 12:06
1

There's no user accessible way to delete the cache of an app in iOS.

However, there should be no need for you to do so as iOS automatically manages the cache. For example, it will delete the cached files if the disk is filled up and disk space is needed for an update.

The real question here is why you would want to clear the cache? - Are you trying to solve a specific problem you have with an app?

9
  • Hi @jksoegaard Thanks for the response. The answer to why is that, when we develop a cloud application, and we have made certain changes to the same (the app inside the cloud app), we'll have to close it and reopen it a number of times (or as you said we'll have to open other apps and make the disk completely filled up, so cache is cleared) to see the change. (It would be way easier if there was a method to clear cache of specific apps)
    – SE_User
    Commented Aug 10, 2016 at 9:03
  • You can just add a method within your app to clear the cache. That is the simplest and most correct way of solving this. For development purposes you can do that any way you choose - for example by adding a button to the user interface. Some choose more subtle interactions for development purposes, such as for example shaking the phone to trigger the debug action (i.e. clearing the cache). Your app just needs to remove the files in the /Library/Caches/ folder.
    – jksoegaard
    Commented Aug 10, 2016 at 15:32
  • Hi @jksoegaard As I mentioned already, we're not developing a native iOS application. But it's an HTML hybrid application. So, I am afraid that we dont have permission to access the folders which you mentioned above. Also, my requirement is to clear cache without making any change in our app, but instead if there's any other methods (like in Application manager or so).
    – SE_User
    Commented Aug 11, 2016 at 6:26
  • You haven't actually mentioned that you're not doing a native iOS application. Anyways, HTML hybrid application can and do have permission to access those folder, so you can indeed clear them from a HTML hybrid application. If you requirement really is to clear the cache without making any change, as I told you - there are NO options for doing so in the iOS user interface except deleting the app, artificially filling up the disk or by accessing the phone from a Mac/PC.
    – jksoegaard
    Commented Aug 11, 2016 at 6:55
  • 1
    I said HTML Hybrid application (That's why i didn't say cloud and instead said this, so that you might better understand), @jksoegaard :). No, it's no secret! We're developing Salesforce1 Lightning app.
    – SE_User
    Commented Aug 11, 2016 at 7:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .