在iOS模拟器上删除应用程序数据而不卸载应用程序?

huangapple go评论73阅读模式
英文:

Delete application data on iOS simulator without uninstalling app?

问题

我想要删除应用程序数据,就像删除本地存储一样,而不必重新安装应用程序。

我在React Native中使用AsyncStorage,并已持久化了一些数据。为了快速测试存储,我想能够通过模拟器手动清除AsyncStorage,而不必在应用程序中实现注销/清除AsyncStorage按钮。
(https://stackoverflow.com/questions/46736268/react-native-asyncstorage-clear-is-failing-on-ios)。

英文:

I would like to delete application data like local storage without reinstalling the app.

I am using AsyncStorage in react-native, and have persisted some data. To quickly test storage, I would like to be able to clear AsyncStorage manually through the simulator, without implementing a logout/ clear AsyncStorage button in the app.
(https://stackoverflow.com/questions/46736268/react-native-asyncstorage-clear-is-failing-on-ios).

答案1

得分: 1

由于没有简单的方法来执行此操作,我已在我的应用中添加了开发者菜单,其中有一个名为“clear AsyncStorage”的按钮,调用了AsyncStorage.clear()

英文:

Since there is no easy way to do it, I have added a developer menu in my app, with a button called clear AsyncStorage, which called AsyncStorage.clear().

huangapple
  • 本文由 发表于 2020年1月4日 01:51:15
  • 转载请务必保留本文链接:https://go.coder-hub.com/59583105.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定