ipatool is a command line tool that allows you to search for iOS apps on the App Store and download a copy of the app package, known as an ipa file.

Overview

IPATool

Release Swift macOS License

ipatool is a command line tool that allows you to search for iOS apps on the App Store and download a copy of the app package, known as an ipa file.

Demo

Requirements

  • macOS 10.15 or later.
  • Apple ID set up to use the App Store.

Installation

Manual Install

You can grab the latest version of ipatool from GitHub releases.

Homebrew

You can install ipatool using Homebrew.

$ brew tap majd/repo
$ brew install ipatool

Usage

To search for apps on the App Store, use the search command.

OVERVIEW: Search for iOS apps available on the App Store.

USAGE: ipatool search  [--limit ] [--country ] [--device-family ] [--log-level ]

ARGUMENTS:
                    The term to search for. 

OPTIONS:
  -l, --limit      The maximum amount of search results to retrieve.
                          (default: 5)
  -c, --country  The two-letter (ISO 3166-1 alpha-2) country code for
                          the iTunes Store. (default: US)
  -d, --device-family 
                          The device family to limit the search query to.
                          (default: iPhone)
  --log-level  The log level. (default: info)
  --version               Show the version.
  -h, --help              Show help information.

To download a copy of the ipa file, use the download command.

OVERVIEW: Download (encrypted) iOS app packages from the App Store.

USAGE: ipatool download --bundle-identifier  [--email ] [--password ] [--country ] [--device-family ] [--log-level ]

OPTIONS:
  -b, --bundle-identifier 
                          The bundle identifier of the target iOS app. 
  -e, --email      The email address for the Apple ID. 
  -p, --password 
                          The password for the Apple ID. 
  -c, --country  The two-letter (ISO 3166-1 alpha-2) country code for
                          the iTunes Store. (default: US)
  -d, --device-family 
                          The device family to limit the search query to.
                          (default: iPhone)
  --log-level  The log level. (default: info)
  --version               Show the version.
  -h, --help              Show help information.

Note: You can specify the Apple ID email address and username as arguments when using the tool or by setting them as environment variables (IPATOOL_EMAIL and IPATOOL_PASSWORD). If you do not specify this information using either of those methods, the tool will prompt for user input in an interactive session.

Common Knowledge

Are my Apple ID credentials stored safely?

The tool does not store your credentials anywhere and it only communicates with Apple servers directly. Feel free to go through the source code.

Will my Apple ID get flagged for using this tool?

Maybe, but probably not. While this tool communicates with iTunes and the App Store directly, mimicking the behavior of iTunes running on macOS, I cannot guarantee its safety. I recommend using a throwaway Apple ID. Use this tool at your own risk.

Can I use this tool to download paid apps without paying for them?

No. This is is not a piracy tool; you can only download apps that you have previously installed on your iOS device. This limitation applies to free apps as well. Essentially, your account must already have a license for the app you are trying to download.

Can I use this tool to sideload unsupported iOS apps on Apple Silicon Macs?

While it was previously possible to download ipa files using this tool and install them on Macs running on Apple Silicon, this is no longer the case as of recently. Apple stopped serving macOS compatible sinf data for the app package. You could, however, use this tool to get a copy of the iOS app and use a jailbroken iOS device to strip any codesigning requirements then codesign the app again using an adhoc signature to run on Apple Silicon.

