I am building an app but testing it on my iPhone. The app is plugged into my computer and running from XCode. Is there anyway to see the data in Core Data that the app has generated? I see all the posts about the simulator and the files generated. I am trying to use DB Browser too.
Core Data is a popular choice for implementing data persistence in iOS and OS X applications. Usually, CoreData utilizes an embedded SQLite database. Since iOS 8.3, it’s impossible to access arbitrary data in an application’s sandbox.
Use Core Data to save your application’s permanent data for offline use, to cache temporary data, and to add undo functionality to your app on a single device. To sync data across multiple devices in a single iCloud account, Core Data automatically mirrors your schema to a CloudKit container.
The first step is to create a new project based on the Single View App template. Next, name the project, select your team name, and select “Use Core Data” and “Use CloudKit” checkboxes. Xcode generates some code in the AppDelegate.swift file to initialize the Core Data stack with this new class since iOS 13: NSPersistentCloudKitContainer.
With data being shifted to devices, we need a way to ensure encryption of data stored in db files. One of the best ways of encrypting CoreData is by using SQLCipher through Encrypted-Core-Data. I found Encrypted-CoreData-Store best and easiest to implement in an iOS Project.
Step1:
Plug your device and open Devices and Simulators:
Step 2:
Select your app from installed Apps:
Step 3:
Press the settings icon and download container
Step 4:
Select the downloaded .xcappdata and show package contents:
Step 5:
Find the .sqlite file inside and open it using any sqlite reader like DB Browser
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With