Xcode Cloud – Slack Notifications

Table of Contents

  • What are Xcode Cloud – Slack Notifications?
  • Creating the Workflow
  • Connecting Xcode with Slack
    • Setup Slack Notifications with Post-Action
      • Adding Xcode Cloud bot to Slack

 

Follow this tutorial on YouTube!

 

What is Xcode Cloud?

Xcode Cloud is Apple’s service that simplifies app development and enhances CI/CD. It seamlessly integrates with Xcode, offering automated testing and cloud-based build and distribution services. Developers benefit from improved productivity and efficient CI/CD workflows.

Today, we’ll be going over adding Slack Notifications to an existing Xcode Cloud workflow.

I highly recommend checking out this video, Intro to Xcode Cloud 2023 , to learn how to set up an Xcode Cloud Workflow with a sample project if you have not set one up previously.

What are Xcode Cloud – Slack Notifications?

Xcode Cloud Slack notifications allow us to receive real-time updates and notifications about the status of our Xcode Cloud Workflow. These include notifications for successful builds, test failures, and many other important events related to the app development process. This, in turn, informs our developers of any issues that may have happened during deployment as well as QA testers for when the build is ready to test straight from the chats that are used for your organization’s communication platform.

Xcode Cloud provides us an out-of-the-box solution that will help us get the workflow setup!

Let’s get started!

Xcode Cloud Workflow

The build configuration for Xcode Cloud is all through Xcode Cloud Workflows. The first step to setting up Slack Notifications is to add steps in the Xcode Cloud Workflow that will allow a notification to be sent to a specific Slack Channel.

  1. Open the Xcode Cloud Workflow Project that can be found here, or use one of your existing Xcode project in Xcode 15.0.

 

2. Once the project is open, navigate to the right most tab in the left menu column to see the Xcode Cloud and Local Build menu tabs.

If Xcode Cloud has not been setup, feel free to follow the guide mentioned earlier to set up the Default workflow and deployment.

Setup Slack Notifications on an Existing Workflow

Now, let’s set up Slack Notifications from an existing workflow.

Here we have a Default Workflow that is building and deploying. We are going to add the Slack Notifications Post Action to this existing workflow.

  1. From the Navigator Menu on the left hand side, navigate to the Reports tab (the last tab), where you can access the Xcode Cloud Workflows that we set up in the previous section.
  2. Observe the Default workflow that is setup there. If the Default workflow hasn’t been set up yet, this article will walk you through setting up the Default workflow for building as well as pushing builds to Testflight for Internal Testing.

 

3. Right-Click and select “Edit Workflow”

4. We will now add a new Post-Action to notify us when the workflow has been successfully completed.

 

4. After the Post-Action has been created, we can see the Post-Action setup menu that allows us to customize the Post-Action Build event that the notification can be triggered on, as well as the system we would like the notification message to be sent to.

We can choose which events we would like the Post-Action to be triggered by from the drop-downs:

  • Build Success
  • Build Failure

By default they are selected for All but can be targeted for:

  • All
  • Only Fixes
  • Don’t Notify
6. From here, we can add a Slack Notification Channel. Xcode will give a prompt to select a team’s workspace.

Connecting Xcode Cloud to Slack

Now let’s set up Slack Notifications for a new Xcode Cloud Workflow.

  1. Select “Connect” when prompted. After this, the Xcode Cloud + Slack Integration process should begin.
  2. An App Store Connect window will open prompting you to sign in.
3. After signing in, you will be prompted to sign in to the Slack Workspace you would like to connect.

This can be done via Slack url or Find your workspace. Follow the Slack Sign In Flow until you are prompted to select the workspace you would like to connect

4. Select the workspace to connect to Xcode Cloud. When selecting Open there will be a prompt that will ask for permission to allow Xcode Cloud to perform actions.
5. After selecting Allow, there will be a prompt to open Xcode and select a channel that is already in your Slack Workspace to post the notifications to. In our case, we will be adding them to the #dev-team channel.
6. From here, we can add a Slack Notification Channel. Xcode will give a prompt to select a team’s workspace.
7. Let’s save all of the changes in our Workflow now by clicking the button in the bottom right corner.

Back in Slack itself, you should be seeing a new app called Xcode Cloud. This is the app that will be delivering the notifications from Xcode Cloud to Slack.

8. Let’s go ahead and Start Build with our new workflow setup.
9. Select the Default workflow to which we had added the Slack Notifications previously.
10. Select the branch to be targeted and hit Start Build

Our Workflow should be started now. We’ll have to wait until all steps are completed in the Workflow before proceeding further.

 

After the build succeeds and has been set up correctly, you should see a notification of the build! With the notification, there will be a button to View Build Report that will open in AppStore Connect to the Xcode Cloud Build Report.


You should have Slack Notifications fully hooked up now, increasing your team’s visibility of your app and build jobs, and saving countless hours in the process!

Leave a Reply

Your email address will not be published. Required fields are marked *