How to view data stored in Core Data?

前端 未结 11 651
醉酒成梦
醉酒成梦 2020-12-01 01:51

I\'m creating a Core Data model for my application. I would like to be able to look inside it to see what I have stored in there.

Is there an easier way tha

相关标签:
11条回答
  • 2020-12-01 02:22

    I found a free version here:

    http://sourceforge.net/projects/sqlitebrowser/files/sqlitebrowser/2.0%20beta1/sqlitebrowser_200_b1_osx.zip/download

    0 讨论(0)
  • 2020-12-01 02:24

    Update to this thread, The iphone simulator location has been moved to a different location in Xcode7 and Xcode8. It is now in:

    ~/Library/Developer/CoreSimulator/...

    where ~ is your home directory.

    Any of the previous solutions will still work, but you won't be able to find the correct folder if you use the previous links.

    0 讨论(0)
  • 2020-12-01 02:24

    Here is the full path, apparently it changed since gerry3's answer

    ~/Library/Application Support/iPhone Simulator/<Simulator>/Applications/<ApplicationID>/Documents/<NAME>.sqlite
    

    So a correct path would like this:

    ~/Library/Application Support/iPhone Simulator/7.1-64/Applications/C1F3C2E5-987A-4DF7-91EF-955AE6E52621/Documents/TestApp.sqlite
    
    0 讨论(0)
  • 2020-12-01 02:25

    I created a macOS app to browse your Core Data content. It hides Core Data implementation as you see when you use a SQLite browser. Also you can list all your latest run apps and simulators, with this you can easily find the app you are looking for. More info here:

    http://www.microedition.biz/simMagnifier

    It has other features like access Simulator's folders such as Documents, Application Support, etc. You can check the content of NSUserDefaults too.

    The app is not free sorry! but at least you have a 7 days trial.

    0 讨论(0)
  • 2020-12-01 02:30

    Once your app has run in the simulator and created the persistent store file, you can find the file in your app's Documents directory.

    Your app data will be folder inside (~ is your home directory):

    ~/Library/Developer/CoreSimulator/<device>

    In versions prior to XCode 6, the path was:

    ~/Library/Application Support/iPhone Simulator/User/Applications/

    I sort by "Date Modified" to find the app that I just built.

    For viewing a SQLite file, check out Base and/or Core Data Editor.

    0 讨论(0)
  • 2020-12-01 02:34

    Core Data Lab is a dedicated Core Data viewer that offers everything to view and analyze the Core Data database of your app, like automatic search for databases, data change tracker, simulator browser, a predicate editor, data editor, a built-in web and image content viewer, and much more.

    Info page: https://betamagic.nl/products/coredatalab.html

    Free 14-trial: https://betamagic.nl/downloads/Core%20Data%20Lab%20Trial.zip

    Diclaimer: I'm the creator of this tool.

    0 讨论(0)
提交回复
热议问题