Q:

How to run android app in emulator by rewriting old databases?

When I always run app to test in emulator from Eclipse , by default it never uninstalls previous one. It will maintain previous copy of database and files of the same app and run a new compiled code.
What if I want to remove all app related files, databases every time I compile and run it to test? Any settings for this in Eclipse ? I want to avoid the step of manually uninstalling it before every run. Thanks.

A:

You can have a command prompt window open, and before launching, execute:
adb uninstall your.project.package

when using adb install with the -r modifier, the app re-installs and its data is saved. I haven't found any place in Eclipse to change this configuration, but I think this is done inside the SDK's Ant tasks. Take a look at this class for more information

