Export Data from CloudKit
Asked Answered
E

2

8

I am interacting with the cloudkit dashboard and looking at data collected by my app.

How can I export all the data from the dashboard (data-> csv or json) so that I can do some analytics on it?

Thanks!

Excuse answered 27/7, 2016 at 14:50 Comment(5)
#38279509Orit
The link above doesn't have information OP asked, which is reasonable: so far in Sept 2017 I don't think there's a way to export data as a way you desired. The only viable option would be writing your own exporting app. The link does contain information about how to do that.Headdress
As of 2018, it's still not possible to export your data from CloudKit directly. But querying all your records and writing the results to a CSV file is fairly easy to do in Swift.Eckman
Still the same situation now, in mid-February 2019...Chkalov
And now it's March 2020! I think @Sascha's comment may be correct. Time to roll our own.Orit
T
2

I don't think Apple will ever provide an export feature. The system is capable to collecting more than 40 events per second. This could very quickly be massive amount of data. Instead there is a possibility to query the system via an API, so you can build an external website to query your results and possibly export your data from there.

Tatianatatianas answered 10/10, 2019 at 5:47 Comment(0)
P
0

Here is how I export my iCloud data on my Mac using this wonderful DB browser called DB Browser for SQLite.

I run my app on Simulator. The app syncs with iCloud and downloads both public and private databases. Once the sync is complete I have all the data on my simulator. The data is essentially in SQlite format stored in a file which I locate using command in my app:

print("\(NSHomeDirectory())/Library/Application Support/")

and the result is something like:

/Users/zeeshan/Library/Developer/CoreSimulator/Devices/34A4ADC6-1B67-4339-B67F-C4B6DDA46B07/data/Containers/Data/Application/E8F9486B-B40B-47D0-84C1-1043241E68EA/Library/Application Support/

And here .sqlite file is saved. In my case I have two files, private.sqlie and public.sqlite which is how I have named them in my code.

Now I open these files in DB Browser for SQLite. And then rest is simple, just export the opened file as you would do for any SQlite file.

Attached are the screenshots.

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

Protractile answered 4/12, 2022 at 20:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.