Right-click the downloaded file and "Show Package Contents." You'll find your Realm files under AppData/Documents/mongodb-realm//?. Note that you can only access the containers for apps that you've built and installed through Xcode, not ones you've installed through the App Store. Open the Xcode device manager-"Window/Devices and Simulators." Find your device and app, then download the container: Once connected, you can use Xcode to download a copy of the "Container" for your app. You need to connect your iOS device to your Mac, agree to trust the computer, etc. What we can do is download a copy of your app's Realm files from your iOS device to your laptop. Unfortunately, you can't use Realm Studio to interact with live Realm files on a real iOS device. #Track Down Realm Data Files – Real iOS Devices Then click on "Realms," find the file you need, and then double-click it to open it in Realm Studio. The nice thing about this approach is that you only need to create the search once. You'll most often be looking for the most recent one. Open Finder in that folder: open ~/Library/Developer/CoreSimulator/Devices and then create a "saved search" so that you can always find all of your realm files. Less scientific but simpler is to take advantage of the fact that the data files will always be of type realm and located somewhere under ~/Library/Developer/CoreSimulator/Devices.
This is the code to add to your app once you've opened your realm – realm: Don't worry if you're not explicitly opening your Realm(s) in your code (e.g., if you're using the default realm) as I'll cover the file search approach soon. While my app's in development, I'll normally print the location of a Realm's file whenever I open it. The scientific way to find the file's location is to add some extra code to your app or to use a breakpoint. They're typically somewhere along the lines of ~/Library/Developer/CoreSimulator/Devices/?/data/Containers/Data/Application/?/Documents/mongodb-realm/?/?/?.realm. If you're running your app in one of Xcode's simulators, then the Realm files are stored in your Mac's file system.
#Track Down Realm Data Files – Xcode Simulator Where am I supposed to find my Realm file? I cover that in the next section. There's a single button letting me "Open Realm file," and when I click on it, I get a file explorer where I can browse my laptop's file system. If you don't already have Realm Studio 10.1.0+ installed, then download it here and install.īut, when you open the app, you're greeted by this: If you have 10.1.0 installed, then that should work too. I'm using Realm Studio 10.1.1 to create this article.