Quickstart
Install ipatool and launch the interactive terminal UI — or grab an IPA in three commands:
# 1. Install (macOS / Linux via Homebrew — see below for Windows, Cargo, and curl installers)
# 2a. Launch the interactive TUI (login, search, purchase, and download in one screen)
# 2b. Or use the CLI directly
Need to downgrade an iOS app to an older version?
Why ipatool-rs?
While upstream Go ipatool has also been updated for Apple's newer Store authentication, ipatool-rs takes a fundamentally lighter, Rust-native engineering approach focused on low memory usage, fast execution, tiny binary size, and an interactive terminal UI:
- Lightweight C-ABI Signing vs. Full ObjC Runtime Emulation: To satisfy Apple's
auth/v1/nativeSAP and Store ADI (X-Apple-AMD) checks, upstreamipatoolunpacks ~78 MB of macOS IPSW shared-cache images (AppleMediaServices,adid,fairplayd,FairPlayIOKit, etc.) and emulates an Objective-C/Swift runtime bridge on top of Go's GC heap.ipatool-rsinstead drives self-contained C entry points (CommerceKit/CoreFP+ ~4 MB AndroidlibCoreADI.sowith zero daemon, kernel, or ObjC runtime dependencies) inside Unicorn — cutting cached asset size nearly in half and keeping peak RAM usage minimal. - Constant-Memory Streaming & Zero-Recompression Patching: Downloads stream directly to disk in small chunks (
O(1)memory whether an IPA is 50 MB or 4 GB) with HTTPRangeresume. When injectingiTunesMetadata.plistand SINF DRM data,ipatool-rscopies existing ZIP entries as raw compressed streams (raw_copy_file) without decompressing and re-deflating the payload. - ~9× Smaller Distribution & Zero GC Overhead: Prebuilt release archives are ~3 MB (vs. ~25–27 MB for upstream Go builds), compiled to native code with
rustls(no OpenSSL dependency) and zero garbage-collector pauses. - Interactive TUI + Concurrent Download Queue: Beyond scriptable CLI subcommands, running
ipatoollaunches a full keyboard-driven terminal UI (ratatui) to search, claim free licenses, and manage multiple background downloads in one session.
Common Use Cases
- Downgrade iOS apps: List historical
version-idbuilds from Apple's servers and download older.ipareleases without needing discontinued iTunes 12.6.5. - Archive apps before delisting: Keep local, patch-ready
.ipabackups (withiTunesMetadata.plistand SINF injected) for devices authorized under your Apple ID. - Interactive terminal workflow: Browse App Store results, inspect app details, claim free licenses, and monitor concurrent downloads in a keyboard-driven TUI.
- Automation & CI pipelines: Combine
--format jsonand--non-interactivefor low-overhead scripted metadata lookups and IPA retrieval.
Comparison
| Aspect | ipatool (Go, v2.8+) | ipatool-rs (Rust) |
|---|---|---|
| Interactive TUI | ❌ CLI only | ✅ Built-in keyboard-driven TUI + CLI |
| Background download queue | ❌ Single CLI invocation | ✅ Concurrent queue in TUI Downloads tab |
| Release package size | ~25–27 MB compressed | ✅ ~2.7–4.3 MB compressed (~9× smaller) |
| Memory model | Go GC + ObjC runtime bridge heap | ✅ Zero-GC Rust + direct C-ABI shims (O(1) streaming RAM) |
| Signing engine & cached assets | ~78 MB macOS IPSW / dyld cache (AppleMediaServices, fairplayd, etc.) |
✅ ~42 MB standalone CommerceKit + self-contained libCoreADI.so |
| IPA patching I/O | Rewrites archive entries | ✅ Zero-recompression raw_copy_file stream copy |
Apple ID auth, 2FA & X-Apple-AMD |
✅ Supported | ✅ Supported (with auto re-auth on expired token) |
| Historical versions & Range resume | ✅ Supported | ✅ Supported (version list, --version-id, Range resume) |
| Credential storage | Native OS keychain | ✅ Native OS keychain (macOS / Linux / Windows) |
| Reusable core library | Go internal/pkg modules | ✅ Standalone async ipatool-core crate (tokio + rustls) |
| Scope | Multi-platform packages (incl. macOS .pkg) + MCP |
Focused, lightweight iOS .ipa TUI & CLI |
Features
- Interactive TUI mode: Run
ipatoolwith no arguments for Search, Library, Downloads, and Account tabs. - Signed sign-in & device proof: Performs Apple's SAP handshake and Store ADI (
X-Apple-AMD) device provisioning required byauth/v1/nativesince November 2026 — without redistributing Apple binaries. - Multi-storefront search: Query App Store catalogs across any country code (
--country US,JP,CN, etc.). - Zero-recompression IPA patching: Injects purchase metadata (
iTunesMetadata.plist) and SINF authorization data by copying compressed ZIP streams directly without re-deflating the app payload. - Resilient downloads & sessions: Streams large IPA files with HTTP Range resume in CLI mode and automatic token refresh when stored credentials expire.
- Script-friendly CLI: Structured
--format jsonoutput and--non-interactivemode for headless environments.
Installation
Homebrew (macOS / Linux)
One-Line Installer (macOS / Linux / Windows)
# macOS / Linux
|
# Windows PowerShell
powershell -ExecutionPolicy Bypass -c "irm https://github.com/Kosthi/ipatool-rs/releases/latest/download/ipatool-rs-installer.ps1 | iex"
Cargo / mise
# Install from source via Cargo
# Install prebuilt binary via cargo-binstall
# Or install prebuilt binary via mise (ubi backend)
Prebuilt Release Binaries
Download archives directly from GitHub Releases:
| Platform | Asset | Install |
|---|---|---|
| Windows x64 | ipatool-rs-x86_64-pc-windows-msvc.zip |
Extract and place ipatool.exe on your PATH. |
| macOS Apple Silicon | ipatool-rs-aarch64-apple-darwin.tar.xz |
Extract and place ipatool on your PATH. |
| macOS Intel | ipatool-rs-x86_64-apple-darwin.tar.xz |
Extract and place ipatool on your PATH. |
| Linux x64 | ipatool-rs-x86_64-unknown-linux-gnu.tar.xz |
Extract and place ipatool on your PATH. |
| Linux ARM64 | ipatool-rs-aarch64-unknown-linux-gnu.tar.xz |
Extract and place ipatool on your PATH. |
Each release includes per-asset .sha256 checksums and a unified sha256.sum.
Build From Source
# Binary at target/release/ipatool
Usage
Terminal UI (TUI)
Launch the interactive TUI by running ipatool without subcommands:
Built with ratatui and crossterm, the TUI lets you sign in, search the App Store, acquire free licenses, and manage concurrent downloads from the keyboard.
Keyboard Controls
| Scope | Key | Action |
|---|---|---|
| Global | q / Ctrl+C |
Quit |
Tab / Shift+Tab |
Switch tabs | |
1–4 |
Jump directly to a tab | |
j / k or Up / Down |
Navigate the current list | |
Esc |
Cancel input or close popup | |
| Search tab | / or s |
Focus the search bar |
Enter |
Run search | |
d |
Download selected app | |
p |
Purchase (obtain free license for) selected app | |
| Downloads tab | x |
Cancel selected download |
c |
Clear finished downloads | |
| Account tab | l |
Log in |
r |
Revoke stored credentials |
CLI Usage
[!NOTE] First sign-in downloads ~50 MB once. Apple requires sign-in and store requests to carry an action signature and a Store ADI device proof generated by Apple's own code (see How It Works). Those components are fetched once via HTTP range requests, verified against pinned SHA-256 digests, and cached under
~/.ipatool/cache/for all subsequent runs.
1. Authenticate with Apple ID
# Interactive login (prompts securely for password and 2FA code if needed)
# Pass password / 2FA code directly
# Inspect active session & storefront
# Log out and remove stored credentials
2. Search the App Store
3. Obtain a Free License & Download IPAs
By default, IPAs are saved in the current directory as {bundle_id}_{version_id}_{version}.ipa. Pass --purchase to automatically claim a free license if your account does not own the app yet.
# Download latest IPA and auto-purchase free license if needed
# Custom output path
# Download by numeric App ID
# Obtain a free license without downloading
4. List & Download Older App Versions (Downgrade)
# List all available external version IDs for an app
# Inspect version metadata (display version string, release info)
# Download that exact historical version
Global Flags
--format <text|json> Output format (default: text)
--verbose Enable debug logging
--non-interactive Disable interactive prompts (for scripts/CI)
Migrating from majd/ipatool
ipatool-rs keeps familiar CLI semantics so existing scripts require minimal changes:
| Task | majd/ipatool (Go) |
ipatool-rs |
|---|---|---|
| Sign in | ipatool auth login -e ... |
ipatool auth login --email ... |
| Account info | ipatool auth info |
ipatool auth info |
| Sign out | ipatool auth revoke |
ipatool auth revoke |
| Search apps | ipatool search "term" |
ipatool search "term" [--country US] |
| Purchase free license | ipatool purchase -b <bundle_id> |
ipatool purchase -b <bundle_id> |
| Download latest IPA | ipatool download -b <bundle_id> --purchase |
ipatool download -b <bundle_id> --purchase |
| List older versions | ipatool list-versions -b <bundle_id> |
ipatool version list -b <bundle_id> |
| Version metadata | ipatool get-version-metadata ... |
ipatool version meta -b <bundle_id> --version-id <id> |
| Interactive TUI | Not available | ipatool |
How It Works
-
Auth & Device Proof — Posts credentials to Apple's
auth/v1/nativeendpoint with both anX-Apple-ActionSignature(SAP) and a Store-scopedX-Apple-AMD/X-Apple-AMD-Mdevice proof, completingotp/1.5/finishprovisioning automatically on first use. Handles 2FA, pod redirects, retry logic, OS keychain storage, and cookies.Producing both proofs requires running Apple's own signing routines. On first use,
ipatool-rs:- HTTP range-reads a public OS X 10.9 update package (~33 MB of 1.27 GB) to extract
CommerceKit,CommerceCore, andCoreFP; - HTTP range-reads Apple's official Android Apple Music APK (~2 MB of 142 MB) to extract x86-64
libCoreADI.soandlibstoreservicescore.so; - Downloads a prebuilt Unicorn CPU emulator and executes those x86-64 Mach-O and ELF binaries in-process with their external imports serviced directly from Rust.
Every artifact is verified against pinned SHA-256 digests before execution and cached under
~/.ipatool/cache/(with persistent ADI provisioning state under~/.ipatool/adi/). No Apple code is redistributed with this repository or its binaries. - HTTP range-reads a public OS X 10.9 update package (~33 MB of 1.27 GB) to extract
-
Search / Lookup — Queries the public iTunes Search API for app metadata and storefront-specific results.
-
Purchase — Sends a buy request to
buy.itunes.apple.comwith Store AMD headers andSTDQpricing, falling back toGAMEfor Apple Arcade-style responses. -
Download — Requests the signed CDN URL and SINF DRM blobs from Apple's
volumeStoreDownloadProductendpoint with Store AMD headers, then streams the archive with HTTP Range resume support. -
Patch — Rebuilds the ZIP archive on the fly, injecting
iTunesMetadata.plistandSC_Info/*.sinfso the resulting.ipainstalls cleanly on any device authorized for your Apple ID. -
TUI — Wraps
ipatool-corein an asyncratatui+crossterminterface with non-blocking background workers for search, authentication, licensing, and queued downloads.
Project Structure
ipatool-rs/
|-- Cargo.toml # Workspace root
|-- media/ # README logo and TUI demo assets
`-- crates/
|-- ipatool-core/ # Reusable library crate
| `-- src/
| |-- adi/ # Store ADI (X-Apple-AMD) runtime & ELF loader
| |-- api/ # Apple Store API endpoints
| |-- client/ # HTTP client, plist parser, cookie jar
| |-- model/ # Account, App, Platform, StoreFront types
| |-- ipa/ # IPA patching & HTTP range ZIP reader
| |-- sap/ # SAP signing runtime, Mach-O loader & Unicorn engine
| |-- error.rs # Structured error hierarchy
| |-- credential.rs # Native OS keychain storage
| `-- guid.rs # Device GUID generation
`-- ipatool-cli/ # Binary crate (`ipatool`)
`-- src/
|-- main.rs # CLI entry point & clap definitions
|-- output.rs # Text / JSON formatters
|-- tui/ # Interactive ratatui terminal UI
`-- commands/ # Subcommand handlers
FAQ
Star History
License
Released under the MIT License.