gplay-cli-usage
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGoogle Play CLI usage
Google Play CLI使用指南
Use this skill when you need to run or design commands for Google Play Console.
gplay当你需要为Google Play Console运行或设计命令时可使用本技能。
gplayCommand discovery
命令发现
- Always use to discover commands and flags.
--helpgplay --helpgplay tracks --helpgplay tracks list --help
- 始终使用来查找命令和参数:
--helpgplay --helpgplay tracks --helpgplay tracks list --help
Available commands
可用命令
| Command | Description |
|---|---|
| Authentication and profile management |
| List and manage apps in the developer account |
| Initialize a project with default config |
| High-level release workflow |
| Promote releases between tracks |
| Manage staged rollouts |
| Track management |
| Bundle (AAB) management |
| Edit session management |
| Store listing management |
| Screenshot and image management |
| Metadata sync (import/export) |
| Offline validation of metadata |
| App vitals monitoring (crashes, performance, errors) |
| User management for developer account |
| App-level permission grants |
| Financial and statistics reports (list/download from GCS) |
| Generate CLI documentation |
| Migration tools (e.g., from Fastlane) |
| Send notifications (e.g., Slack, webhook) |
| Self-update the CLI binary |
| Command | 描述 |
|---|---|
| 认证与配置文件管理 |
| 列出并管理开发者账号下的应用 |
| 用默认配置初始化项目 |
| 高层级发布工作流 |
| 在不同发布轨道间升级版本 |
| 管理分阶段发布 |
| 发布轨道管理 |
| Bundle (AAB) 管理 |
| 编辑会话管理 |
| 应用商店商品页管理 |
| 截图与图片资源管理 |
| 元数据同步(导入/导出) |
| 元数据离线校验 |
| 应用核心指标监控(崩溃、性能、错误) |
| 开发者账号的用户管理 |
| 应用层级权限授予 |
| 财务与统计报表(从GCS列出/下载) |
| 生成CLI文档 |
| 迁移工具(例如从Fastlane迁移) |
| 发送通知(例如Slack、webhook) |
| CLI二进制文件自更新 |
Flag conventions
参数约定
- Use explicit long flags (e.g., ,
--package).--output - No interactive prompts; destructive operations require .
--confirm - Use when the user wants all pages.
--paginate - Use to preview changes without executing them (supported by
--dry-run,release, and other write commands).migrate
- 优先使用显式的长参数(例如 、
--package)。--output - 无交互式提示;破坏性操作需要添加 参数。
--confirm - 当用户需要获取所有分页内容时使用 。
--paginate - 使用 预览变更而不实际执行(
--dry-run、release等写命令支持该参数)。migrate
Output formats
输出格式
- Default output is minified JSON.
- Use or
--output tableonly for human-readable output.--output markdown - is only valid with JSON output.
--pretty - Set environment variable to change the default output format (e.g.,
GPLAY_DEFAULT_OUTPUT).GPLAY_DEFAULT_OUTPUT=table
- 默认输出为压缩的JSON。
- 仅在需要人类可读的输出时使用 或
--output table。--output markdown - 仅对JSON输出有效。
--pretty - 你可以设置环境变量来修改默认输出格式(例如
GPLAY_DEFAULT_OUTPUT)。GPLAY_DEFAULT_OUTPUT=table
Authentication and defaults
认证与默认配置
- Prefer service account auth via .
gplay auth login --service-account /path/to/sa.json - Fallback env vars: ,
GPLAY_SERVICE_ACCOUNT.GPLAY_PACKAGE - can provide a default package name.
GPLAY_PACKAGE
- 优先使用服务账号认证:。
gplay auth login --service-account /path/to/sa.json - 备选环境变量:、
GPLAY_SERVICE_ACCOUNT。GPLAY_PACKAGE - 可设置默认的包名。
GPLAY_PACKAGE
Timeouts
超时设置
- /
GPLAY_TIMEOUTcontrol request timeouts.GPLAY_TIMEOUT_SECONDS - /
GPLAY_UPLOAD_TIMEOUTcontrol upload timeouts.GPLAY_UPLOAD_TIMEOUT_SECONDS
- /
GPLAY_TIMEOUT控制请求超时时间。GPLAY_TIMEOUT_SECONDS - /
GPLAY_UPLOAD_TIMEOUT控制上传超时时间。GPLAY_UPLOAD_TIMEOUT_SECONDS
Environment Variables
环境变量
| Variable | Purpose |
|---|---|
| Path to service account JSON |
| Default package name |
| Active profile name |
| Request timeout (e.g., |
| Timeout in seconds (alternative) |
| Upload timeout (e.g., |
| Enable debug logging (set to |
| Disable update checks |
| Max retries for failed requests (default: 3) |
| Base delay between retries (default: |
| Default output format ( |
| Variable | 用途 |
|---|---|
| 服务账号JSON文件路径 |
| 默认包名 |
| 生效的配置文件名 |
| 请求超时时间(例如 |
| 以秒为单位的超时时间(替代选项) |
| 上传超时时间(例如 |
| 开启调试日志(设为 |
| 禁用更新检查 |
| 请求失败的最大重试次数(默认:3) |
| 重试间隔的基础时长(默认: |
| 默认输出格式( |
Common patterns
常见使用场景
List with pagination
带分页的列表查询
bash
gplay tracks list --package com.example.app --paginatebash
gplay tracks list --package com.example.app --paginateParse JSON output with jq
用jq解析JSON输出
bash
gplay tracks list --package com.example.app | jq '.tracks[] | select(.track == "production")'bash
gplay tracks list --package com.example.app | jq '.tracks[] | select(.track == "production")'Use profiles
使用配置文件
bash
gplay auth add-profile production --service-account /path/to/prod-sa.json
gplay auth use-profile production
gplay --profile production tracks list --package com.example.appbash
gplay auth add-profile production --service-account /path/to/prod-sa.json
gplay auth use-profile production
gplay --profile production tracks list --package com.example.appDebug mode
调试模式
bash
GPLAY_DEBUG=1 gplay tracks list --package com.example.app
GPLAY_DEBUG=api gplay tracks list --package com.example.app # HTTP detailsbash
GPLAY_DEBUG=1 gplay tracks list --package com.example.app
GPLAY_DEBUG=api gplay tracks list --package com.example.app # 查看HTTP详情Dry run (preview changes)
试运行(预览变更)
bash
gplay release --package com.example.app --track beta --bundle app.aab --dry-run
gplay migrate fastlane --source ./fastlane/metadata/android --output-dir ./metadata --dry-runbash
gplay release --package com.example.app --track beta --bundle app.aab --dry-run
gplay migrate fastlane --source ./fastlane/metadata/android --output-dir ./metadata --dry-runInitialize a project
初始化项目
bash
gplay init --package com.example.app --service-account /path/to/sa.jsonbash
gplay init --package com.example.app --service-account /path/to/sa.jsonList apps in developer account
列出开发者账号下的应用
bash
gplay apps list --developer-id 1234567890
gplay apps list --developer-id 1234567890 --output tablebash
gplay apps list --developer-id 1234567890
gplay apps list --developer-id 1234567890 --output tableGenerate CLI documentation
生成CLI文档
bash
gplay docs generate --format markdown --output-dir ./docsbash
gplay docs generate --format markdown --output-dir ./docsSelf-update
自更新
bash
gplay update
gplay update --check # Check for updates without installingbash
gplay update
gplay update --check # 仅检查更新不安装Financial reports
财务报表
bash
gplay reports financial list --developer <id>
gplay reports financial list --developer <id> --type earnings --from 2026-01 --to 2026-06
gplay reports financial download --developer <id> --from 2026-01 --type earnings --dir ./reportsbash
gplay reports financial list --developer <id>
gplay reports financial list --developer <id> --type earnings --from 2026-01 --to 2026-06
gplay reports financial download --developer <id> --from 2026-01 --type earnings --dir ./reportsStatistics reports
统计报表
bash
gplay reports stats list --developer <id>
gplay reports stats list --developer <id> --package com.example.app --type installs
gplay reports stats download --developer <id> --package com.example.app --from 2026-01 --type installs --dir ./reportsbash
gplay reports stats list --developer <id>
gplay reports stats list --developer <id> --package com.example.app --type installs
gplay reports stats download --developer <id> --package com.example.app --from 2026-01 --type installs --dir ./reportsSend notifications
发送通知
bash
gplay notify --webhook https://hooks.slack.com/... --message "Release deployed"bash
gplay notify --webhook https://hooks.slack.com/... --message "Release deployed"Edit sessions
编辑会话
Most write operations require an edit session:
bash
undefined大部分写操作都需要编辑会话:
bash
undefinedCreate edit
创建编辑会话
gplay edits create --package com.example.app
gplay edits create --package com.example.app
Returns: edit_id
返回:edit_id
Make changes
执行变更
gplay bundles upload --package com.example.app --edit <edit_id> --file app.aab
gplay bundles upload --package com.example.app --edit <edit_id> --file app.aab
Commit changes (publishes)
提交变更(发布)
gplay edits commit --package com.example.app --edit <edit_id>
undefinedgplay edits commit --package com.example.app --edit <edit_id>
undefinedHigh-level vs manual commands
高层命令与手动命令对比
- High-level: (creates edit, uploads, commits)
gplay release - Manual: →
gplay edits create→gplay bundles uploadgplay edits commit
Use high-level for simplicity, manual for fine-grained control.
- 高层命令:(自动创建编辑会话、上传资源、提交变更)
gplay release - 手动命令:→
gplay edits create→gplay bundles uploadgplay edits commit
追求简便请使用高层命令,需要细粒度控制请使用手动命令。