Getting Started with Xcode Cloud
Learn how to use Xcode Cloud to test and deploy your app on TestFlight. By Josh Berlin.
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress, bookmark, personalise your learner profile and more!
Create accountAlready a member of Kodeco? Sign in
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress, bookmark, personalise your learner profile and more!
Create accountAlready a member of Kodeco? Sign in
Contents
Creating a Workflow to Make TestFlight Builds
Xcode Cloud is a perfect match for TestFlight. Apple made it easy for developers to deploy builds to their teams with Xcode Cloud.
In this section, you’ll create a workflow to deploy a build to internal testers in TestFlight any time you push changes to the main branch. Before you start, you’ll need to create a group of internal testers in App Store Connect. Open a browser and navigate to your app in App Store Connect. Select the TestFlight tab.
The Internal Testing section on the left sidebar is empty. Click the + next to Internal Testing to add a new group.
Enter Internal Testers as the name for your group. Leave Enable automatic distribution selected so the builds distribute to your testers without any extra steps. Click Create to create your new group.
Click the + next to Testers (0) and add yourself as a tester. Great! You now have a group of testers for your Xcode Cloud workflow. Now you’re ready to open Xcode to set up your new workflow.
Navigate to the Report Navigator. Select the Cloud tab. This time, you’ll create a new workflow just for your internal testers. Click the circle button at the bottom left and select Create Workflow.
Select your app product and click Next.
First, change the workflow Name to TestFlight
. Next, check the Restrict Editing check box.
Apple requires restricted editing for any workflows with external deployments.
Next, add an Archive action by clicking the + next to Actions and selecting Archive. Xcode Cloud adds an archive action for iOS by default.
By default, the Platform is set to iOS, and the Scheme is set to Coffee — which is precisely what you want. For this workflow, you’ll deploy an app to your internal testers. Change the Deployment Preparation to TestFlight (Internal Testing Only).
Before starting an Xcode Cloud build with your new workflow, you’ll create a Post-Actions step to deploy the TestFlight build to a group of internal testers. Xcode Cloud runs the Post-Actions steps after the iOS archive is complete.
Click the + next to Post-Actions and select TestFlight Internal Testing. Xcode Cloud adds the post-action, but displays a red X. The post-action does not contain any beta groups, so the action displays an error.
Click the + in the Groups section, and select your new Internal Testers group. Your group has one tester — you!
Click Add to add your group to the internal TestFlight deployment.
Now, the workflow deploys a build to the Internal Testers group when the workflow runs. Click Save to create your new workflow.
Instead of pushing new code, you’ll manually run the workflow to test the deployment. Right-click your new TestFlight workflow and select Start Build.
Since you started the build manually, you’ll need to select a branch. Xcode Cloud displays a window for you to select the branch.
Switch the filter from Mine to All to display all the branches.
Select the main
branch, and click Start Build. Now, sit back and relax while Xcode Cloud does all the work to create your new TestFlight build.
After Xcode Cloud completes the build, you’ll receive an invite email from TestFlight. Accept the invite, and install your new app!
Where to Go From Here?
Download the completed project files by clicking the Download Materials button at the top or bottom of the tutorial.
Apple’s Xcode Cloud documentation is a good place to go if you’d like to learn more. You’ll find an article about setting up Xcode Cloud for your team. You’ll find another article about connecting Xcode Cloud to Slack.
We hope you enjoyed this tutorial. If you have any questions or comments, please join the forum discussion below!