Agent commands

asc xcode-cloud commands: trigger, watch and diagnose Xcode Cloud build runs, and read and manage products, workflows, source repositories, build actions, artifacts, test results, issues and Xcode and macOS versions.

asc xcode-cloud works with Xcode Cloud through App Store Connect: start a workflow on a branch, tag or pull request, rerun a build, wait for it, and read why it failed from its actions, issues, test results and log artifacts. It also lists and edits the Xcode Cloud products and workflows of an app and the source repositories they build from. Picking an Apple team, output, pagination, --confirm and exit codes work as described on the asc page; the flag tables below leave out --output, --pretty, --limit, --next, --paginate and the --fields / --…-fields flags, which are explained there.

IDs chain from the top down: an app has a product (products list --app), a product has workflows (workflows list --app or products workflows --id), a workflow has build runs (build-runs list --workflow-id), and a build run has actions (actions list --run-id), which hold artifacts, issues and test results. Workflow settings that Apple’s API does not expose, such as environment variables and TestFlight post-actions, are under asc web xcode-cloud (see asc: web session commands).

run

Trigger an Xcode Cloud workflow build.

Pick the workflow by name with --workflow and --app, or by --workflow-id. Pick the source with --branch (a branch or tag), --git-reference-id or --pull-request-id. To rerun an existing build run instead, pass only --source-run-id (no workflow or source flags). With --wait --doctor it prints the doctor report once the run finishes; a failed build is then reported as data and does not make the command exit non-zero.

Flag What it does Default
--app App Store Connect app ID, bundle ID, or exact app name (or ASC_APP_ID). —
--branch Branch or tag name to build. —
--clean Request a clean build. false
--doctor After waiting, diagnose the completed run and inspect failure logs. false
--git-reference-id Git reference ID to build (alternative to --branch). —
--poll-interval Poll interval when waiting. 10s
--pull-request-id Pull request ID to build. —
--source-run-id Source build run ID to rerun. —
--timeout Timeout for Xcode Cloud requests (0 = use ASC_TIMEOUT or 30m default). 0s
--wait Wait for build to complete. false
--workflow Workflow name to trigger. —
--workflow-id Workflow ID to trigger (alternative to --workflow). —
Terminal window
asc xcode-cloud run --app "123456789" --workflow "CI" --branch "main"

status

Check the status of an Xcode Cloud build run.

Prints the run’s progress and result; --wait polls until the run completes.

Flag What it does Default
--poll-interval Poll interval when waiting. 10s
--run-id Build run ID to check. —
--timeout Timeout for Xcode Cloud requests (0 = use ASC_TIMEOUT or 30m default). 0s
--wait Wait for build to complete. false
Terminal window
asc xcode-cloud status --run-id "BUILD_RUN_ID"

doctor

Diagnose an Xcode Cloud build run and inspect failure logs.

Combines the run’s status, actions, issues and artifacts into one report. For failed runs it reads the failed actions’ log bundles and reports App Store import problems found in them. A failed build is report data: doctor still exits 0.

Flag What it does Default
--poll-interval Poll interval when waiting. 10s
--run-id Build run ID to diagnose. Required. —
--save-logs Directory in which to retain inspected log bundles. —
--skip-logs Skip automatic inspection of failed-action log bundles. false
--timeout Timeout for Xcode Cloud requests (0 = use ASC_TIMEOUT or 30m default). 0s
--wait Wait for the build run to complete before diagnosing it. false
Terminal window
asc xcode-cloud doctor --run-id "BUILD_RUN_ID"

products

Manage Xcode Cloud products.

Products are the apps and frameworks Xcode Cloud builds. asc xcode-cloud products with the products list flags lists them too.

products list

List Xcode Cloud products.

Flag What it does Default
--app App Store Connect app ID, bundle ID, or exact app name (or ASC_APP_ID). —
--include Include related resources: app, bundleId, primaryRepositories. —
--primary-repositories-limit Maximum included primary repositories (1-50). 0
--product-type Filter by product type(s), comma-separated: APP, FRAMEWORK. —
Terminal window
asc xcode-cloud products list

products view

View details for a product.

Flag What it does Default
--id Product ID. Required. —
Terminal window
asc xcode-cloud products view --id "PRODUCT_ID"

products app

Get the app for a product.

Flag What it does Default
--id Product ID. Required. —
Terminal window
asc xcode-cloud products app --id "PRODUCT_ID"

products build-runs

List build runs for a product.

Flag What it does Default
--id Product ID. —
Terminal window
asc xcode-cloud products build-runs --id "PRODUCT_ID"

products workflows

List workflows for a product.

Flag What it does Default
--id Product ID. —
Terminal window
asc xcode-cloud products workflows --id "PRODUCT_ID"

products primary-repositories

List primary repositories for a product.

Flag What it does Default
--id Product ID. —
Terminal window
asc xcode-cloud products primary-repositories --id "PRODUCT_ID"

products additional-repositories

List additional repositories for a product.

