# appstore_distribute_build

> Send a build to TestFlight groups: wait for processing, answer export compliance, set What to Test, add the groups and submit for Beta App Review when needed.

Source: https://air.build/docs/mcp-tools/appstore_distribute_build/

Makes a build available to one or more TestFlight groups. In order, it:

1. finds the build: `buildId`, else the newest unexpired build with `buildNumber`, else the newest unexpired build;
2. waits while Apple is still processing it, for up to 10 minutes;
3. answers export compliance with `usesNonExemptEncryption` when the build has no answer yet;
4. sets What to Test in the app's primary language, when `whatToTest` is sent;
5. adds the build to the groups (internal groups that get every build already have it);
6. submits the build to Beta App Review when one of the groups is external and Apple says the build is ready for it.

Apple emails the testers. The tool does not upload builds, and does not invite testers: see [appstore_invite_testers](https://air.build/docs/mcp-tools/appstore_invite_testers/). If Apple is still processing after 10 minutes, the result says `done: false`: call again a few minutes later.

This tool can take minutes. It answers as a stream with progress when the client accepts one (see [Server and sign-in](https://air.build/docs/mcp-tools/server/#transport)).

| Read-only | Destructive | Idempotent |
| --- | --- | --- |
| No | No | Yes |

## Inputs

| Input | Type | Required | Default | What it does |
| --- | --- | --- | --- | --- |
| `teamId` | string (UUID) | yes | — | The Team, from [list_teams](https://air.build/docs/mcp-tools/list_teams/). |
| `projectId` | string (UUID) | this or `appId` | — | The Project whose app this is, from [list_projects](https://air.build/docs/mcp-tools/list_projects/): the usual way to name an app. The app is the one on App Store Connect with the bundle id the Project builds. When both are sent, `projectId` is used. |
| `appId` | string | this or `projectId` | — | An App Store Connect app id from [appstore_list_apps](https://air.build/docs/mcp-tools/appstore_list_apps/), for an app no Project builds. |
| `appleTeamId` | string (UUID) | no | every connected Apple team | One of the Team's Apple teams, from [appstore_list_apple_teams](https://air.build/docs/mcp-tools/appstore_list_apple_teams/). With `appId`, only this Apple team is searched for the app. With `projectId` it is not needed: the Project's app decides. |
| `buildId` | string | no | the newest build | A build id from [appstore_list_builds](https://air.build/docs/mcp-tools/appstore_list_builds/). |
| `buildNumber` | string | no | the newest build | The build number (`CFBundleVersion`), e.g. `42`, instead of `buildId`. |
| `groups` | array of strings, at least 1 | yes | — | The TestFlight groups, each by name (case does not matter) or `groupId` from [appstore_list_beta_groups](https://air.build/docs/mcp-tools/appstore_list_beta_groups/). |
| `whatToTest` | string, at most 4,000 characters | no | — | What testers should try in this build. |
| `usesNonExemptEncryption` | boolean | when the build has no answer | — | Export compliance: false for an app that uses only exempt encryption (HTTPS and the like), which is most apps. Only used when the build does not answer it itself. |

The checks every tool makes on its inputs are on [Server and sign-in](https://air.build/docs/mcp-tools/server/#errors).

## Result

A JSON object, as text and as `structuredContent`.

| Field | What |
| --- | --- |
| `build` | The build after the changes (fields as in [appstore_list_builds](https://air.build/docs/mcp-tools/appstore_list_builds/#result)) |
| `groups` | The groups (fields as in [appstore_list_beta_groups](https://air.build/docs/mcp-tools/appstore_list_beta_groups/#result)) |
| `betaReview` | With an external group: the Beta App Review state, e.g. `WAITING_FOR_REVIEW` when this call submitted it, or the build's current external state. Null with internal groups only |
| `done` | true when everything was done; false when Apple was still processing the build |
| `note` | Only with `done: false`: "Apple is still processing the build. Call again in a few minutes." |

```json
{
  "build": {
    "buildId": "00000000-0000-0000-0000-000000000000",
    "version": "1.2.0",
    "buildNumber": "42",
    "platform": "IOS",
    "uploadedAt": "2026-11-18T09:00:00Z",
    "processing": "VALID",
    "expired": false,
    "expiresAt": "2027-02-16T09:00:00Z",
    "usesNonExemptEncryption": false,
    "internalTesting": "IN_BETA_TESTING",
    "externalTesting": "READY_FOR_BETA_SUBMISSION"
  },
  "groups": [
    {
      "groupId": "00000000-0000-0000-0000-000000000000",
      "name": "Friends",
      "kind": "external",
      "allBuilds": false,
      "publicLink": "https://testflight.apple.com/join/XXXXXXXX",
      "publicLinkLimit": 100,
      "feedback": true
    }
  ],
  "betaReview": "WAITING_FOR_REVIEW",
  "done": true
}
```

## Errors

Each comes back as a tool error (`isError: true`). _Italic_ words stand for the values in the sentence. The errors every tool can return are on [Server and sign-in](https://air.build/docs/mcp-tools/server/#errors).

| Message | When | What to do |
| --- | --- | --- |
| No TestFlight group "_group_". The app's groups: _names_. | No group of the app has that name (case does not matter) or `groupId`. With no groups, the list reads "none — create one with appstore_create_beta_group" | Use a name from the sentence or from [appstore_list_beta_groups](https://air.build/docs/mcp-tools/appstore_list_beta_groups/) |
| No such build. | `buildId` names no build | Take a `buildId` from [appstore_list_builds](https://air.build/docs/mcp-tools/appstore_list_builds/) |
| No build _number_ on App Store Connect. See appstore_list_builds. | No unexpired build has that `buildNumber` | Check [appstore_list_builds](https://air.build/docs/mcp-tools/appstore_list_builds/) |
| No build of this app has reached App Store Connect yet. Uploading one is the Team's Agents' work: ask in the Project's channel (send_message) for a TestFlight build. | The app has no unexpired build at all | Ask the Project's Agent for a TestFlight build with [send_message](https://air.build/docs/mcp-tools/send_message/) |
| Apple could not process build _number_: it is _state_. | Apple's processing ended `INVALID` or `FAILED` | The build cannot be used; ask the Project's Agent for a new one |
| Apple needs this build's export compliance answer first: pass usesNonExemptEncryption (false when the app uses only exempt encryption such as HTTPS). | The build has no export compliance answer and `usesNonExemptEncryption` was not sent | Ask the person, then call again with `usesNonExemptEncryption` |
| Pass projectId, or appId from appstore_list_apps. | Neither `projectId` nor `appId` was sent | Send one of them |
| This Project has not been built for iOS yet, so it has no bundle id to find its app by. Ask the Team's Agent to build it, or pass appId. | The Project has never been built for iOS | Ask the Project's Agent for an iOS build ([send_message](https://air.build/docs/mcp-tools/send_message/)), or name the app by `appId` |
| This Project has no app on App Store Connect yet. Create one with appstore_create_app (its bundle id is the Project's), or pass appId. | No app on the Team's connected Apple teams has the Project's bundle id, or no Apple team is connected | Create the app with [appstore_create_app](https://air.build/docs/mcp-tools/appstore_create_app/), or name another app by `appId` |
| No connected Apple team of this Team has that app. See appstore_list_apps. | `appId` is not an app of any connected Apple team (or of `appleTeamId`) | Take the id from [appstore_list_apps](https://air.build/docs/mcp-tools/appstore_list_apps/) |
| App Store Connect: _Apple's sentence_ | Apple refused the request. Up to five of Apple's own sentences follow, each with the field it is about in brackets when Apple names one. An Apple agreement waiting in App Store Connect is refused this way too | Act on Apple's words. Agreements are accepted by the Apple Developer account's Account Holder in App Store Connect (Business › Agreements) |
| App Store Connect answered _status_. Try again in a moment. | Apple refused without saying why | Try again in a moment |

## Example

```json
{
  "name": "appstore_distribute_build",
  "arguments": {
    "teamId": "00000000-0000-0000-0000-000000000000",
    "projectId": "00000000-0000-0000-0000-000000000000",
    "groups": [
      "Friends"
    ],
    "whatToTest": "The new sharing sheet.",
    "usesNonExemptEncryption": false
  }
}
```
