英文:
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()
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论