Flag What it does Default
--id Product ID. —
Terminal window
asc xcode-cloud products additional-repositories --id "PRODUCT_ID"

products delete

Delete a product.

Flag What it does Default
--confirm Confirm deletion. Required. false
--id Product ID. Required. —
Terminal window
asc xcode-cloud products delete --id "PRODUCT_ID" --confirm

workflows

Manage Xcode Cloud workflows.

asc xcode-cloud workflows --app APP_ID lists them too, like workflows list.

workflows list

List Xcode Cloud workflows for an app.

Flag What it does Default
--app App Store Connect app ID, bundle ID, or exact app name (or ASC_APP_ID). —
Terminal window
asc xcode-cloud workflows list --app "APP_ID"

workflows view

View details for a workflow.

Flag What it does Default
--id Workflow ID. Required. —
Terminal window
asc xcode-cloud workflows view --id "WORKFLOW_ID"

workflows repository

Get the repository for a workflow.

Flag What it does Default
--id Workflow ID. Required. —
Terminal window
asc xcode-cloud workflows repository --id "WORKFLOW_ID"

workflows create

Create a workflow.

The JSON file is the workflow request body for App Store Connect’s API.

Flag What it does Default
--file Path to workflow JSON payload. Required. —
Terminal window
asc xcode-cloud workflows create --file ./workflow.json

workflows update

Update a workflow.

Flag What it does Default
--file Path to workflow JSON payload. Required. —
--id Workflow ID. Required. —
Terminal window
asc xcode-cloud workflows update --id "WORKFLOW_ID" --file ./workflow.json

workflows duplicate

Duplicate a workflow under a new name.

Copies the source workflow into the same product, with the same start conditions, actions, clean setting, Xcode and macOS versions and repository. The copy is created disabled, so it cannot start builds before it is reviewed, and unlocked, so it can be edited; --enabled creates it enabled. TestFlight post-actions and environment variables are not in Apple’s public workflow schema and are not copied; set them with asc web xcode-cloud workflows edit and asc web xcode-cloud env-vars.

Flag What it does Default
--description Description for the new workflow. copied from the source workflow
--enabled Enable the new workflow immediately; the copy is created disabled by default. false
--id Source workflow ID to copy. Required. —
--name Name for the new workflow. Required. —
Terminal window
asc xcode-cloud workflows duplicate --id "WORKFLOW_ID" --name "Nightly"

workflows delete

Delete a workflow.

Flag What it does Default
--confirm Confirm deletion. Required. false
--id Workflow ID. Required. —
Terminal window
asc xcode-cloud workflows delete --id "WORKFLOW_ID" --confirm

scm

Manage Xcode Cloud SCM providers and repositories.

Source control providers and repositories connected to Xcode Cloud, and their git references (branches and tags) and pull requests. Their IDs are what run --git-reference-id and --pull-request-id take.

scm providers

Manage SCM providers.

scm providers list

List SCM providers.

Terminal window
asc xcode-cloud scm providers list

scm providers view

View an SCM provider by ID.

Flag What it does Default
--provider-id SCM provider ID. Required. —
Terminal window
asc xcode-cloud scm providers view --provider-id "PROVIDER_ID"

scm providers repositories

List repositories for an SCM provider.

Flag What it does Default
--provider-id SCM provider ID. Required. —
Terminal window
asc xcode-cloud scm providers repositories --provider-id "PROVIDER_ID"

scm repositories

Manage SCM repositories.

scm repositories list

List SCM repositories.

Terminal window
asc xcode-cloud scm repositories list

scm repositories view

View an SCM repository by ID.

Flag What it does Default
--id SCM repository ID. Required. —
Terminal window
asc xcode-cloud scm repositories view --id "REPO_ID"

scm repositories git-references

List git references for a repository.

Flag What it does Default
--repo-id SCM repository ID. Required. —
Terminal window
asc xcode-cloud scm repositories git-references --repo-id "REPO_ID"

scm repositories pull-requests

List pull requests for a repository.

Flag What it does Default
--repo-id SCM repository ID. Required. —
Terminal window
asc xcode-cloud scm repositories pull-requests --repo-id "REPO_ID"

List SCM repository relationship linkages.

Relationship linkages: the IDs only, without the attributes.

List git reference relationship linkages for a repository.

Flag What it does Default
--repo-id SCM repository ID. Required. —
Terminal window
asc xcode-cloud scm repositories links git-references --repo-id "REPO_ID"

List pull request relationship linkages for a repository.

Flag What it does Default
--repo-id SCM repository ID. Required. —
Terminal window
asc xcode-cloud scm repositories links pull-requests --repo-id "REPO_ID"

scm git-references

Manage SCM git references.

scm git-references view

View an SCM git reference by ID.

Flag What it does Default
--id SCM git reference ID. Required. —
Terminal window
asc xcode-cloud scm git-references view --id "REF_ID"

scm pull-requests

Manage SCM pull requests.

scm pull-requests view

