Google Play
Google Play 是由 Google 维护的 Android 应用分发服务。
本指南涵盖了在 Google Play 上发布 Android 应用的要求。
要在 Play 商店分发 Android 应用,您必须创建一个 Play 管理中心 (Play Console) 开发者账号。
此外,您必须设置 代码签名。
有关更多信息,请参阅 发布清单 (release checklist)。
运行 tauri android init 设置好 Android Studio 项目后,您可以使用 tauri icon 命令更新应用图标。
npm run tauri icon /path/to/app-icon.pngyarn tauri icon /path/to/app-icon.pngpnpm tauri icon /path/to/app-icon.pngdeno task tauri icon /path/to/app-icon.pngbun tauri icon /path/to/app-icon.pngcargo tauri icon /path/to/app-icon.png创建 Play 管理中心开发者账号后,您需要在 Google Play 管理中心 网站上注册您的应用。该网站将引导您完成所有必要的表格填写和设置任务。
您可以运行以下命令构建 Android App Bundle (AAB) 以上传至 Google Play
npm run tauri android build -- --aabyarn tauri android build --aabpnpm tauri android build --aabdeno task tauri android build --aabbun tauri android build --aabcargo tauri android build --aabTauri 从 tauri.conf.json > version 中定义的数值推导版本代码 (versionCode = 主版本号*1000000 + 次版本号*1000 + 修订号)。如果您需要不同的版本代码方案(例如连续的代码),可以在 [tauri.conf.json > bundle > android > versionCode] 配置中设置自定义版本代码。
{ "bundle": { "android": { "versionCode": 100 } }}AAB 格式是推荐上传至 Google Play 的包文件,但也可以生成用于测试或在商店外分发的 APK。要为您的应用编译 APK,可以使用 --apk 参数
npm run tauri android build -- --apkyarn tauri android build --apkpnpm tauri android build --apkdeno task tauri android build --apkbun tauri android build --apkcargo tauri android build --apk默认情况下,Tauri 会为所有受支持的架构(aarch64、armv7、i686 和 x86_64)构建您的应用。如果仅编译目标架构的子集,可以使用 --target 参数
npm run tauri android build -- --aab --target aarch64 --target armv7yarn tauri android build --aab --target aarch64 --target armv7pnpm tauri android build --aab --target aarch64 --target armv7deno task tauri android build --aab --target aarch64 --target armv7bun tauri android build --aab --target aarch64 --target armv7cargo tauri android build --aab --target aarch64 --target armv7默认情况下,生成的 AAB 和 APK 是通用的,包含所有受支持的目标。若要为每个目标生成单独的包,请使用 --split-per-abi 参数。
npm run tauri android build -- --apk --split-per-abiyarn tauri android build --apk --split-per-abipnpm tauri android build --apk --split-per-abideno task tauri android build --apk --split-per-abibun tauri android build --apk --split-per-abicargo tauri android build --apk --split-per-abiTauri 应用支持的最低 Android 版本是 Android 7.0(代号 Nougat,SDK 24)。
有一些技术可以在支持旧系统的同时使用较新的 Android API。有关更多信息,请参阅 Android 文档。
如果您的应用必须在较新的 Android 版本上运行,您可以配置 [tauri.conf.json > bundle > android > minSdkVersion]
{ "bundle": { "android": { "minSdkVersion": 28 } }}构建应用并生成 Android App Bundle 文件(位于 gen/android/app/build/outputs/bundle/universalRelease/app-universal-release.aab)后,您现在可以在 Google Play 管理中心创建新版本并上传它。
首次上传必须在网站上手动完成,以便它验证您的应用签名和包标识符。Tauri 目前不提供自动化创建 Android 版本流程的方法,该过程必须利用 Google Play Developer API,但这属于正在进行中的工作。
© 2026 Tauri 贡献者。CC-BY / MIT