What Does the ErrLicenseRequired Error Mean in IPATool?
The ErrLicenseRequired error indicates that the authenticated Apple ID does not own a license for the requested app, requiring either a purchase or account switch before downloading.
When using the ipatool download command, you may encounter the message Error: license is required. This sentinel error originates from the Apple App Store API response and is surfaced through IPATool's download pipeline when your account lacks proper entitlements for the target application.
What Triggers the ErrLicenseRequired Error
The error originates in pkg/appstore/appstore_download.go, where IPATool defines the sentinel error at lines 18–19:
var ErrLicenseRequired = errors.New("license is required")
During the download flow, IPATool unmarshals the Apple API response into a downloadResult structure. When the API returns FailureTypeLicenseNotFound in the FailureType field, the code at lines 65–66 returns the sentinel error:
if res.Data.FailureType == FailureTypeLicenseNotFound {
return DownloadOutput{}, ErrLicenseRequired
}
This occurs because the App Store requires a valid license (purchase record) associated with your Apple ID before allowing binary downloads. Free apps still require a "license" in Apple's system, which is typically granted automatically when you initially acquire the app through the App Store.
How to Fix the "License Is Required" Error
You have three primary resolution paths depending on your account status and app ownership.
Purchase the App Automatically
Use the --purchase flag with the download command. This instructs IPATool to first call the purchase endpoint to obtain the license, then proceed with the download:
ipatool download --bundle-id com.example.app --purchase -o MyApp.ipa
Alternatively, purchase the license explicitly before downloading:
ipatool purchase --bundle-id com.example.app
ipatool download --bundle-id com.example.app -o MyApp.ipa
Switch to a Licensed Apple ID
If the app was purchased under a different account, authenticate with that Apple ID:
ipatool auth login
# Enter credentials for the account that owns the app
ipatool download --bundle-id com.example.app -o MyApp.ipa
Verify License Status
Check whether your current account actually owns the app using the built-in information commands before attempting downloads:
ipatool list-versions --bundle-id com.example.app
ipatool account-info
Handling ErrLicenseRequired Programmatically
When integrating IPATool as a library in Go applications, explicitly check for this error to implement custom retry logic or user prompts:
out, err := client.AppStore().Download(ctx, downloadInput)
if errors.Is(err, appstore.ErrLicenseRequired) {
// Prompt user to purchase or switch accounts
fmt.Println("License required: Purchase the app or authenticate with a different Apple ID")
}
Key Source Files
The license validation logic spans multiple files in the majd/ipatool repository:
pkg/appstore/appstore_download.go– DefinesErrLicenseRequiredand implements theFailureTypeLicenseNotFounddetection logic (lines 18–19 and 65–66).cmd/download.go– CLI command handler that propagates the error to stdout when downloads fail.cmd/purchase.go– Implements the purchase flow that acquires missing licenses.pkg/appstore/appstore_purchase.go– Contains the server-side purchase logic and license creation handlers.
Summary
ErrLicenseRequiredmeans your Apple ID lacks a purchase record for the requested app in the App Store system.- The error is raised in
pkg/appstore/appstore_download.gowhen Apple returnsFailureTypeLicenseNotFound. - Resolution: Use the
--purchaseflag with download commands, runipatool purchaseseparately, or authenticate with an Apple ID that already owns the license. - IPATool does not bypass Apple's licensing; it requires the same entitlements as the official App Store.
Frequently Asked Questions
What does ErrLicenseRequired mean in IPATool?
ErrLicenseRequired means the Apple ID currently authenticated with IPATool does not have a valid license (purchase record) for the app you are attempting to download. The Apple App Store API explicitly returns a FailureTypeLicenseNotFound response, which IPATool translates into this error.
How do I fix the "license is required" error when downloading IPAs?
Add the --purchase flag to your download command (e.g., ipatool download --bundle-id com.example.app --purchase) to automatically acquire the license before downloading. Alternatively, run ipatool purchase --bundle-id com.example.app first, or switch to an Apple ID that already owns the app using ipatool auth login.
Can I download paid apps with IPATool without purchasing?
No. IPATool requires the same valid license as the official App Store. The tool cannot bypass Apple's digital rights management or licensing requirements. You must either purchase the app through IPATool's purchase command or use an Apple ID that has previously bought the application.
Where is ErrLicenseRequired defined in the IPATool source code?
The error is defined as a package-level variable in pkg/appstore/appstore_download.go at line 18: var ErrLicenseRequired = errors.New("license is required"). It is returned at line 65–66 when the API response contains FailureTypeLicenseNotFound.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →