Hello,
I created my first iOS app with a realm database
The database is used offline on the Device
The app runs fine with the xcode simulator
Now I want to test the app on my ipad (plugged on the Mac)
The app is launching but the database is not reachable
The console of Xcode says :
RealDB is located: file:///var/mobile/Containers/Data/Application/FD338F70-94BF-4592-AF9A-A7429DF1/Documents/default.realm
Should I transfer the database manually ? in which folder ?
Thanks a lot for your answers !
Mat
Thanks for your answer
I created the realm database by myself
The user isn’t allowed to modify it.
For each device I want to simulate in Xcode, I need to copy the dataBase in the respective folder.
Xcode give me the way of the folder like this: RealmDB is located: file:///Users/Platypus/Library/Developer/CoreSimulator/Devices/0850306E-00AC-4EEA-AB14-C1ACA0/data/Containers/Data/Application/3F14D0BF-C230-4C56-8EAF-4DC36E6/Documents/default.realm
But when I want to install the app on my iPad with Xcode simulator, the console give me this way:
RealmDB is located: file:///var/mobile/Containers/Data/Application/FD338F70-94BF-4592-AF9A-A7429DF1/Documents/default.realm
I don’t know where the folder “var” is and I don’t know where I have to copy the dataBase.
I don’t even know if this folder is on the mac or on the iPad!
If you’re Bundling your Realm database with the app, then it’s not stored on disk as a separate file.
It’s a read only database that exists within the app bundle. In that case it wouldn’t need to be moved or copied as your code reads it directly from the bundle.