React-Native AsyncStorage使用iPhone Simulator在哪里将数据保存在磁盘上?

Kev*_*off 4 ios-simulator react-native asyncstorage

使用IOS Simulator,React-Native AsyncStorage在哪里将数据保存在磁盘上?

我正在使用IOS Simulator 10.0版并运行IOS 10.2和react-native 0.40.0

小智 5

React Native异步存储数据位于应用程序沙箱的Documents文件夹内。对于本机0.40.0,它是Documents/RCTAsyncLocalStorage_V1/manifest.json

iOS模拟器(Xcode 8.2)的沙箱文件夹的路径为: ~/Library/Developer/CoreSimulator/Devices/{DEVICE_ID}/data/Containers/Data/Application/{APP_ID}

要找到DEVICE_ID您可以xcrun simctl list从终端使用。由于您的应用程序APP_ID在每次运行时都是新的,因此您不容易找到它。我简单列出了Application中的所有文件,并获取了最新更新。每次运行后,请参阅Xcode 6在iOS8模拟器中不断重命名我的应用程序目录。和其他解决方案相关。

  • 这可能有点晚了 - 但对于@AmitBravo - 不要在 AsyncStorage 内存储任何敏感信息。将敏感详细信息存储在钥匙串内(https://github.com/oblador/react-native-keychain) - 将其他所有内容存储在 AsyncStorage 内。 (2认同)