Realm for React-native. reset database
Using Android Emulator Genymotion
In your app
const realm = await getRealm();
console.log(realm.path);
copy the result from console.log () which will be the path of your .realm file.
In (Cmd or Terminal)
adb shell rm /data/data/com.example.package/files/default.realm
You can just delete the app from the device or the simulator to reset the Realm.
It depends, if you are using Genymotion (for ANDROID simulation) you would use a different approach. Please note that for both approaches (XCODE & GENYMOTION) you will be reseting the simulator
to factory settings...
Here are the steps I used to do this for Android :
Open GenyMotion Manager
Select the
Virtual Device
(e.g. Samung Galaxy S6).If you are on OSX. Press CMD + F (reverts to factory setting)
If you are on WINDOWS. Press CTRL + F (reverts to factory setting)
You can also do this by RightClick action on the item and selecting
(Reset this virtual device to factory state)
on your device.Enjoy!