> ## Documentation Index
> Fetch the complete documentation index at: https://docs.asccli.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Devices

# devices

> Manage devices for app development and testing

Manage devices in App Store Connect for development builds, ad-hoc distribution, and TestFlight internal testing.

## Quick Start

```bash theme={null} theme={null}
asc devices list
asc devices local-udid
asc devices register --name "iPhone 15" --udid "UDID" --platform IOS
```

## Subcommands

* `list` - List devices in App Store Connect
* `get` - Get a device by ID
* `local-udid` - Get the local macOS hardware UDID
* `register` - Register a new device
* `update` - Update a device

## Commands

### devices list

List devices in App Store Connect:

```bash theme={null} theme={null}
asc devices list
asc devices list --platform IOS
asc devices list --status ENABLED
asc devices list --udid "UDID1,UDID2"
asc devices list --fields "name,udid,platform,status"
asc devices list --limit 50
asc devices list --paginate
```

**Flags:**

* `--name` - Filter by device name(s), comma-separated
* `--platform` - Filter by platform(s), comma-separated: `IOS`, `MAC_OS`, `TV_OS`, `VISION_OS`
* `--status` - Filter by status: `ENABLED`, `DISABLED`
* `--udid` - Filter by UDID(s), comma-separated
* `--id` - Filter by device ID(s), comma-separated
* `--sort` - Sort by: `id`, `-id`, `name`, `-name`, `platform`, `-platform`, `status`, `-status`, `udid`, `-udid`
* `--fields` - Fields to include: `addedDate`, `deviceClass`, `model`, `name`, `platform`, `status`, `udid`
* `--limit` - Maximum results per page (1-200)
* `--next` - Fetch next page using a links.next URL
* `--paginate` - Automatically fetch all pages
* `--output` - Output format: `json`, `table`, `markdown`
* `--pretty` - Pretty-print JSON output

### devices view

Get a device by ID:

```bash theme={null} theme={null}
asc devices view --id "DEVICE_ID"
asc devices view --id "DEVICE_ID" --fields "name,udid,platform,status"
```

**Flags:**

* `--id` - Device ID (required)
* `--fields` - Fields to include: `addedDate`, `deviceClass`, `model`, `name`, `platform`, `status`, `udid`
* `--output` - Output format: `json`, `table`, `markdown`
* `--pretty` - Pretty-print JSON output

### devices local-udid

Get the local macOS hardware UDID:

```bash theme={null} theme={null}
asc devices local-udid
asc devices local-udid --output table
```

**Flags:**

* `--output` - Output format: `json`, `table`, `markdown`
* `--pretty` - Pretty-print JSON output

**Note:** This command only works on macOS and reads the hardware UUID from the system.

### devices register

Register a new device:

```bash theme={null} theme={null}
asc devices register --name "iPhone 15" --udid "UDID" --platform IOS
asc devices register --name "My Mac" --udid-from-system --platform MAC_OS
```

**Flags:**

* `--name` - Device name (required)
* `--udid` - Device UDID (required unless `--udid-from-system`)
* `--udid-from-system` - Use local macOS hardware UUID as UDID (macOS only)
* `--platform` - Device platform: `IOS`, `MAC_OS`, `TV_OS`, `VISION_OS` (required)
* `--output` - Output format: `json`, `table`, `markdown`
* `--pretty` - Pretty-print JSON output

**Note:** `--udid` and `--udid-from-system` are mutually exclusive.

### devices update

Update a device:

```bash theme={null} theme={null}
asc devices update --id "DEVICE_ID" --name "My iPhone"
asc devices update --id "DEVICE_ID" --status DISABLED
```

**Flags:**

* `--id` - Device ID (required)
* `--name` - Device name
* `--status` - Device status: `ENABLED`, `DISABLED`
* `--output` - Output format: `json`, `table`, `markdown`
* `--pretty` - Pretty-print JSON output

**Note:** At least one update flag (`--name` or `--status`) is required.

## Device Platforms

* `IOS` - iPhone and iPad devices
* `MAC_OS` - Mac computers
* `TV_OS` - Apple TV devices
* `VISION_OS` - Apple Vision Pro devices

## Device Status

* `ENABLED` - Device is active and can be used for development
* `DISABLED` - Device is disabled and cannot be used

## Examples

### Register iOS Device

```bash theme={null} theme={null}
asc devices register \
  --name "iPhone 15 Pro" \
  --udid "00008030-000123456789ABCD" \
  --platform IOS
```

### Register Current Mac

```bash theme={null} theme={null}
# Get local UDID
UDID=$(asc devices local-udid --output json | jq -r '.udid')

# Register device
asc devices register \
  --name "MacBook Pro" \
  --udid "$UDID" \
  --platform MAC_OS
```

Or use the shortcut:

```bash theme={null} theme={null}
asc devices register \
  --name "MacBook Pro" \
  --udid-from-system \
  --platform MAC_OS
```

### List Enabled iOS Devices

```bash theme={null} theme={null}
asc devices list \
  --platform IOS \
  --status ENABLED \
  --output table
```

### Disable Device

```bash theme={null} theme={null}
asc devices update --id "DEVICE_ID" --status DISABLED
```

### Find Device by UDID

```bash theme={null} theme={null}
asc devices list --udid "00008030-000123456789ABCD" --output json
```

### Bulk Register Devices

```bash theme={null} theme={null}
#!/bin/bash
set -e

# Read devices from CSV file
while IFS=, read -r name udid platform; do
  echo "Registering $name ($platform)"
  
  asc devices register \
    --name "$name" \
    --udid "$udid" \
    --platform "$platform"
done < devices.csv
```

**devices.csv:**

```csv theme={null} theme={null}
iPhone 15 Pro,00008030-000123456789ABCD,IOS
iPad Pro,00008101-000987654321FEDC,IOS
MacBook Pro,12345678-90AB-CDEF-1234-567890ABCDEF,MAC_OS
```

### Export Device List

```bash theme={null} theme={null}
# Export all devices to CSV
asc devices list --paginate --output json | \
  jq -r '.data[] | [.attributes.name, .attributes.udid, .attributes.platform, .attributes.status] | @csv' > devices.csv
```

## Finding Device UDIDs

### iOS Devices

1. Connect device to Mac
2. Open Finder
3. Select device in sidebar
4. Click on device name to reveal UDID
5. Right-click and copy UDID

Or use `ideviceinfo`:

```bash theme={null} theme={null}
brew install libimobiledevice
ideviceinfo -k UniqueDeviceID
```

### macOS Devices

Use the `local-udid` command:

```bash theme={null} theme={null}
asc devices local-udid
```

Or find it in System Information:

1. Click Apple menu > About This Mac
2. Click System Report
3. Select Hardware
4. Look for "Hardware UUID"

### Apple TV

1. Go to Settings > General > About
2. Scroll to "Identifier"

### Apple Vision Pro

1. Go to Settings > General > About
2. Look for "Serial Number" or connect to Mac and use Finder

## Provisioning Profiles

After registering devices, regenerate provisioning profiles:

```bash theme={null} theme={null}
# List profiles
asc profiles list --profile-type IOS_APP_DEVELOPMENT

# Download and install updated profile
asc profiles download --id "PROFILE_ID" --output ./profile.mobileprovision
```

Or use Xcode to automatically refresh provisioning profiles.
