[ACCEPTED]-Delete shared preferences using an adb command-sharedpreferences

Accepted answer
Score: 17

If you want to clear all the preferences, a 1 single command will do it:

adb shell pm clear <package name>

Score: 3

Definitely not on an unrooted phone. On 6 normal consumer builds (user builds), only 5 the application itself can access the app's 4 data.

If you have root, you can access the 3 shell via

adb shell

Then navigate to the app's data 2 directory (/data/data/<package name>), find the file and rm it.

Alternatively, you 1 can do it all at once with

adb shell rm /data/data/<package name>/<file name> 
Score: 2

You can try this on a DEBUG application 1 only:

$ adb shell
$ adb run-as mypackagename

$ cd /data/data/mypackagename/shared_prefs

//then remove whatever you want

More Related questions