Where Does Realm Store Database Files?
Realm keeps each database in realm files inside the app's files directory. The default file is literally named default.realm.
Last updated
Realm's storage model is refreshingly literal: one database, one file, with realm extensions. Unless the app configured otherwise, that file is called default.realm and sits in the app's files directory. Synced Realms keep a local copy in the same place, so offline data and server data share the path.
Companion lock and note files sit beside the main file and must travel with it during manual copies. Realm Studio opens any copy for inspection. Device sync adds server side state, but the local file remains the debugging entry point when data looks wrong.
Where Realm stores this, by platform
/data/data/[package]/files/default.realm
Default realm file in app files. Synced Realms cache locally here too. Copy the main file with its companions while the app is closed, then open the copy in Realm Studio.
App Container/Documents/default.realm
App container documents or files directory depending on configuration. Pull from simulator builds or device backups for inspection.
Frequently asked questions
How do I inspect a Realm file?
Open the copy in Realm Studio on desktop. It reads and edits realm files with a proper browser, which beats printf debugging data issues. Copy the file off device first rather than opening it in place.
Can I change where the file goes?
Pass an explicit path in the configuration when opening the Realm. Everything else follows the default. Migrating means copying the file to the new path and pointing config there.
Notice an outdated path? Let us know.