Problem 1: NSPersistentCloudKitContainer doesn't seem to work on simulator Solution: Use device, haven't found a way to make it work on the simulator. Problem2 When using CloudKit APIs (not NSPersistentCloudKitContainer) on the simulator I was getting CKError.notAuthenticated even though I had signed into iCloud on the simulator Root cause This happens when 2FA was enabled on the iCloud account but the 2FA code was asked on the simulator Solution Go to https://appleid.apple.com/, select devices on the sidebar Remove simulator (I found 2 simulators, removed both) Reset Xcode simulator Log into iCloud on the simulator Run the app Hopefully that should work.
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags: