使用 Mac 上的 App Store Connect API 生成精辟的应用大小图表和 JSON 度量标准的 CLI
⚖️ steelyard
概述
使用 steelyard,利用 Mac 上的 App Store Connect API,生成洞察深刻的 App 大小图表和 JSON 指标。
安装
Homebrew(推荐)
要使用 Homebrew 安装 steelyard,请运行以下命令:
brew install mcrollin/steelyard/steelyard
Mint
要使用 Mint 安装,请运行以下命令:
mint install mcrollin/steelyard
手动安装
或者,你可以手动构建工具:
swift build -c release --disable-sandbox --product steelyard
或运行它:
swift run steelyard
先决条件
若要使用 steelyard,你需要提供一些从 Apple 开发者门户获取的详细信息。
按照以下步骤创建 API 密钥并检索必要的信息。
步骤 1:创建 API 密钥
- 访问 App Store Connect > 用户和访问权限 > 密钥 > App Store Connect API。
- 单击 + 按钮创建新密钥。
- 为密钥命名,选择
开发者
(或更高)访问角色,然后生成密钥。 - 下载生成的 .p8 文件。
注意:将此文件存储在安全的地方,因为你无法再下载它。
步骤 2:检索密钥和颁发者 ID
- 在列表中找到你的密钥,将鼠标悬停在密钥 ID 上,然后点击
复制密钥 ID
按钮。 - 颁发者 ID 和一个
复制
按钮位于密钥列表正上方,“用户和访问权限”部分下。
步骤 3:找到私钥路径
私钥路径是已下载的 .p8 文件的存储位置。
步骤 4:查找你的应用 ID
应用 ID 可在 App Store Connect > 应用 > 常规 > 应用信息 > 常规信息 > Apple ID 中找到。
命令
对于每个命令,你需要提供以下参数:key-id
、issuer-id
、private-key-path
和 app-id
。
📉 生成大小历史图
创建一个 PNG 图像,显示特定应用的历史大小图。
命令格式如下:
USAGE: steelyard graph [<options>] <key-id> <issuer-id> <private-key-path> <app-id>
ARGUMENTS:
<key-id> The key ID from the Apple Developer portal.
<issuer-id> The issuer ID from the App Store Connect organization.
<private-key-path> The path to the .p8 private key file.
<app-id> The App ID.
OPTIONS:
-l, --limit <limit> Specify the number of items to analyze. (default: 30)
- For builds, the range is 1 to 200.
- For versions, the range is 1 to 50.
--by-version Fetch sizes categorized by version, not build. Slower to retrieve.
--download-size/--no-download-size
Include download sizes. (default: --download-size)
--install-size/--no-install-size
Include install sizes. (default: --install-size)
-o, --output <output> Specify the destination path for the generated file.
-v, --verbose Display all information messages.
--dark-scheme Set to dark color scheme.
--reference-device-identifier <reference-device