AppleDeveloper (apple_developer v0.3.0)

Copy Markdown View Source

Elixir client for the Apple Developer API.

Provides access to:

  • Certificates (development, distribution, push notification)
  • Provisioning profiles
  • Devices (UDID management)
  • App Store Connect apps and builds

The public surface is intentionally small:

AppleDeveloper.list_certificates()
AppleDeveloper.create_certificate(:ios_development, csr_content)
AppleDeveloper.revoke_certificate("certificate_id")
AppleDeveloper.list_devices()
AppleDeveloper.register_device("iPhone 14", "A1B2C3D4...", "IOS")
AppleDeveloper.list_profiles()
AppleDeveloper.create_profile("profile_name", "bundle_id", "certificate_id", ["device_id"])
AppleDeveloper.token()

Configuration

config :apple_developer,
  issuer_id: System.get_env("APPLE_ISSUER_ID"),
  key_id: System.get_env("DEVELOPER_KEY_ID"),
  private_key: System.get_env("DEVELOPER_PRIVATE_KEY"),
  base_url: "https://api.appstoreconnect.apple.com"

Every function also accepts per-call opts that override the application config.

Summary

Functions

Delete a provisioning profile.

Get a specific app by ID.

Get a specific bundle ID.

Get a specific certificate by ID.

Get a specific device by ID.

Get a specific profile by ID.

Get the current user's info.

List all apps in App Store Connect.

List all bundle IDs.

List all certificates for your team.

List all registered devices.

List all provisioning profiles.

List all users in your team.

Register a new device for development.

Return a cached-per-call App Store Connect access token (after the JWT generation).

Types

opts()

@type opts() :: keyword()

response()

@type response() :: {:ok, map()} | {:error, term()}

Functions

create_certificate(certificate_type, csr_content, opts \\ [])

@spec create_certificate(atom(), String.t(), opts()) :: response()

Create a new certificate.

Parameters

  • certificate_type: One of:
    • :ios_development
    • :ios_distribution
    • :mac_app_distribution
    • :mac_installer_distribution
    • :mac_app_development
    • :developer_id_kext
    • :developer_id_application
  • csr_content: The Certificate Signing Request content (PEM format)
  • opts: Optional overrides

Examples

AppleDeveloper.create_certificate(:ios_development, csr_content)

create_profile(name, profile_type, bundle_id, certificate_ids, device_ids, opts \\ [])

@spec create_profile(
  String.t(),
  String.t(),
  String.t(),
  [String.t()],
  [String.t()],
  opts()
) ::
  response()

Create a new provisioning profile.

Parameters

  • name: Profile name
  • profile_type: Profile type (e.g., "IOS_APP_DEVELOPMENT", "IOS_APP_STORE")
  • bundle_id: The bundle ID to associate
  • certificate_ids: List of certificate IDs
  • device_ids: List of device IDs (for development profiles)
  • opts: Optional overrides

Examples

AppleDeveloper.create_profile(
  "My Development Profile",
  "IOS_APP_DEVELOPMENT",
  "bundle_id_123",
  ["cert_id_456"],
  ["device_id_789"]
)

delete_bundle_id(bundle_id, opts \\ [])

@spec delete_bundle_id(String.t(), opts()) :: :ok | {:error, term()}

Delete a bundle ID.

Parameters

  • bundle_id: The bundle ID resource ID to delete
  • opts: Optional overrides

delete_profile(profile_id, opts \\ [])

@spec delete_profile(String.t(), opts()) :: :ok | {:error, term()}

Delete a provisioning profile.

Parameters

  • profile_id: The profile ID to delete
  • opts: Optional overrides

get_app(app_id, opts \\ [])

@spec get_app(String.t(), opts()) :: response()

Get a specific app by ID.

Parameters

  • app_id: The app ID
  • opts: Optional overrides

get_bundle_id(bundle_id, opts \\ [])

@spec get_bundle_id(String.t(), opts()) :: response()

Get a specific bundle ID.

Parameters

  • bundle_id: The bundle ID resource ID
  • opts: Optional overrides

