Developer Disk Image Downloader

0.2.0 · active · verified Thu Apr 16

The 'developer-disk-image' Python library automates the download of Apple Developer Disk Images and Personalized Images. These images are essential for iOS development and debugging, allowing tools like Xcode to connect to devices running specific iOS versions. The library fetches these files directly from GitHub repositories. The current version is 0.2.0, with updates typically aligning with new iOS releases or Xcode versions.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to download both a Developer Disk Image and a Personalized Disk Image for specific iOS versions. It includes error handling for GitHub API rate limits and encourages the use of a `GITHUB_TOKEN` for robust operation.

import os
from developer_disk_image import (
    download_latest_developer_disk_image_for_ios_version,
    download_latest_personalized_disk_image_for_ios_version,
    GithubRateLimitExceededError
)

# It's highly recommended to use a GitHub token to avoid API rate limits.
# You can generate one at https://github.com/settings/tokens
GITHUB_TOKEN = os.environ.get('GITHUB_TOKEN', '')

output_directory = "."
os.makedirs(output_directory, exist_ok=True)

try:
    # Download a Developer Disk Image (e.g., for iOS 17.0)
    print("Downloading Developer Disk Image for iOS 17.0...")
    dev_image_path = download_latest_developer_disk_image_for_ios_version(
        version="17.0",
        github_token=GITHUB_TOKEN,
        output_dir=output_directory,
        verbose=True
    )
    print(f"Developer Disk Image downloaded to: {dev_image_path}")

    # Download a Personalized Disk Image (e.g., for iOS 16.0)
    print("\nDownloading Personalized Disk Image for iOS 16.0...")
    pers_image_path = download_latest_personalized_disk_image_for_ios_version(
        version="16.0",
        github_token=GITHUB_TOKEN,
        output_dir=output_directory,
        verbose=True
    )
    print(f"Personalized Disk Image downloaded to: {pers_image_path}")

except GithubRateLimitExceededError:
    print("GitHub API rate limit exceeded. Please provide a GitHub token in the GITHUB_TOKEN environment variable or as a parameter.")
except Exception as e:
    print(f"An error occurred: {e}")

view raw JSON →