Automating CloudKit Development

Learn about CloudKit tools and authentication considerations for automating processes to support local integration testing and continuous integration (CI) systems.

CloudKit automation tools are designed to help you build better CloudKit-enabled applications by providing test automation functionality. With CloudKit automation tools, you or your team members can:

  • Reset Sandbox databases to the production configuration.
  • Apply a CloudKit schema file to Sandbox databases. Get details on CloudKit schema files.
  • Hydrate databases with test data.
  • Run integration tests from Xcode or your CI system.


This macOS app gives you access to features provided in the CloudKit Console API, facilitating CloudKit setup operations for local development and integration testing. Learn more about using cktool


This JavaScript library includes TypeScript type declarations to allow for development of interactive and scripted CloudKit setup operations embedded in your own tools. View documentation for CKTool JS


To use CloudKit automation tools, you will need to use one of the authentication mechanisms described in the table below.

Management token

A CloudKit management token is scoped to a team and user, and allows access to the CloudKit management APIs. The management tokens have a default lifespan of one year and can be revoked from the Settings section of CloudKit Dashboard.

User token

A user token is scoped to a user. It’s created using an interactive login and cannot be automated. The user token provides the ability to read and write to private and shared databases. However user token are short lived and may require re-authentication during a session.

Management token User token
Bound to team
Bound to container
Bound to environment
Bound to user
Can query public database
Can query private database
Can query shared database
Can access management API