Connecting to iCloud Acct from within Xcode

Is there a way to connect to iCloud inside your Xcode project using a different account than the one you set up on your Mac's System Preferences?


The one in my System Preferences has all my personal stuff in it and is a different account from my developer account.


The only thing I could get working is to set up a different user on my Mac where its iCloud account IS my developer account. But I have to log off one and log on the other and it is a major PAIN.


It would be nice if in Xcode, whilst developing your app you could pick your developer account for iCloud and use that!


Then (of course), if you used an Production app, it would use the account set up in System Preferences as usual.

Accepted Reply

I thought that, if you are in iOS, then the account is determined by the simulators - it can be anything you'd like.

Replies

>It would be nice if


Feel free to file an enhancement request via the bug reporter, link below, adding your report # to your thread for reference, thanks and good luck.

I thought that, if you are in iOS, then the account is determined by the simulators - it can be anything you'd like.

@PBK,


Initially, I thought you would be wrong, since clicking the [Cloudkit Dashboard] button occurs in Xcode, not in the simulator.


But, the actual databases (and their container) are not created until you run the app... and where do you run the app (at least to start with)... in the simulator!


So, before I had not bothered going into the Setup app in the Simulator and logging in (with my developer acct). This time I did.

  • Then I ran the app.
  • The container was created.
  • I ended the app (not sure if that matters).
  • I clicked the [Cloudkit Dashboard] button in Xcode.
  • I logged into the dashboard with my developer acct.
  • I could see that the container was created and that there was now a private db in addition to the public db.
  • I could successfully now add a new record type (to the private db) and fields to that record type and save it


Thanks for your help!