开发者

How can I get eclipse to wipe the user data for my app before running it again

I am not using the emulator (to slow), and am debugging on act开发者_如何学Pythonual device (Incredible). I have noticed that even if I go to the phones menu >> settings >> applications >> my app and force stop and clear data, if I run from eclipse again right after, some old values persist. I have not noticed this problem if I uninstall the app and then run it from eclipse.

Is there a way to have eclipse uninstall the app every time, or is there an option like the one one the emulator to target/wipe user data?


On the command line it should be as simple as

adb uninstall <package name>

Where adb is the full path to adb if you have not placed it in your path or made an alias for it. (It's easiest to place it in your path).

Updated thanks to @alextsc


Well, this may not be the best way but it's something I do. I have a method in my first activity that wipes all the user data and I set a simple flag to either run the method (during development) or not run the method (during production). This saves me a lot of time in not having to install/uninstall the app on a phone.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