Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When does iOS clean the local app ./tmp directories?

When does iOS clean the local app ./tmp directory?

Note that this is not a dupe of this question. I'm asking about the app specific temporary folder, not the system wide one.

You can use iExplorer to have a look at ./tmp directories on non-jailbroken phones.

(Note: I'm asking this out of curiosity only. I kind of suspect that these never get deleted unless you restore your phone from a backup or reinstall that particular app. But obviously you cannot count on that for semi-permanently storing cached files.)

like image 551
Ricardo Sanchez-Saez Avatar asked Jul 31 '14 15:07

Ricardo Sanchez-Saez


1 Answers

According to the documentation, it could be any time, if the app is not executing:

The system may also purge lingering files from this directory when your app is not running.

It's logical to assume if a) your app is not running; and b) your device is running low on storage, then it's highly likely the system will, at some point, purge the contents of <Application_Home>/tmp/.

It's also worth noting that the documentation states:

Your app should remove files from this directory when it determines they are no longer needed.

The emphasis here being on the app developer to do their own housekeeping and not leave it for the OS to tidy up after them.

like image 179
neilco Avatar answered Oct 04 '22 14:10

neilco