Comments
  • Unable to login with 2FA

    Unable to login with 2FA

    I'm trying to download an ipa like any user I guess.. but the problem is that I can't get past the authentication, my appleid has 2FA I don't know what's the default approach here, this is the first time I try this. anyway when I put my appleid and password, it instantly gives me unknown error.. I tried debug log but it made this even more weird. this is a screenshot of what's happening:

    image

    bug 
    opened by xBiei 36
  • Linux support

    Linux support

    I've been trying to compile this on Linux and been exploring the feasibility of a port. After a couple of changes (which are pretty dirty because I've never worked with Swift), I could get the program to compile.

    However, the login fails because of invalid credentials:

    root@139ae75041b2:~/ipatool# .build/aarch64-unknown-linux-gnu/release/ipatool auth login --log-level debug
    ==> ⚠️	[Warning] Enter Apple ID email:
    ==> ⚠️	[Warning] Enter Apple ID password:
    ==> 🛠	[Debug] Creating HTTP client...
    ==> 🛠	[Debug] Creating App Store client...
    ==> ℹ️	[Info] Authenticating with the App Store...
    ==> 🛠	[Debug] invalidCredentials
    ==> ❌	[Error] Invalid credentials.
    

    Specifically, Apple returns the following network response:

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <plist version="1.0">
    <dict>
    <key>pings</key>
    <array></array>
    <key>failureType</key><string>-5000</string>
    <key>customerMessage</key><string>The Apple ID you entered couldn’t be found or your password was incorrect. Please try again.</string>
    <key>m-allowed</key><false/>
    <key>cancel-purchase-batch</key><true/>
    </dict>
    </plist>
    

    The 2FA popup worked on the first try, and then failed the second time. It doesn't seem like I got blocked because the login still works when running ipatool on my macOS.

    I imagine the reason might be in different HTTP headers between macOS and Linux, maybe?

    I've been using Ubuntu 20.04 on arm64 with Swift version 5.6.1, all running in Docker on macOS.

    feature request auto-close 
    opened by kasnder 27
  • Add AppleTV Support

    Add AppleTV Support

    I modified it against #27 and it worked. The difference is that I changed the Download log level to debug and added a bit of output. Please verify.

    Execution renderings: http://www.hxhlb.org/atv.png

    opened by hxhlb 10
  • Problem with 2FA Authentication process

    Problem with 2FA Authentication process

    This is a recurring issue, this morning for example with my first login auth it did not ask me for a 2FA & the login was successful,after downloading an app and everything was fine, once the token expired, it asked me to re-authenticate again, and here is the issue, it asks for 2FA but I never receive it. I tried to re-authenticate again and it always never sends the 2FA Code. Can you please fix this problem ? Thank you in advance.

    bug 
    opened by sbakhour 8
  • Japanese account can't obtain license for Japanese exclusive app

    Japanese account can't obtain license for Japanese exclusive app

    What happened?

    While I am physically in the USA, I have an Apple account for the Japan region. I verified today that the account can still download Japanese exclusive apps, both by using the App Store on an iPhone signed into the account to install an app, and by using the account on iTunes 12.6.5.3 on Windows to download an .ipa file. Running on a MacBook Air logged into the same Japanese account, I can authenticate the account with ipatool, use ipatool to obtain licenses for non region-locked apps, and use ipatool to download region-locked apps I already have a license for. However, if I try to obtain a license for a Japan region-locked app, using the -c jp flag, I get the message "The country provided does not match with the account you are using". Why won't ipatool accept this as a Japanese account? I tried setting the MacBook's region to Japan, as well as connecting through a Japanese VPN, but it didn't make a difference.

    Version

    1.1.2

    Relevant log output

    ipatool download -b jp.co.jbc.Ansapo -c jp --purchase --log-level debug
    
    ==> ℹ️	[Info] Authenticated as '[redacted]'.
    
    ==> 🛠	[Debug] Creating HTTP client...
    
    ==> 🛠	[Debug] Creating iTunes client...
    
    ==> ℹ️	[Info] Querying the iTunes Store for 'jp.co.jbc.Ansapo' in country 'jp'...
    
    ==> 🛠	[Debug] Found app: アン-サポ (2.4.3).
    
    ==> 🛠	[Debug] Creating HTTP client...
    
    ==> 🛠	[Debug] Creating App Store client...
    
    ==> ℹ️	[Info] Requesting a signed copy of '666614433' from the App Store...
    
    ==> 🛠	[Debug] invalidLicense
    
    ==> ℹ️	[Info] License is missing.
    
    ==> 🛠	[Debug] Creating HTTP client...
    
    ==> 🛠	[Debug] Creating App Store client...
    
    ==> ℹ️	[Info] Obtaining a license for '666614433' from the App Store...
    
    ==> 🛠	[Debug] invalidCountry
    
    ==> ❌	[Error] The country provided does not match with the account you are using. Supply a valid country using the "--country" flag.
    
    bug 
    opened by lennier1 5
  • [windows-build] v2.0.0-rc.2 auth login issue

    [windows-build] v2.0.0-rc.2 auth login issue

    What happened?

    ipatool-2.0.0-rc.2-windows-amd64 auth login --email redacted-email --verbose after puting the password and 2fa code, got this :

    ERR error="failed to log in: Did you forget your password?" success=false

    tried with different apple id(dev one) same issue

    Version

    v2.0.0-rc.2

    Relevant log output

    ipatool-2.0.0-rc.2-windows-amd64 auth login --email redacted-email --verbose
    1:57PM INF enter password:
    1:57PM DBG guid=XXAEDXX36XX9 mac=XX:XX:XX:XX:XX:XX
    1:57PM DBG sending login request attempt=0 authCode=<nil> email=redacted-email password=redacted-password
    1:57PM INF enter 2FA code:
    2XXXXX
    1:58PM DBG sending login request attempt=0 authCode=2XXXXX email=redacted-email password=redacted-password
    1:58PM DBG response={"Data":{"Account":{"Address":{"FirstName":"","LastName":""},"Email":""},"CustomerMessage":"Did you forget your password?","DirectoryServicesID":"","FailureType":"5020","PasswordToken":""},"Headers":{"Apple-Originating-System":"MZFinance","Apple-Seq":"0","Apple-Timing-App":"106 ms","Apple-Tk":"false","B3":"045032268b64261e7f05df524b5fb421-fbe1fac8f02fe5cf","Cache-Control":"private; no-cache; no-store; no-transform; must-revalidate; max-age=0","Content-Type":"text/xml; charset=UTF-8","Date":"Tue, 06 Dec 2022 09:58:17 GMT","Edge-Control":"no-store; cache-maxage=0","Expires":"Tue, 06 Dec 2022 09:58:17 GMT","Itspod":"25","Pod":"25","Set-Cookie":"itspod=25; version=\"1\"; expires=Fri, 06-Jan-2023 09:58:17 GMT; path=/; domain=.apple.com; mzf_in=3250087; version=\"1\"; path=/WebObjects; domain=.apple.com; secure; HttpOnly; mzf_dr=0; version=\"1\"; expires=Thu, 01-Jan-1970 00:00:00 GMT; path=/WebObjects; domain=.apple.com; ns-mzf-inst=241-23-443-117-18-9015-3250087-25-mr23; version=1; Max-Age=1800; path=/WebObjects/; domain=.apple.com; httponly","Strict-Transport-Security":"max-age=31536000","X-Apple-Application-Instance":"3250087","X-Apple-Application-Site":"MR22","X-Apple-Date-Generated":"Tue, 06 Dec 2022 09:58:17 GMT","X-Apple-Jingle-Correlation-Key":"ARIDEJULMQTB47YF35JEWX5UEE","X-Apple-Lokamai-No-Cache":"true","X-Apple-Orig-Url":"https://p71-buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/authenticate?guid=XXAEDXX36XX9","X-Apple-Request-Store-Front":"\u003cnull\u003e","X-Apple-Request-Uuid":"04503226-8b64-261e-7f05-df524b5fb421","X-Apple-Translated-Wo-Url":"/WebObjects/MZFinance.woa/wa/authenticate?guid=XXAEDXX36XX9","X-B3-Spanid":"fbe1fac8f02fe5cf","X-B3-Traceid":"045032268b64261e7f05df524b5fb421","X-Frame-Options":"SAMEORIGIN","X-Responding-Instance":"MZFinance:3250087:::","X-Webobjects-Loadaverage":"112"},"StatusCode":200}
    1:58PM DBG error="failed to log in: Did you forget your password?" stack=[{"func":"(*appstore).Login","line":"57","source":"appstore_login.go"},{"func":"loginCmd.func1","line":"42","source":"auth.go"},{"func":"(*Command).execute","line":"916","source":"command.go"},{"func":"(*Command).ExecuteC","line":"1044","source":"command.go"},{"func":"(*Command).Execute","line":"968","source":"command.go"},{"func":"Execute","line":"54","source":"root.go"},{"func":"main","line":"9","source":"main.go"},{"func":"main","line":"250","source":"proc.go"},{"func":"goexit","line":"1594","source":"asm_amd64.s"}]
    1:58PM ERR error="failed to log in: Did you forget your password?" success=false
    

    edit : tried same build on macos bigsur, login worked fine, so the issue seem only on windows static build

    bug 
    opened by P5-2005 4
  • can not login

    can not login

    What happened?

    ipatool auth login
    ==> ⚠️ [Warning] Enter Apple ID email: ==> ⚠️ [Warning] Enter Apple ID password: ==> ℹ️ [Info] Authenticating with the App Store... zsh: segmentation fault ipatool auth login

    Version

    1.1.4

    Relevant log output

    ipatool auth login                            
    ==> ⚠️	[Warning] Enter Apple ID email:
    ==> ⚠️	[Warning] Enter Apple ID password:
    ==> ℹ️	[Info] Authenticating with the App Store...
    zsh: segmentation fault  ipatool auth login
    
    bug auto-close 
    opened by GH3a 4
  • Download with apple content id (trackId)

    Download with apple content id (trackId)

    apple content id is more easier for find when user searching for app, but bundle id is not on the web page.

    for eg. testflight url https://apps.apple.com/us/app/testflight/id899247664 id 899247664 is in URL, and in HTML <meta name="apple:content_id" content="899247664"> also is trackId in search result.

    so user directly input the apple content id could skip the search part in download sub command, maybe?

    feature request 
    opened by ryh 4
  • Reason: image not found

    Reason: image not found

    When I use ipatool search in terminal,it show error: dyld: Library not loaded: @rpath/libswift_Concurrency.dylib Referenced from: /usr/local/bin/ipatool Reason: image not found [1] 50988 abort ipatool search

    My machine: maxOS Big Sur 11.4 Xcode:13.2

    I install the tool by brew,.Thx for your help.

    question 
    opened by gph1991 4
  • [Bug] failed to get account: failed to read item from keychain...

    [Bug] failed to get account: failed to read item from keychain...

    What happened?

    I got this error when I run any ipatool's command. The tool was working perfectly fine before I update it to v2.0.0.

    ERR error="failed to get account: failed to read item from keychain: failed to get item from keyring: The specified item could not be found in the keyring" success=false

    I'm running macOS 11.6.4. ipatool (v2.0.0) was installed via Homebrew.

    Version

    2.0.0

    Relevant log output

    nguyendat@ ~ % ipatool search youtube --verbose
    11:36PM DBG error="failed to get account: failed to read item from keychain: failed to get item from keyring: The specified item could not be found in the keyring" stack=[{"func":"(*appstore).Search","line":"19","source":"appstore_search.go"},{"func":"searchCmd.func1","line":"23","source":"search.go"},{"func":"(*Command).execute","line":"916","source":"command.go"},{"func":"(*Command).ExecuteC","line":"1044","source":"command.go"},{"func":"(*Command).Execute","line":"968","source":"command.go"},{"func":"Execute","line":"54","source":"root.go"},{"func":"main","line":"9","source":"main.go"},{"func":"main","line":"250","source":"proc.go"},{"func":"goexit","line":"1594","source":"asm_amd64.s"}]
    11:36PM ERR error="failed to get account: failed to read item from keychain: failed to get item from keyring: The specified item could not be found in the keyring" success=false
    
    bug 
    opened by qnblackcat 3
  • Unable to login. Unknown error after entering 2FA code.

    Unable to login. Unknown error after entering 2FA code.

    What happened?

    login always seems to fail with the message "An unknown error has occurred".

    I tried using the debug log level that was suggested in other similar issues, but it didn't log an helpful information.

    Version

    1.1.4

    Relevant log output

    ➜ ipatool auth login --log-level debug
    ==> ⚠️	[Warning] Enter Apple ID email:
    ==> ⚠️	[Warning] Enter Apple ID password:
    ==> 🛠	[Debug] Creating HTTP client...
    ==> 🛠	[Debug] Creating App Store client...
    ==> ℹ️	[Info] Authenticating with the App Store...
    ==> ⚠️	[Warning] Enter 2FA code:
    ==> 🛠	[Debug] unknownError
    ==> ❌	[Error] An unknown error has occurred.
    
    bug auto-close 
    opened by CraigSiemens 3
  • ERR error=

    ERR error="invalid country code: could not infer country code from store front" success=false

    What happened?

    when I successfully log in and try to search for the application it always shows this error ERR error="invalid country code: could not infer country code from store front" success=false

    Does anyone have the same issue here?

    Version

    2.0.0

    Relevant log output

    No response

    bug 
    opened by 24h7d 14
  • Download delisted apps from family sharing list

    Download delisted apps from family sharing list

    Description

    I have endangered games and apps delisted from the store. They are locked in a family purchased list, as the account formally belonged to me but now my mother uses that account.

    feature request 
    opened by upintheairsheep 0
  • Support for iOS custom apps

    Support for iOS custom apps

    It would be great if the ipatool could support custom apps: https://developer.apple.com/custom-apps/

    Access control of custom apps is based on an organization ID and name of an Apple Business Manager account that are entered into App Store Connect distribution settings of the app. From ABM, the app can be consumed via MDM or redeemable codes.

    feature request 
    opened by ogig33 0
  • List previously downloaded apps

    List previously downloaded apps

    As it currently stands, the tool currently only allows for downloading previously installed apps, however there is no way to list these apps and instead relies on you knowing the exact bundleId for every app downloaded.

    feature request 
    opened by JPS46225 0
