本文介绍了如何清除我的Andr​​oid模拟器我的应用程序的localStorage的我安装它每一次?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我从Eclipse中安装它每次清除localStorage的我的应用程序,模拟安装该应用程序的第一次。

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?

谢谢!

我回答这个,专门针对Android的,在这里 - Programatically清晰的PhoneGap /科尔多瓦应用程序的Andr​​oid上的高速缓存来模拟一个新的安装?

I answered this, specifically for Android, here - Programatically clear PhoneGap/Cordova app's cache on Android to simulate a fresh install?

推荐答案

有没有钩在Eclipse中,但你也许可以做到这一点用Ant。您可以添加上载应用程序之前执行的明确指令(时明确my.package )的任务。如果时明确不工作,你可以写一个小的脚本,并上载应用程序之前,在设备上启动

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. If pm clear does not work, you can write a small script and start it on the device before uploading the app

还有Android的运行配置的擦除用户数据复选框,但它只能在模拟器启动。

There is also the Android run configuration's 'Wipe user data' checkbox, but it only works on emulator startup.

这篇关于如何清除我的Andr​​oid模拟器我的应用程序的localStorage的我安装它每一次?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 14:37