I want to clear localStorage for my app each time I install it from Eclipse to simulate installing the app for the first time.
How can I do this?
Thanks!
I answered this, specifically for Android, here – Programmatically clear PhoneGap/Cordova app's cache on Android to simulate a fresh install?
There are no hooks in Eclipse, but you could probably do this with Ant. You can add a task that executes the clear command (
pm clear my.package) before uploading the app. Ifpm cleardoes not work, you can write a small script and start it on the device before uploading the appThere is also the Android run configuration’s ‘Wipe user data’ checkbox, but it only works on emulator startup.