Author
Patricio AguirrePatricio Aguirre works as a developer at Moove It.
Overview
Apple launched Xcode Cloud at WWDC21, which is a cloud-based continuous integration and delivery (CI/CD) solution to assist developers in developing, building, testing, and distributing applications for any of Apple’s operating systems by an Apple managed service that runs on its infrastructure, rather than on a developer’s machine.
Xcode Cloud is a significant advancement for Apple’s IDE, as it uses the power of the cloud to free up developer’s laptops from resource-intensive tasks.
One of the most difficult aspects of developing an iOS or macOS application is ensuring that it will function smoothly on the huge range of Apple hardware available. Users will be able to conduct those various tests in parallel to Apple infrastructure, which is beyond the capabilities of laptop-based testing tools. The results of builds and tests and feedback on crashes are presented within Xcode itself.
Xcode Cloud is based on Git and requires your code to be on GitHub, GitLab, or BitBucket. The upcoming version of Apple’s official IDE, Xcode 13, embraces collaboration using pull requests (PR) and allows developers to create, view, and comment on PRs, as well as merge changes into their codebase. Xcode Cloud is also able to manage dependencies and supports custom build scripts to perform a specific task at a designated time.
There are two places to take advantage of Xcode Cloud functionality: the Xcode application and the App Store Connect website.
At the time this article is being written, Xcode Cloud is only available as a beta to a subset of Apple developers, and pricing information has not been released but Apple promised that more information will be shared with developers this fall.
Key features
Easy setup: Because it’s integrated with Xcode, a developer can set up and start building most apps in Xcode Cloud in just a few minutes. The build status and reports are displayed in Xcode immediately after the build finishes.
Build in the cloud: Xcode Cloud workflows can automatically build your app in the cloud, eliminating the need for dedicated build infrastructure.
Continuous Delivery: When Xcode Cloud verifies a change to your code, it can automatically deliver a new version of your app to testers with TestFlight or make a new version available for release with App Store Connect.
Parallel testing: Test a wide range of device configurations, Xcode Cloud allocates resources in parallel to quickly complete the testing job while you and your Mac keep coding.
Notifications: Xcode Cloud can be configured to integrate with third-party services and send notifications when some events occur, for example, when the build of an application was successful.
Team Collaboration: If you develop code as a team or work on several changes simultaneously, it’s common to use separate branches for each change and then create pull requests (PRs) to receive code reviews from your peers. With Xcode 13 and Xcode Cloud, you can create, view, and comment on PRs, and merge changes into your codebase if you host your Git repository with a platform like GitHub or Bitbucket.
Security and privacy: Xcode Cloud was designed to protect your projects and your privacy, with all data encrypted at rest and access protected by two-factor authentication. Source code is only accessed for builds and the ephemeral build environments are destroyed when your build completes.
Requirements
Xcode Cloud is currently in beta, and to use it you must be enrolled in the Apple developer program. Your Apple ID must be added to Xcode and you will need to have an app record in App store connect (or have the required role or permission to create one). You must use an Xcode project or workspace with a shared scheme and have enabled the archive action for the scheme that builds your app or framework.
Xcode Cloud works with the new Xcode build system; dependencies and additional third-party tools will need to be made available to Xcode Cloud. This will require either pulling these dependencies into your repository directly or granting access to those dependencies. Automatic code signing and Git source control are also required to use Xcode Cloud.
We are definitely gonna try it, what about you?
Sources
- Build artifacts from a successful run in Xcode Cloud from Meet Xcode Cloud session at WWDC21
- Adding automatic build distribution to internal testers as post-action from Explore Xcode Cloud Workflows session at WWDC21