I am having a problem testing a macOS CloudKit app.
When I archive and export the app, it runs as expected against CloudKit with no errors. But when I try to run the app from Xcode it gets authentication errors.
From Xocde, when checking account status the app reports CKAccountStatus.noAccount, "The user’s iCloud account is not available because no account information has been provided for this device. (3)"
From Xcode, if I still try to write to the public database the app reports "Not Authenticated" (9/1002); "CloudKit access was denied by user settings"; Retry after 3.0 seconds.
Oddly enough, If I leave the archived and exported app running, then try to debug a 2nd version of the app from Xcode, the 2nd debug version seems to work.
Is it possible to reliabily debug a macOS CloudKit app from Xcode? If so, any ideas what might be wrong in my case?
Environment:
High Sierra
Xcode Version 10.0 (10A254a)
Automatic code signing
Automatic provisioning
Deplyment target 10.13