CloudKit stopped syncing on WatchOS

Hey,

I have an iOS/watchOS application that has been in the App Store since the beginning of last year (for reference: https://endsplus.com). Part of the functionality includes:

Create a Fixture on the Phone

  1. Create Fixture on iOs
  2. Fixture is saved to Core Data
  3. Core Data syncs with CloudKit
  4. WatchOs pulls down the record, updating a table of the same name
  5. I can show the Fixtures on the Watch.

Track a game on the Watch and then save it.

  1. Create a Game on WatchOS
  2. Game is saved to Core Data
  3. Core Data syncs with CloudKit
  4. iOS pulls down the record, updating a table of the same name
  5. I can show the games on the phone.

For reasons I am unable to work out syncing of core data tables between the phone and the watch has stopped working.

I know that the iOS coredata/cloudkit functionality is working as I can create a record on my physical phone, then run a simulator and log in with the same iCloud account and see the record.

But the functionality has stopped working for watchOS. I have added a new table to the Watch side that is not syncing to the Phone, but an existing table (Fixture) that has been working has also stopped syncing between the phone and the watch.

None of my Persistence/Core Data code has changed. My new table is associated with a Cloud Store, the same as my old table is.

What options are they available to me to try and debug this. The watchOs simulator doesn't seem to work with CloudKit, telling me it is not signed in.

I've tried looking at the CloudKit database logs, but obviously for security I can't see the data, but I can't see any errors from the watch.

I've uninstalled and re-installed the application (on the phone and the watch) numerous times, but that isn't working.

Does anyone have any ideas?

Thanks

What does a sysdiagnose from the watch tell you about your process' activity? i.e.

  1. Is it receiving push notifications?
  2. Are NSPersistentCloudKitContainer's activities being run?

Reviewing this WWDC session may be helpful for interpreting the logs: https://developer.apple.com/videos/play/wwdc2022/10119/

Thanks for the response. I’ll give that a go

I've managed to get the co-sysdiagnose file from the watch. I have extracted it, but there are a LOT of files there.

I looked in the sysdiagnose.log file for the word cloud but there was nothing about the container? Was that the correct file?

This is my first time doing this is there any documentation that explains what the files contain, how to read them, and which files I should look in to check for specific problems?

Thanks

I had a similar issue with CoreData CloudKit sync on my watchOS app. I was able to fix it by migrating my watch app from an extension to a single app using the upgrade process offered by Xcode. Note that while CoreData CloudKit syncing is now working correctly, the migration has created a separate issue with CoreLocation as highlighted in another forum discussion:

https://developer.apple.com/forums/thread/736785

CloudKit stopped syncing on WatchOS
 
 
Q