Saving CloudKit Record "Not Authenticated" (9/1002)" "This request requires an authenticated account""
I got the same problem, which I was able to resolve by logging in to my iCloud account in the simulator (Settings > iCloud).
As of the latest Xcode, you can log in to your iCloud account in the simulator, and everything should work.
If you are having trouble logging in, try to go to iCloud.com on a desktop and log in there first. Once that is set up properly, then try in the simulator.
I'm seeing the same error. According to the discussion linked below the cause might be two-factor authentication.
https://discussions.apple.com/thread/6588883
Because folks might misinterpret the approved answer (as I did) here is a little more detail to get through this (you can use keyboard shortcuts but I am specifying menu selections for clarity):
- Run simulator (Xcode) - Run an app from Xcode in the simulator by selecting Product > Run
- App Home Screen (Simulator) - Within the simulator, navigate to the Home screen by selecting Hardware > Home
- Settings App (Simulator) - Find the settings app (gear), run it and select iCloud
- Authenticate (Simulator) - Enter your credentials and login (or re-login if your credentials have changed) to iCloud. Once you do this you can re-run your app and it should properly authenticate to iCloud
Once you do this you are good to go for future builds and runs.