Andrei Matei
Andrei Matei

Reputation: 1079

Run macOS 11 app with different iCloud/CloudKit user

I'm developing a multi platform app that has a public iOS part and a private macOS interface for feeding public CloudKit data.

Is there a way to run the app with a different iCloud user? Currently it's doing all CloudKit sync using my iCloud ID around in Mac Settings. I want to have a singe user with RW access to the public database.

I could create new Mac user and sign in there, but its an awful amount of work and data duplication only to run a app.

Any other way/hack?

Upvotes: 1

Views: 194

Answers (1)

Clifton Labrum
Clifton Labrum

Reputation: 14068

CloudKit is always going to use the signed-in user on the device. So to feed the data with the Mac app, it's going to use your iCloud ID on the Mac.

I can think of a few workarounds:

  1. Create a separate Mac user (as you mentioned) and sign in there to do your data feed work. You can sync your Xcode project between that user account and your current one with iCloud Drive or Dropbox. It should be pretty simple with fast user switching on the Mac.
  2. Do your data feeding in an iOS app instead. When you launch that app in the iOS Simulator, you can sign in with any iCloud user.
  3. Build a web app that uses the CloudKit Web Services API and use whatever iCloud user you want in a web browser.

I'm having trouble understanding the problem with just using your main iCloud user, though. When you write data to the public database with your iCloud account, I don't know of any security or privacy risks with that happening with your iCloud account.

Upvotes: 0

Related Questions