Does playerprefs survive 'Clear Data', 'Clear Cache'

Hi,

I’ve found similar old threads to this one, but none of them address this subject directly.

If the user used ‘Clear Data’ will playerprefs be deleted? What about ‘Clear Cache’?

Thanks for advance.

Try and see :slight_smile:

Clear data will clear whatever you saved to PlayerPrefs.

I am not sure about clear cache.

1 Like

^ this, I was about to post that, but got ninja’d.

I’ve got a game using PlayerPrefs, I’ll see what clear cache does.

EDIT: welp… not sure what “Clear cache” clears exactly on unity apps (Unity themselves can probably answer this one) but “Clear Data” most definitely erases the PlayerPrefs file.
source: my game’s options menu reset to the default settings after clearing data, then launching again. Clear cache appeared to do nothing.

PlayerPrefs are saved using SharedPreferences on Android. Clear cache probably means removing all the data under the app’s cache dir.

You can read more about storage options here: Data and file storage overview  |  Android Developers