Function: getIpaHub()

function getIpaHub(options?): Promise<IpaHub>;

Defined in: src/getIpaHub.ts:40

Initialize an ipa-hub instance for library use.

Uses the current user's Xcode signing setup; no Apple password is requested. Each call creates an independent instance with its own callbacks and data-directory configuration. Installed apps and downloads persist between instances. Installations delegate to a compatible running server unless bypassServer is set. Call dispose after outstanding operations finish. Your application handles publisher trust confirmation and can provide select for ambiguous devices, assets, or teams. On non-macOS systems, warns and returns an inactive instance without creating storage. Device, team, app, and release lists are empty; other operations reject with a macOS-only error. The development environment variable IPA_HUB_DEV_ALLOW_NON_MACOS=1 bypasses this restriction, but does not emulate Apple's tools or devices.

Parameters

ParameterTypeDescription
options?IpaHubOptionsData directory, callbacks, cancellation, and an optional update-server address.

Returns

Promise<IpaHub>

An initialized IpaHub instance, or an inactive instance on unsupported platforms; rejects on storage errors.

Example

import os from "node:os";
import path from "node:path";
import {getIpaHub} from "ipa-hub";

const hub = await getIpaHub({
    dataDir: path.join(os.homedir(), ".ipa-hub"),
    onProgress({message}) {
        console.log(message);
    }
});
try {
    const devices = await hub.listDevices({types: ["iphone"]});
    const result = await hub.install({source: "gh:utmapp/UTM", filter: "^UTM$", device: devices[0]?.id});
    console.log(`Installed ${result.app.name} on ${result.device.name}`);
} finally {
    await hub.dispose();
}