Run a clean Android build from Eclipse?

后端 未结 2 1139
终归单人心
终归单人心 2021-01-25 22:40

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.

相关标签:
2条回答
  • 2021-01-25 23:36

    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

    0 讨论(0)
  • 2021-01-25 23:37

    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
    
    0 讨论(0)
提交回复
热议问题