【发布时间】:2017-12-19 08:42:41
【问题描述】:
我想在我的 React Native App 上运行 Realm Studio。在这里的视频中,我看到了 Places.realm 文件,但我不知道我是否生成了这个文件? (https://realm.io/products/realm-studio/)
有人已经在 React Native 上使用 Realm 了吗?
谢谢!
【问题讨论】:
标签: reactjs react-native realm
我想在我的 React Native App 上运行 Realm Studio。在这里的视频中,我看到了 Places.realm 文件,但我不知道我是否生成了这个文件? (https://realm.io/products/realm-studio/)
有人已经在 React Native 上使用 Realm 了吗?
谢谢!
【问题讨论】:
标签: reactjs react-native realm
对于 iOS 模拟器:
将此代码放置在您的 RN 应用中的某个位置,以找出领域文件的位置。
import Realm from 'realm';
Realm.open({}).then((realm) => {
console.log('Realm is located at: ' + realm.path);
});
这将在控制台中打印默认领域文件的位置。
转到默认文件所在的目录(您可以使用终端cd 然后open)
该目录将包含一个或多个可以用 Realm Studio 打开的文件。一个文件将包含您从 RN 应用发送到 Realm DB 的数据。
参考:Doc
【讨论】:
如果您需要使用 Realm Studio 检查您的 Realm,您可以启用同步(请参阅 https://realm.io/docs/javascript/latest/api/Realm.html#~Configuration 中的属性 sync)并设置对象服务器 (https://realm.io/docs/get-started/installation/developer-edition/)。
另一种方法是使用 Chrome 并像使用任何其他 React Native 应用程序一样进行调试。
【讨论】: