Reputation: 139
is there is a command to clear myAndridApp data from emulator
i'm developing a app and I don't want to go to mange-app ->myapp -> clear data each time
App api 10 , emulator API :17
I dont want to uninstall the app or stop it all i need to clear its stored data
Upvotes: 2
Views: 1876
Reputation: 139
I found the answer to my question
adb shell pm clear [packgeName]
this command will clean all the data from the app
Upvotes: 10
Reputation: 3120
if you only want to clear the app data, then use adb shell to enter into the app data folder and do a rm command each time you want the data cleared:
for example, do this once:
adb shell
cd /data/data/<package name>
rm -r *
then from the same command line window, fire this command each time you want the data cleared:
rm -r *
Upvotes: 0
Reputation: 11961
You can close one by his pid using
adb shell kill <PID>
but I'm not sure of doing it with a package name.
However to kill the process you should use am:
am force-stop: force stop everything associated with <PACKAGE>.
am kill: Kill all processes associated with <PACKAGE>. Only kills.
processes that are safe to kill -- that is, will not impact the user
experience.
for example:
adb shell am force-stop <YOUR.PACKAGE.NAME>
or
am force-stop YOUR.PACKAGE.NAME
or
adb killall YOUR.PACKAGE.NAME
Upvotes: 0