下载应用 ipa 包,不妨试试这款开源工具

知识小集

共 2915字,需浏览 6分钟

 · 2022-03-05

开发人员经常有这样一个需求,将目前应用的 ipa 包下载下来,做一些研究性工作。这里就给大家推荐一款开源的 ipa 下载工具:ipatool。ipatool 是一个命令行工具,可让您在 App Store 上搜索 iOS 应用程序并下载应用程序包的 ipa 文件。这个工具是用 Swift 开发的,目前在 Github 上有 1.6k 个 star 和 145 个 fork,最新版本是 1.0.8。



这款开源工具需要运行在 macOS 10.15 或更高版本的系统上。同时需要设置 Apple ID 以使用 App Store。

安装

该工具可以通过手动和 Homebrew 两种方式来安装。如果选择手动安装,可以从 GitHub 版本(点击阅读原文进入 Github)中获取最新版本的 ipatool。如果使用 Homebrew 安装,可以使用以下命令:


$ brew tap majd/repo
$ brew install ipatool

使用

要在 App Store 上搜索应用程序,请使用搜索命令。


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

USAGE: ipatool search [--limit ] [--country ] [--device-family ] [--log-level <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 <log-level> The log level. (default: info)
--version Show the version.
-h, --help Show help information.


要下载 ipa 文件的副本,请使用 download 命令。


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

USAGE: ipatool download --bundle-identifier [--email ] [--password ] [--auth-code ] [--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.
--auth-code The 2FA code 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.


注意:您可以在使用该工具时将 Apple ID 电子邮件地址和用户名指定为参数,或者将它们设置为环境变量(IPATOOL_EMAIL 和 IPATOOL_PASSWORD)。如果您未使用其中任何一种方法指定此信息,则该工具将在交互式会话中提示用户输入。同样,您可以以交互方式或使用环境变量 IPATOOL_2FA_CODE 提供 2FA 代码。

常见疑问

在使用这款工具时,可能会有一些疑问,这里可以参考一下:


用户的 Apple ID 凭据是否安全存储?

该工具不会将用户的凭据存储在任何地方,它只会直接与 Apple 服务器通信。这个可以通过阅读源码查看。


用户的 Apple ID 会因为使用此工具而被标记吗?

也许,但可能不是。虽然这个工具直接与 iTunes 和 App Store 通信,模仿 iTunes 在 macOS 上运行的行为,但作者不能保证它的安全性。所以建议使用一次性 Apple ID。使用此工具需要用户自担风险。(所以,这个工具的参考意义可能大于实际意义)


用户可以使用此工具下载付费应用程序而无需付费吗?

不可以,这不是盗版工具;用户只能下载之前安装在 iOS 设备上的应用程序。此限制也适用于免费应用程序。本质上,用户的帐户必须已经拥有尝试下载的应用程序的许可证。


用户可以使用此工具在 Apple Silicon Mac 上加载不受支持的 iOS 应用程序吗?

虽然以前可以使用此工具下载 ipa 文件并将其安装在运行 Apple Silicon 的 Mac 上,但最近已不再是这种情况。Apple 停止为应用程序包提供 macOS 兼容的 sinf 数据。但是,用户可以使用此工具获取 iOS 应用程序的副本,并使用越狱的 iOS 设备去除任何代码签名要求,然后使用临时签名再次对应用程序进行代码签名以在 Apple Silicon 上运行。

浏览 59
点赞
评论
收藏
分享

手机扫一扫分享

举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

举报