# asc performance

> asc performance reads an app's power and performance metrics, Xcode's performance overview and diagnostic signatures and logs, and downloads them to files.

Source: https://air.build/docs/cli/asc-performance/

`asc performance` reads the power and performance data Apple collects from people using your app, the same data Xcode's Organizer shows: metrics per app or per build, an app's performance overview with regressions and trends, and diagnostic signatures (hangs, disk writes, launches) with their logs. Everything here is read-only in App Store Connect; only `download` writes a file on your machine. Picking an Apple team (`--auth`), output, pagination and exit codes work as described on the [asc](https://air.build/docs/cli/asc/) page; the flag tables below leave out `--output`, `--pretty`, `--limit`, `--next`, `--paginate` and `--fields`, which are explained there, except where a command gives them its own meaning.

Metrics and diagnostics come from builds that people have installed, so a new build has none until Apple has collected enough usage. Find build IDs with `asc builds list --app 1234567890` (see [asc: builds and TestFlight](https://air.build/docs/cli/asc-builds/)).

Notes that apply to the whole page:

- A flag marked "Required" is checked before any request; leaving it out exits `2`. Where `--app` is required, `ASC_APP_ID` can stand in for it.
- `--metric-type`, `--device-type` and `--platform` take comma-separated values. Metric types are `ANIMATION`, `BATTERY`, `DISK`, `HANG`, `LAUNCH`, `MEMORY`, `STORAGE` and `TERMINATION`; the only platform is `IOS`. Device types are Apple's model identifiers, such as `iPhone15,2`. Any other metric type or platform is refused before a request.

```sh
asc performance metrics list --app "1234567890"
asc performance diagnostics list --build-id "BUILD_ID"
```

| Subcommand | What it does |
| --- | --- |
| [metrics](https://air.build/docs/cli/asc-performance/#metrics) | Reads power and performance metrics for an app or a build. |
| [overview](https://air.build/docs/cli/asc-performance/#overview) | Reads an app's Xcode performance overview. |
| [diagnostics](https://air.build/docs/cli/asc-performance/#diagnostics) | Reads diagnostic signatures and their logs. |
| [download](https://air.build/docs/cli/asc-performance/#download) | Saves metrics or diagnostic logs to a file. |

## metrics

Power and performance metrics: animation, battery, disk, hangs, launch, memory, storage and termination.

| Subcommand | What it does |
| --- | --- |
| [metrics list](https://air.build/docs/cli/asc-performance/#metrics-list) | Metrics for an app across its builds. |
| [metrics view](https://air.build/docs/cli/asc-performance/#metrics-view) | Metrics for one build. |

### metrics list

Lists the metrics for an app across its builds. JSON output is Apple's metrics document; table and Markdown output summarize it as `Version`, `Products`, `Trending Up` and `Regressions` counts. The result is one response, with no pages.

| Flag | What it does | Default |
| --- | --- | --- |
| `--app` | The app ID (or `ASC_APP_ID`). Required. | — |
| `--metric-type` | Metric types to include, comma-separated. | all |
| `--device-type` | Device types to include, comma-separated. | all |
| `--platform` | Platform filter: `IOS`. | — |

```sh
asc performance metrics list --app "1234567890" --metric-type "MEMORY,DISK" --device-type "iPhone15,2"
```

### metrics view

Shows the metrics for one build, in the same form as `metrics list`.

| Flag | What it does | Default |
| --- | --- | --- |
| `--build-id` | The build ID. Required. | — |
| `--metric-type` | Metric types to include, comma-separated. | all |
| `--device-type` | Device types to include, comma-separated. | all |
| `--platform` | Platform filter: `IOS`. | — |

```sh
asc performance metrics view --build-id "BUILD_ID" --metric-type "MEMORY" --device-type "iPhone15,2"
```

## overview

Reads an app's Xcode performance overview: aggregated performance data, regressions and trends. JSON output keeps Apple's complete overview, including metric datasets and signatures; table and Markdown output summarize the app and its insight counts. The result is one response, with no pages.

| Flag | What it does | Default |
| --- | --- | --- |
| `--app` | The app ID (or `ASC_APP_ID`). Required. | — |
| `--device-type` | Device types to include, comma-separated. | all |

```sh
asc performance overview --app "1234567890" --device-type "iPhone15,2"
```

## diagnostics

Diagnostic signatures (groups of similar hangs, disk writes or slow launches) and the logs behind them.

| Subcommand | What it does |
| --- | --- |
| [diagnostics list](https://air.build/docs/cli/asc-performance/#diagnostics-list) | Diagnostic signatures of a build. |
| [diagnostics view](https://air.build/docs/cli/asc-performance/#diagnostics-view) | Logs of one signature. |

### diagnostics list

Lists the diagnostic signatures of a build. JSON output is Apple's list; table and Markdown output show `ID`, `Type`, `Weight`, `Insight` and `Signature` for each one.

| Flag | What it does | Default |
| --- | --- | --- |
| `--build-id` | The build ID. Required. | — |
| `--diagnostic-type` | Signature types to include, comma-separated: `DISK_WRITES`, `HANGS`, `LAUNCHES`. | all |

Notes:

- `--fields` takes `diagnosticType`, `signature`, `weight`, `insight` and `logs`. `--limit` is 1–200; `--paginate` reads every page, 200 at a time.
- `--build-id` is still required with `--next`. `--next` can't be combined with `--diagnostic-type` or `--fields`, because the `links.next` URL already carries them.

```sh
asc performance diagnostics list --build-id "BUILD_ID" --diagnostic-type "HANGS" --limit 50
```

### diagnostics view

Shows the diagnostic logs of one signature; take the signature ID from `diagnostics list`. JSON output is Apple's log document; table and Markdown output summarize it as `Version`, `Products`, `Logs` and `Insights` counts.

| Flag | What it does | Default |
| --- | --- | --- |
| `--id` | The diagnostic signature ID. Required. | — |
| `--limit` | Number of logs to return, 1–200. | Apple's default |

```sh
asc performance diagnostics view --id "SIGNATURE_ID" --limit 50
```

## download

Saves metrics (for an app or a build) or the diagnostic logs of a signature to a file, then prints a receipt: `downloadType` (`metrics` or `diagnostic-logs`), the ID used (`appId`, `buildId` or `diagnosticSignatureId`), `filePath`, `fileSize`, `decompressed` and, when it decompressed, `decompressedPath` and `decompressedSize`. On this command `--output` is the **file path**, and `--output-format` picks the format of the receipt.

| Flag | What it does | Default |
| --- | --- | --- |
| `--app` | The app ID (or `ASC_APP_ID`) whose metrics to save. | — |
| `--build-id` | The build ID whose metrics to save. | — |
| `--diagnostic-id` | The diagnostic signature ID whose logs to save. | — |
| `--output` | File path to write. | `perf_power_metrics_ID.json` or `diagnostic_logs_ID.json` in the current folder |
| `--output-format` | Format of the receipt: `json`, `table`, `markdown`. | `json` |
| `--decompress` | Also writes a decompressed copy when Apple sent the data gzip-compressed. | off |
| `--metric-type` | Metric types to include, comma-separated. Metrics only. | all |
| `--device-type` | Device types to include, comma-separated. Metrics only. | all |
| `--platform` | Platform filter: `IOS`. Metrics only. | — |
| `--limit` | Number of logs to save, 1–200. Diagnostic logs only. | Apple's default |

Notes:

- Give exactly one of `--app`, `--build-id` or `--diagnostic-id`; more than one is refused. With none of them, `ASC_APP_ID` is used, and without that the command exits `2` with `Error: --app, --build-id, or --diagnostic-id is required`.
- `--metric-type`, `--device-type` and `--platform` are refused with `--diagnostic-id`, and `--limit` is refused without it.
- An existing file is never replaced: the command fails with `output file already exists`. Pick another `--output` or remove the file first.
- With `--decompress` and compressed data, an `--output` ending in `.json` gets the compressed data at the same path plus `.gz`, and the decompressed copy at the path you gave.

```sh
asc performance download --diagnostic-id "SIGNATURE_ID" --output ./diagnostic.json --decompress
```