get_certificate(certificate_id, opts \\ [])

@spec get_certificate(String.t(), opts()) :: response()

Get a specific certificate by ID.

Parameters

  • certificate_id: The certificate ID
  • opts: Optional overrides

get_device(device_id, opts \\ [])

@spec get_device(String.t(), opts()) :: response()

Get a specific device by ID.

Parameters

  • device_id: The device ID
  • opts: Optional overrides

get_profile(profile_id, opts \\ [])

@spec get_profile(String.t(), opts()) :: response()

Get a specific profile by ID.

Parameters

  • profile_id: The profile ID
  • opts: Optional overrides

get_user(opts \\ [])

@spec get_user(opts()) :: response()

Get the current user's info.

Parameters

  • opts: Optional overrides

list_apps(opts \\ [])

@spec list_apps(opts()) :: {:ok, [map()]} | {:error, term()}

List all apps in App Store Connect.

Parameters

  • opts:
    • :filter_name - Filter by app name
    • :limit - Maximum results

list_bundle_ids(opts \\ [])

@spec list_bundle_ids(opts()) :: {:ok, [map()]} | {:error, term()}

List all bundle IDs.

Parameters

  • opts:
    • :filter_identifier - Filter by bundle identifier
    • :limit - Maximum results

list_certificates(opts \\ [])

@spec list_certificates(opts()) :: {:ok, [map()]} | {:error, term()}

List all certificates for your team.

Parameters

  • opts:
    • :filter_serial - Filter by serial number
    • :filter_status - Filter by status ("ACTIVE", "EXPIRED", "REVOKED")
    • :limit - Maximum results (default 200)

list_devices(opts \\ [])

@spec list_devices(opts()) :: {:ok, [map()]} | {:error, term()}

List all registered devices.

Parameters

  • opts:
    • :filter_status - Filter by status ("ENABLED", "DISABLED")
    • :filter_platform - Filter by platform ("IOS", "MAC_OS")
    • :filter_udi - Filter by UDID
    • :limit - Maximum results

list_profiles(opts \\ [])

@spec list_profiles(opts()) :: {:ok, [map()]} | {:error, term()}

List all provisioning profiles.

Parameters

  • opts:
    • :filter_profile_state - Filter by state ("ACTIVE", "EXPIRED", "INVALID")
    • :filter_profile_type - Filter by type
    • :limit - Maximum results

list_users(opts \\ [])

@spec list_users(opts()) :: {:ok, [map()]} | {:error, term()}

List all users in your team.

Parameters

  • opts:
    • :filter_roles - Filter by roles
    • :limit - Maximum results

register_bundle_id(identifier, name, platform, opts \\ [])

@spec register_bundle_id(String.t(), String.t(), String.t(), opts()) :: response()

Register a new bundle ID.

Parameters

  • identifier: The bundle identifier (e.g., "com.example.app")
  • name: Display name for the bundle ID
  • platform: Platform ("IOS", "MAC_OS", "UNIVERSAL")
  • opts: Optional overrides

register_device(name, udid, platform, opts \\ [])

@spec register_device(String.t(), String.t(), String.t(), opts()) :: response()

Register a new device for development.

Parameters

  • name: Device name/label
  • udid: Device UDID (unique device identifier)
  • platform: Platform ("IOS" or "MAC_OS")
  • opts: Optional overrides

Examples

AppleDeveloper.register_device("iPhone 14 Pro", "00008110-001234567890ABCDE", "IOS")

revoke_certificate(certificate_id, opts \\ [])

@spec revoke_certificate(String.t(), opts()) :: :ok | {:error, term()}

Revoke a certificate.

Parameters

  • certificate_id: The certificate ID to revoke
  • opts: Optional overrides

token(opts \\ [])

@spec token(opts()) :: {:ok, String.t()} | {:error, term()}

Return a cached-per-call App Store Connect access token (after the JWT generation).

update_device(device_id, new_name, opts \\ [])

@spec update_device(String.t(), String.t(), opts()) :: response()

Update a device name.

Parameters

  • device_id: The device ID
  • new_name: New device name
  • opts: Optional overrides