Files
tldr/pages.zh/common/bundletool.md

37 lines
1.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# bundletool
> 操作 Android 应用包。
> 一些子命令如 `validate` 有自己的使用文档。
> 更多信息:<https://developer.android.com/tools/bundletool>。
- 显示子命令的帮助信息:
`bundletool help {{subcommand}}`
- 从应用包生成 APK提示输入密钥库密码
`bundletool build-apks --bundle {{path/to/bundle.aab}} --ks {{path/to/key.keystore}} --ks-key-alias {{key_alias}} --output {{path/to/file.apks}}`
- 从应用包生成 APK并提供密钥库密码
`bundletool build-apks --bundle {{path/to/bundle.aab}} --ks {{path/to/key.keystore}} --ks-key-alias {{key_alias}} --ks-pass {{pass:the_password}} --output {{path/to/file.apks}}`
- 生成仅包含一个通用 APK 的 APK
`bundletool build-apks --bundle {{path/to/bundle.aab}} --mode {{universal}} --ks {{path/to/key.keystore}} --ks-key-alias {{key_alias}} --output {{path/to/file.apks}}`
- 将合适的 APK 组合安装到模拟器或设备上:
`bundletool install-apks --apks {{path/to/file.apks}}`
- 估算应用的下载大小:
`bundletool get-size total --apks {{path/to/file.apks}}`
- 为模拟器或设备生成设备规格 JSON 文件:
`bundletool get-device-spec --output {{path/to/file.json}}`
- 验证一个包并显示详细信息:
`bundletool validate --bundle {{path/to/bundle.aab}}`