How can I set TestFlight test notes for XCode Cloud builds?

By default, Xcode Cloud workflow provides no test notes for TestFlight uploads. I'd like to have string with git commit message and git commit hash instead of "No test notes" message.

Is it possible?

Post not yet marked as solved Up vote post of Kuznets_lex Down vote post of Kuznets_lex
8.4k views

Replies

I'm wondering the same thing! Xcode Cloud seems great, but we need some way of populating the release notes in TestFlight. I have to believe there is a way.

  • Yes, I agree. It could be grate to have a possibility to customise the "What to test" section automatically.

Add a Comment

I am also in same situation and could not find a way to add Release notes.

I've been wanting that since they first made Xcode Cloud available. It'd save a lot of time!

  1. Connect to appstoreconnect.com
  2. Select your app
  3. Select TestFlight tab
  4. Edit Test Notes and they will appear in What to Test.

I would love to be able to do this automatically!

It would be a huge timesaver if this could be automated.

Yes, you can set the release note for a build in Xcode Cloud directly from the build process itself.

To set the release note for a build in Xcode Cloud, you can use the xcodebuild command-line tool, which is included in Xcode. When you run xcodebuild to create an archive, you can pass the XCODE_CLOUD_BUILD_NOTES environment variable to set the release notes for the build.

Here's an example command to create an archive with a release note using xcodebuild: xcodebuild archive -workspace MyWorkspace.xcworkspace -scheme MyScheme -archivePath MyArchive.xcarchive XCODE_CLOUD_BUILD_NOTES="This is my release note"

In this example, the XCODE_CLOUD_BUILD_NOTES environment variable is set to "This is my release note".

This will be the release note that appears in the build details in Xcode Cloud.

Note that you can also set the XCODE_CLOUD_BUILD_NOTES environment variable in Xcode itself, by adding it to the "Environment Variables" section of your Xcode scheme's run configuration.

Add a Comment

Hey @denismartin would you mind to explain where this command should be run? Build phase script run, CI script (pre or post) or where?

Add a Comment

@hjupter have you found the solution ?

Add a Comment

Automating the release notes is indeed important, pitty this one haven't was addressed yet

I think this is the solution you are looking for: https://developer.apple.com/documentation/xcode/including-notes-for-testers-with-a-beta-release-of-your-app

Basically you have to create a text file in the following location: MyApp > TestFlight > WhatToTest.en-US.txt *You can create various localized versions if you want the notes to be available in other languages by replacing the locale code in the filename.

To automate it, you will want to run a script in the ci_scripts/ci_post_clone.sh file that creates/updates that text file with your desired notes. I don't think you will need to actually commit those changes since Xcode Cloud has already checked out your repository, but not 100% sure.

I haven't verified this all works yet, but I am about to start testing it out for our nightly QA builds by generating that file with the last 24hrs worth of commit messages. I'll post my results here once I go through the whole flow though.

  • This seems like a great idea! Did you have any luck?

Add a Comment

@metolius Yup, it worked for us.

@someuser321123 Can you give more information of how would your ci_post_clone.sh file contain. This is not working for me after following the custom script here https://developer.apple.com/documentation/xcode/including-notes-for-testers-with-a-beta-release-of-your-app#Write-a-script-to-generate-content-dynamically

This is the log


Run ci_post_xcodebuild.sh script
Run command: 'cd /Volumes/workspace/repository/ci_scripts && CI_XCODEBUILD_EXIT_CODE=0 /bin/zsh /Volumes/workspace/repository/ci_scripts/ci_post_xcodebuild.sh'

Command executed successfully
Passed
No “What to test” notes files found at /Volumes/workspace/repository

Hi! I want to share my solution, initially, I was using the example script provided by Apple, but I encountered some problems. I think the problem is the ! (exclamation mark) in the example script.

Here is the revised script that worked for me:

if [[ -d "$CI_APP_STORE_SIGNED_APP_PATH" ]]; then
    git fetch --deepen 1 && git log -1 --pretty=format:"%s" | cat > ../TestFlight/WhatToTest.en-US.txt
fi