CloudKit:将容器环境从开发转换为生产环境

时间:2022-11-26 23:41:32

I'm building a test tool to verify content in CloudKit, but I want to be able to select the container's environment.

我正在构建一个测试工具来验证CloudKit中的内容,但是我希望能够选择容器的环境。

On iOS, you can select either the "Development" or the "Production" environment when you export your app for ad hoc testing, but you don't have that option on OS X. It always points to the "Development" environment.

在iOS中,你可以选择“开发”或“生产”环境,当你导出你的应用程序进行临时测试时,但是你在OS x上没有这个选项,它总是指向“开发”环境。

Anyone knows, if there is a programmatically way to set or select what container environment you want to work with, either on OS X or iOS?

任何人都知道,如果有一种编程方式来设置或选择您希望在OS X或iOS上使用的容器环境?

3 个解决方案

#1


5  

In the entitlements file, add in the row of com.apple.developer.icloud-container-environment and you can switch the value of that back and forth between Development and Production.

在应享权益文件中,添加com.apple.developer.icloud-container-environment的行,您可以在开发和生产之间来回切换该值。

CloudKit:将容器环境从开发转换为生产环境

#2


1  

UPDATE: this changed in later versions of CloudKit, please ignore this and see the accepted answer.

更新:这在CloudKit的后续版本中发生了更改,请忽略它并查看已接受的答案。

No, there is no way to do that.

不,那是不可能的。

While you can access the same container as your iOS app, you can only access the "Development" environment until you export your application as a Mac App to the App Store (which is probably not your goal for a test tool).

虽然可以访问与iOS应用程序相同的容器,但只能访问“开发”环境,直到将应用程序作为Mac应用程序导出到app Store(这可能不是测试工具的目标)。

The App Store application again would only be able to access the "Production" environment.

App Store应用程序再次只能访问“生产”环境。

There is no other API to access CloudKit containers in a specific environment.

在特定的环境中,没有其他API可以访问CloudKit容器。

#3


0  

I know this might be a bit late for those who posted but for others with the same problem, in the entitlement file change the com.apple.developer.icloud-container-environmentfrom Development to Production Then delete your app from your device so you get a clean build. When you run it, it should work. The key is to have a clean build.

我知道这对于那些发布的人来说可能有点晚了,但是对于其他有同样问题的人来说,在授权文件中改变com.apple.developer.icloud- containers -environment从开发到生产,然后从你的设备中删除你的应用,这样你就得到了一个干净的构建。当你运行它时,它应该会工作。关键是要有一个干净的构建。

#1


5  

In the entitlements file, add in the row of com.apple.developer.icloud-container-environment and you can switch the value of that back and forth between Development and Production.

在应享权益文件中,添加com.apple.developer.icloud-container-environment的行,您可以在开发和生产之间来回切换该值。

CloudKit:将容器环境从开发转换为生产环境

#2


1  

UPDATE: this changed in later versions of CloudKit, please ignore this and see the accepted answer.

更新:这在CloudKit的后续版本中发生了更改,请忽略它并查看已接受的答案。

No, there is no way to do that.

不,那是不可能的。

While you can access the same container as your iOS app, you can only access the "Development" environment until you export your application as a Mac App to the App Store (which is probably not your goal for a test tool).

虽然可以访问与iOS应用程序相同的容器,但只能访问“开发”环境,直到将应用程序作为Mac应用程序导出到app Store(这可能不是测试工具的目标)。

The App Store application again would only be able to access the "Production" environment.

App Store应用程序再次只能访问“生产”环境。

There is no other API to access CloudKit containers in a specific environment.

在特定的环境中,没有其他API可以访问CloudKit容器。

#3


0  

I know this might be a bit late for those who posted but for others with the same problem, in the entitlement file change the com.apple.developer.icloud-container-environmentfrom Development to Production Then delete your app from your device so you get a clean build. When you run it, it should work. The key is to have a clean build.

我知道这对于那些发布的人来说可能有点晚了,但是对于其他有同样问题的人来说,在授权文件中改变com.apple.developer.icloud- containers -environment从开发到生产,然后从你的设备中删除你的应用,这样你就得到了一个干净的构建。当你运行它时,它应该会工作。关键是要有一个干净的构建。