分发
Tauri 提供了将你的应用程序分发到平台应用商店或作为特定于平台的安装程序所需的工具。
Tauri 通过其 CLI 的 build、android build 和 ios build 命令直接构建你的应用程序。
npm run tauri buildyarn tauri buildpnpm tauri builddeno task tauri buildbun tauri buildcargo tauri build请参阅 分发 部分,了解有关每个包的可用配置选项以及如何将其分发给用户的更多信息。
默认情况下,build 命令会自动为配置的格式打包你的应用程序。
如果你需要进一步自定义平台包的生成方式,可以将构建和打包步骤分开:
npm run tauri build -- --no-bundle# 为 macOS App Store 以外的分发打包npm run tauri bundle -- --bundles app,dmg# 为 App Store 分发打包npm run tauri bundle -- --bundles app --config src-tauri/tauri.appstore.conf.jsonyarn tauri build --no-bundle# 为 macOS App Store 以外的分发打包yarn tauri bundle --bundles app,dmg# 为 App Store 分发打包yarn tauri bundle --bundles app --config src-tauri/tauri.appstore.conf.jsonpnpm tauri build --no-bundle# 为 macOS App Store 以外的分发打包pnpm tauri bundle --bundles app,dmg# 为 App Store 分发打包pnpm tauri bundle --bundles app --config src-tauri/tauri.appstore.conf.jsondeno task tauri build --no-bundle# 为 macOS App Store 以外的分发打包deno task tauri bundle --bundles app,dmg# 为 App Store 分发打包deno task tauri bundle --bundles app --config src-tauri/tauri.appstore.conf.jsonbun tauri build --no-bundle# 为 macOS App Store 以外的分发打包bun tauri bundle --bundles app,dmg# 为 App Store 分发打包bun tauri bundle --bundles app --config src-tauri/tauri.appstore.conf.jsoncargo tauri build --no-bundle# 为 macOS App Store 以外的分发打包cargo tauri bundle --bundles app,dmg# 为 App Store 分发打包cargo tauri bundle --bundles app --config src-tauri/tauri.appstore.conf.json你的应用程序版本可以在 tauri.conf.json > version 配置选项中定义,这是管理应用程序版本的推荐方法。如果未设置该配置值,Tauri 将使用 src-tauri/Cargo.toml 文件中的 package > version 值。
代码签名通过对应用程序的可执行文件和包应用数字签名来增强应用程序的安全性,从而验证你作为应用程序提供者的身份。
大多数平台都需要签名。有关更多信息,请参阅每个平台的文档。
了解如何为每个平台分发你的应用程序。
对于 Linux,你可以使用 Debian 包、Snap、AppImage、Flatpak、RPM 或 Arch User Repository (AUR) 格式分发你的应用程序。
对于 macOS,你可以直接将应用程序分发到 App Store,或者发布 DMG 安装程序供直接下载。 这两种方法都需要代码签名,而在 App Store 之外分发还需要公证。
代码签名和公证
了解如何分发到 Microsoft Store 或配置 Windows 安装程序。
将你的 Android 应用程序分发到 Google Play。
了解如何将你的应用程序上传到 App Store。
将你的应用程序分发到全球分发应用程序并开箱即用地支持自动更新的云服务。
© 2025 Tauri Contributors. CC-BY / MIT