View an SCM pull request by ID.

Flag What it does Default
--id SCM pull request ID. Required. —
Terminal window
asc xcode-cloud scm pull-requests view --id "PR_ID"

build-runs

Manage Xcode Cloud build runs.

asc xcode-cloud build-runs --workflow-id WORKFLOW_ID lists them too, like build-runs list.

build-runs list

List Xcode Cloud build runs for a workflow.

Flag What it does Default
--sort Sort by number or -number. —
--workflow-id Workflow ID to list build runs for. —
Terminal window
asc xcode-cloud build-runs list --workflow-id "WORKFLOW_ID"

build-runs view

View details for a build run.

Flag What it does Default
--id Build run ID. Required. —
Terminal window
asc xcode-cloud build-runs view --id "BUILD_RUN_ID"

build-runs builds

List builds for a build run.

Flag What it does Default
--run-id Build run ID to list builds for. —
Terminal window
asc xcode-cloud build-runs builds --run-id "BUILD_RUN_ID"

actions

Manage build actions for an Xcode Cloud build run.

Build actions are the steps of a build run (for example Resolve Dependencies, Archive, Upload) and their status. asc xcode-cloud actions --run-id BUILD_RUN_ID lists them too, like actions list.

actions list

List build actions for an Xcode Cloud build run.

Flag What it does Default
--run-id Build run ID to get actions for. Required. —
Terminal window
asc xcode-cloud actions list --run-id "BUILD_RUN_ID"

actions view

View details for a build action.

Flag What it does Default
--id Build action ID. Required. —
Terminal window
asc xcode-cloud actions view --id "ACTION_ID"

actions build-run

Get the build run for a build action.

Flag What it does Default
--id Build action ID. Required. —
Terminal window
asc xcode-cloud actions build-run --id "ACTION_ID"

artifacts

Manage Xcode Cloud build artifacts.

artifacts list

List artifacts for a build action or build run.

Give --action-id for one action, or --run-id to collect the artifacts of every action in the run. One of the two is required.

Flag What it does Default
--action-id Build action ID to list artifacts for. —
--run-id Build run ID to aggregate artifacts across all actions. —
Terminal window
asc xcode-cloud artifacts list --action-id "ACTION_ID"

artifacts view

View details for a build artifact.

Flag What it does Default
--id Artifact ID. Required. —
Terminal window
asc xcode-cloud artifacts view --id "ARTIFACT_ID"

artifacts download

Download a build artifact.

Flag What it does Default
--id Artifact ID. Required. —
--overwrite Overwrite existing file. false
--path Output file path for the artifact. Required. —
Terminal window
asc xcode-cloud artifacts download --id "ARTIFACT_ID" --path ./artifact.zip

test-results

List Xcode Cloud test results.

test-results list

List test results for a build action.

Give --action-id, or --run-id when the run has a single test action. One of the two is required.

Flag What it does Default
--action-id Build action ID to list test results for. —
--run-id Build run ID to resolve a single test-result action from. —
Terminal window
asc xcode-cloud test-results list --action-id "ACTION_ID"

test-results view

View details for a test result.

Flag What it does Default
--id Test result ID. Required. —
Terminal window
asc xcode-cloud test-results view --id "TEST_RESULT_ID"

issues

List Xcode Cloud build issues.

issues list

List issues for a build action.

Give --action-id, or --run-id when the run has a single action with issues. One of the two is required.

Flag What it does Default
--action-id Build action ID to list issues for. —
--run-id Build run ID to resolve a single issue action from. —
Terminal window
asc xcode-cloud issues list --action-id "ACTION_ID"

issues view

View details for a build issue.

Flag What it does Default
--id Issue ID. Required. —
Terminal window
asc xcode-cloud issues view --id "ISSUE_ID"

macos-versions

Manage Xcode Cloud macOS versions.

macos-versions list

List Xcode Cloud macOS versions.

Terminal window
asc xcode-cloud macos-versions list

macos-versions view

View details for a macOS version.

Flag What it does Default
--id macOS version ID. Required. —
Terminal window
asc xcode-cloud macos-versions view --id "MACOS_VERSION_ID"

macos-versions xcode-versions

List Xcode versions for a macOS version.

Flag What it does Default
--id macOS version ID. —
Terminal window
asc xcode-cloud macos-versions xcode-versions --id "MACOS_VERSION_ID"

xcode-versions

Manage Xcode Cloud Xcode versions.

xcode-versions list

List Xcode Cloud Xcode versions.

Terminal window
asc xcode-cloud xcode-versions list

xcode-versions view

View details for an Xcode version.

Flag What it does Default
--id Xcode version ID. Required. —
Terminal window
asc xcode-cloud xcode-versions view --id "XCODE_VERSION_ID"

xcode-versions macos-versions

List macOS versions for an Xcode version.

Flag What it does Default
--id Xcode version ID. —
Terminal window
asc xcode-cloud xcode-versions macos-versions --id "XCODE_VERSION_ID"