# tuist xcodebuild build-for-testing

tuist xcodebuild build-for-testing extends the xcodebuild CLI build-for-testing action with insights.

## Arguments

### shard-max `Optional`

**Environment variable** `TUIST_TEST_SHARD_MAX`

Maximum number of shards to distribute tests across.

```bash
tuist xcodebuild build-for-testing --shard-max [shard-max]
```

### shard-min `Optional`

**Environment variable** `TUIST_TEST_SHARD_MIN`

Minimum number of shards.

```bash
tuist xcodebuild build-for-testing --shard-min [shard-min]
```

### shard-total `Optional`

**Environment variable** `TUIST_TEST_SHARD_TOTAL`

Exact number of shards (mutually exclusive with --shard-min/--shard-max).

```bash
tuist xcodebuild build-for-testing --shard-total [shard-total]
```

### shard-max-duration `Optional`

**Environment variable** `TUIST_TEST_SHARD_MAX_DURATION`

Target maximum duration per shard in milliseconds.

```bash
tuist xcodebuild build-for-testing --shard-max-duration [shard-max-duration]
```

### shard-granularity `Optional`

**Environment variable** `TUIST_TEST_SHARD_GRANULARITY`

Sharding granularity level: module (default) or suite.

```bash
tuist xcodebuild build-for-testing --shard-granularity [shard-granularity]
```

### shard-reference `Optional`

**Environment variable** `TUIST_SHARD_REFERENCE`

Explicit shard reference. Derived from environment variables for supported CI providers.

```bash
tuist xcodebuild build-for-testing --shard-reference [shard-reference]
```

### shard-skip-upload `Optional`

**Environment variable** `TUIST_TEST_SHARD_SKIP_UPLOAD`

Skip uploading test products to remote storage. Use when you provide test products to shard runners yourself, for example via shared volumes.

```bash
tuist xcodebuild build-for-testing --shard-skip-upload
```

### no-shard-skip-upload `Optional`

**Environment variable** `TUIST_TEST_SHARD_SKIP_UPLOAD`

Skip uploading test products to remote storage. Use when you provide test products to shard runners yourself, for example via shared volumes.

```bash
tuist xcodebuild build-for-testing --no-shard-skip-upload
```

### shard-archive-path `Optional`

**Environment variable** `TUIST_TEST_SHARD_ARCHIVE_PATH`

Path where Tuist should write the optimized shard archive instead of uploading test products to remote storage.

```bash
tuist xcodebuild build-for-testing --shard-archive-path [shard-archive-path]
```

### passthrough-xcodebuild-arguments `Optional`

Arguments that will be passed through to the xcodebuild CLI. All arguments are forwarded to xcodebuild. Example: tuist xcodebuild build-for-testing -scheme MyAppTests -destination 'platform=iOS Simulator,name=iPhone 15'

```bash
tuist xcodebuild build-for-testing [passthrough-xcodebuild-arguments]
```
