Simulator won't sync with CloudKit since Xcode 14

I have a few apps that use Core Data & CloudKit to sync data to multiple devices. Everything was fine until I updated to Xcode 14. Now, although the apps work on an actual device, in the simulator, I get errors about "Failed to sync user keys" and it won't sync anything.

I haven't changed the code at all. It just suddenly won't work in the simulator. Since it does this for all apps, I have to believe it's something changed with the simulator?

2022-09-13 12:47:26.766223-0400 Time Since[8061:88974] [error] error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _performSetupRequest:]_block_invoke(1134): <NSCloudKitMirroringDelegate: 0x600003b540e0>: Failed to set up CloudKit integration for store: <NSSQLCore: 0x1219071d0> (URL: file:///Users/jon/Library/Developer/CoreSimulator/Devices/1990772E-CDF1-4A58-B454-E09D327B2182/data/Containers/Data/Application/3314EA95-4D86-4053-84B3-F1523A57E204/Library/Application%20Support/TimeSince.sqlite)
<CKError 0x600000cc1e60: "Partial Failure" (2/1011); "Failed to modify some record zones"; partial errors: {
	com.apple.coredata.cloudkit.zone:__defaultOwner__ = <CKError 0x600000cc2160: "Internal Error" (1/5000); "Failed to sync user keys">
}>

Post not yet marked as solved Up vote post of bss Down vote post of bss
1.9k views

Replies

I pulled down Xcode 13, and verified CloudKit syncing works correctly in the simulator, so this appears to be something specific to Xcode 14.

Post not yet marked as solved Up vote reply of bss Down vote reply of bss

Same issue here.

Had this problem all Summer. Still in GM. CloudKit has been non-functional on Simulator all Summer on Xcode 14 including the RC of Xcode 14. Today in particular, CloudKit production has also been mostly down, but that's on normal devices.

I don't know what happened, but I'm now getting the same errors with Xcode 13 so CloudKit won't work in any simulator. I opened a report and got a request to include a simctl diagnose, which I did, but haven't heard anything back since.

Post not yet marked as solved Up vote reply of bss Down vote reply of bss

I have the same issue using Xcode 14.0.1, I downloaded Xcode 13 and it didn't work either. Only debugging with a physical device works

I found out it works in simulator only if you log in with a sandbox user id ( tester account ) - same user type one would use for in app purchase testing.

The weird thing is that it’s using a sandbox version of the store ( not the development one) and there’s no option in CloudKit database viewer to see that sandbox store …

I hope it goes back to working as I like having my phone app and simulator app having the same data .

I’m sure you know it’s works fine on the device - just in case you are blocked by it in any way.

  • Yeah I know it works on a physical device, thanks. Interesting on the sandbox user id. Like you, I want the same data on device and simulator. Frustrating!

Add a Comment

Well this is interesting. I just created another Apple ID account, and signed in with that, and I don't get these errors anymore. So I guess it's something about my Apple ID. But I don't have the slightest idea how to fix that.

Edit: one thing I notice about the Apple ID that doesn't work: when I sign in on the simulator, the "Sign Out" button in iCloud is disabled. I don't know if that's relevant.

I had the same problem with Xcode 14 simulators. I managed to get access to iCloud by logging out from iCloud and logging in again with the same apple id.

completly blocked from getting files into the simulator, this included. im on a m2 and i bet all of us having problems are apple silicone users. they are not supporting this transition well. its been how long? still like pulling teeth developing on this m2 mac mini. lots of simulator problems get it together