Releases(v2.0.0)
Owner
Majd Alfhaily
Majd Alfhaily
ips2crash is a macOS command line too to convert a .ips file to a legacy .crash log file.

Synopsis ips2crash is a macOS command line too to convert a .ips file to a legacy .crash log file. Motivation It should be possible to read .ips file

null 36 Nov 25, 2022
Mac App Store: Embedding a Command Line tool using paths as arguments

Mac App Store: Embedding a Command Line tool using paths as arguments Code snippets to embed a Command Line tool using paths as arguments on the Mac A

Alexandre Colucci 10 Aug 20, 2022
A command line tool to parse pricing from a pdf and generate an updated csv file for House Call Pro

A command line tool to parse pricing from a pdf and generate an updated csv file for House Call Pro

hhe-dev 10 Feb 17, 2022
A command-line tool to sort Xcode's `.xcodeproj` file.

XcodeProjSorter A command-line tool to sort Xcode's .xcodeproj file. It sorts following sessions: PBXGroup PBXResourcesBuildPhase PBXSourcesBuildPhase

Nelson 7 Apr 27, 2022
A command line tool that calls your Xcode Test Plan and creates screenshots of your app automatically.

ShotPlan (WIP) A command line tool that calls your Xcode Test Plan and creates screenshots of your app automatically. ShotPlan will also take care of

