Developer Disk Image Downloader
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
-
developer_disk_image.exceptions.GithubRateLimitExceededError: Github API rate limit exceeded. Please provide a github_token.
cause You have exceeded GitHub's API rate limit for unauthenticated requests, often after a few dozen requests.fixGenerate a GitHub Personal Access Token (PAT) from `github.com/settings/tokens` and provide it to the `github_token` parameter in the download functions or set it as the `GITHUB_TOKEN` environment variable. -
ModuleNotFoundError: No module named 'developer_disk_image'
cause The 'developer-disk-image' library is not installed in your current Python environment.fixInstall the package using pip: `pip install developer-disk-image`. -
developer_disk_image.exceptions.GithubAssetNotFound: Asset for version 'X.X' not found.
cause The specified iOS version's Developer Disk Image or Personalized Image could not be located in the configured GitHub repository. This might be due to an incorrect version string or the asset being removed/renamed.fixDouble-check the exact version string (e.g., '17.0' vs '17.0.0'). Verify the asset's existence and name directly on the GitHub repository page (https://github.com/doronz88/DeveloperDiskImage/releases).
Warnings
- gotcha Frequent use without authentication will quickly hit GitHub's API rate limits, leading to `GithubRateLimitExceededError` and preventing further downloads.
- gotcha The specific Developer Disk Image or Personalized Image files for an iOS version on GitHub may be updated, replaced, or removed. For instance, `v0.1.0` replaced the 15.8 image with 15.5 due to issues.
- gotcha Developer Disk Images are large files (often several gigabytes). Downloads can consume significant bandwidth and disk space, and may take a considerable amount of time depending on your network speed.
Install
-
pip install developer-disk-image
Imports
- download_latest_developer_disk_image_for_ios_version
from developer_disk_image import download_latest_developer_disk_image_for_ios_version
- download_latest_personalized_disk_image_for_ios_version
from developer_disk_image import download_latest_personalized_disk_image_for_ios_version
- GithubRateLimitExceededError
from developer_disk_image.exceptions import GithubRateLimitExceededError
Quickstart
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}")