I need to make an app which erases all of Android's data and cache. I need it because I have an Android device which will be used by different people at different points in time, so I want a way to protected the different users data. I have found a few methods to do erase the data, but they all need root, such as running adb clear
on all packages. Is there a method to clear all apps data and cache without rooting?
Asked
Active
Viewed 282 times
0

Samuel
- 378
- 1
- 9
1 Answers
1
No, you need root access for that.
It is documented here. The files you are talking about are app-specific files, and other apps cannot access them, unless they have root access.

ByteWelder
- 5,464
- 1
- 38
- 45
-
I see. Is there a way to simulate root access on Android Studio or will I need to root a real Android device to run tests? – Samuel Sep 30 '20 at 21:52
-
See https://stackoverflow.com/questions/5095234/how-to-get-root-access-on-android-emulator for rooting an emulator. – ByteWelder Oct 01 '20 at 06:22