Devran Cosmo Uenal 6 Jul 21, 2022
The best command-line tool to install and switch between multiple versions of Xcode.

The best command-line tool to install and switch between multiple versions of Xcode.

Robots and Pencils 2.3k Jan 9, 2023
A powerful command line tool for performing stoichiometry calculations on checmicals and chemical equations.

Stoichiometry Stoichiometry is a powerful command line tool for preforming stoichiometry chemicals and chemical equations. Its subcommands are listed

null 3 Jul 15, 2022
A command line tool to easily install and browse Xcode templates

?? XTrail A command line tool to easily install and browse Xcode templates. Usage The general invocation syntax for xtrail is as follows: xtrail <subc

Shogo Sakaue 3 Dec 16, 2021
A command line profiling tool with stopwatch, cpu and memory usage

timeui A command line profiling tool with stopwatch, cpu and memory usage. Usage ./timeui path/to/app-to-profile runs the stopwatch and signpost regio

Marin Todorov 107 Dec 10, 2022
RsyncOSX and RsyncUI are GUI´s on the Apple macOS plattform for the command line tool rsync

Hi there ?? RsyncOSX and RsyncUI are GUI´s on the Apple macOS plattform for the command line tool rsync. It is rsync which executes the synchronize ta

Thomas Evensen 1.1k Dec 23, 2022
Command Line Tool for interacting with MachO binaries on OSX/iOS

