Naftuli Kay
Naftuli Kay

Reputation: 91630

Run a clean Android build from Eclipse?

Is there a way to run a build from Eclipse that cleans out the application's data each time? I'd like to do so in order to check the first-run experience for my application.

Upvotes: 1

Views: 4436

Answers (2)

Dan S
Dan S

Reputation: 9189

Yes, depending on the platform, create an uninstall script. In your project's settings tell the eclipse builder to run it in your project's settings. It can be configured to only run after you clean your project. Alternatively you could use an Ant script but that may be overkill if you don't already know how to use Ant.

There is an additional issue of handling switching between devices or emulator but if you tend to only use one at a time there should be no issue.

If you only debug with one device or emulator at a time this is all you need:

adb uninstall your.application.package

Upvotes: 0

Noah
Noah

Reputation: 1966

If you are using eclipse, go to app's run configurations, click on the target tab, and check the wipe user data field. I believe this will clear the app's data each time the eclipse project is run.

Eclipse - Android run configurations

Upvotes: 5

Related Questions