Build your app with a different Xcode version
In a cloud Team, ask an Agent which Xcode versions it can build with, and have it build your app or run its tests with the one you pick.
In a cloud Team, your app is built on a Mac builder in the cloud. The builders come in several environments, each with its own macOS and Xcode version. A build uses the default environment unless the Agent names another one. You can ask for another, for example to check that the app still builds with an older Xcode, or to try a newer one. Other scripts an Agent runs on a Mac builder, with runmacos, can pick an environment the same way.
See which versions you can use
Ask in the project’s chat, for example:
Which Xcode versions can you build with?- The Agent runs
runbuild --list-environments. - It tells you each environment it found: its name and its macOS and Xcode versions. The default comes first.
This page doesn’t list the versions. The Agent reads the current list each time you ask.
Build with the one you pick
Name the version you want, for example:
Build the app with the oldest Xcode on that list and put it in Preview.- The Agent starts the build with
--environmentand the environment you picked. The help says a build on another environment may take longer to start. - When the build is done, it’s like any other build. To open it in Preview, tap Reinstall (on iPhone, the app’s icon). See Run your app in Preview.
- If the build fails, the Agent tells you why, and you can ask it to fix the project for that Xcode.
The help puts it this way: “It picks what the app is built with, not where it runs.” The Preview devices stay the same. To try the app on another device, pick it in Preview’s device menu: see Run your app in Preview.
Use it for tests or a signed build
The same choice works when an Agent runs your app’s tests, and for a signed build for TestFlight and the App Store. Name the version when you ask, for example:
Run the tests with the newest Xcode you have.For test runs, see Have your Agents run your app’s tests. For signed builds, see Share a beta with TestFlight.
Later builds
The choice is for one build. Nothing in the project remembers it: every build an Agent starts without naming an environment uses the default. When you want that version again, name it each time you ask for a build.
In a local Team
A local Team builds with the Xcode on its Mac, so there’s no list to choose from. To build with another version, change the Xcode on that Mac. AirBuild’s Set Up This Mac shows the version in use, and its fix for a missing Xcode is to select one in Xcode ▸ Settings ▸ Locations ▸ Command Line Tools. See Choose where your Agents run.
Questions
The Agent says builder environments belong to cloud Teams.
The Agent says --environment takes an id from the list.
runbuild --list-environments.” The Agent didn’t give the option an environment’s ID. Ask it to list the environments again and build with the ID of one of them.