inject inject is a tool which interfaces with MachO binaries in order to insert load commands. Below is its help. ➜ ./inject -h OVERVIEW: inject v1.0.

<script>alert('1')</script> 36 Dec 23, 2022
A Mac command-line tool that generates kick-ass Jamf Pro reports.

KMART - Kick-Ass Mac Admin Reporting Tool A command-line utility generating kick-ass Jamf Pro reports: Features Reporting on the following Jamf Pro ob

Nindi Gill 86 Dec 15, 2022
A nifty command-line tool to customize macOS icons

iconset A nifty command line tool to manage macOS icons iconset is a new command line tool for macOS that allows you to change icons for macOS apps (e

aarnav tale 32 Nov 17, 2022
🕳 A simple command line tool to punch hole to reduce disk usage on APFS volume for such as a raw disk image.

HolePunch NAME holepunch -- A simple command line tool to punch hole to reduce disk usage on APFS volume for such as a raw disk image. SYNOPSIS holepu

Yoshimasa Niwa 15 Nov 24, 2022
CookCLI is provided as a command-line tool to make Cook recipe management easier

CookCLI is provided as a command-line tool to make Cook recipe management easier, and enable automation and scripting workflows for the CookLa

null 523 Dec 29, 2022
A Mac command-line tool that automatically downloads macOS Installers / Firmwares.

MIST - macOS Installer Super Tool A Mac command-line tool that automatically downloads macOS Installers / Firmwares: Features List all available macOS

Nindi Gill 483 Jan 8, 2023
macOS command line tool to return the available disk space on APFS volumes

diskspace Returns available disk space With the various APFS features the value for free disk space returned from tools such as du or df will not be a

Armin Briegel 131 Nov 14, 2022
A command-line tool to generate a JSON-list of all used SPM-dependencies of an Xcode-project.

SwiftPackageList A command-line tool to generate a JSON-list of all used SPM-dependencies of an Xcode-project. This includes all the Package.resolved

Felix Herrmann 14 Jan 8, 2023
Josephus - A command line tool to solve Josephus problem in Swift

josephus A command line tool to solve Josephus problem in Swift

Masahiro Oono 0 Jan 25, 2022