分发
Tauri 提供了将应用分发到平台应用商店或作为平台特定安装程序所需的工具。
¥Tauri provides the tooling you need to distribute your application either to the platform app stores or as platform-specific installers.
¥Building
Tauri 通过 build
、android build
和 ios build
命令直接从其 CLI 构建你的应用。
¥Tauri builds your application directly from its CLI via the build
, android build
and ios build
commands.
npm run tauri build
yarn tauri build
pnpm tauri build
deno task tauri build
bun tauri build
cargo tauri build
有关针对流数据优化的实现,请参阅 distributing。
¥See the distributing section to learn more about the configuration options available for each bundle and how to distribute them to your users.
:::note 注意
大多数平台都需要代码签名。有关更多信息,请参阅 signing 部分。
¥Most platforms requires code signing. See the signing section for more information.
:::
¥Bundling
默认情况下,build
命令会自动为配置的格式打包你的应用。
¥By default the build
command automatically bundles your application for the configured formats.
如果你需要进一步定制平台打包包的生成方式,可以拆分构建和打包步骤:
¥If you need further customization on how the platform bundles are generated, you can split the build and bundle steps:
npm run tauri build -- --no-bundle# bundle for distribution outside the macOS App Storenpm run tauri bundle -- --bundles app,dmg# bundle for App Store distributionnpm run tauri bundle -- --bundles app --config src-tauri/tauri.appstore.conf.json
yarn tauri build --no-bundle# bundle for distribution outside the macOS App Storeyarn tauri bundle --bundles app,dmg# bundle for App Store distributionyarn tauri bundle --bundles app --config src-tauri/tauri.appstore.conf.json
pnpm tauri build --no-bundle# bundle for distribution outside the macOS App Storepnpm tauri bundle --bundles app,dmg# bundle for App Store distributionpnpm tauri bundle --bundles app --config src-tauri/tauri.appstore.conf.json
deno task tauri build --no-bundle# bundle for distribution outside the macOS App Storedeno task tauri bundle --bundles app,dmg# bundle for App Store distributiondeno task tauri bundle --bundles app --config src-tauri/tauri.appstore.conf.json
bun tauri build --no-bundle# bundle for distribution outside the macOS App Storebun tauri bundle --bundles app,dmg# bundle for App Store distributionbun tauri bundle --bundles app --config src-tauri/tauri.appstore.conf.json
cargo tauri build --no-bundle# bundle for distribution outside the macOS App Storecargo tauri bundle --bundles app,dmg# bundle for App Store distributioncargo tauri bundle --bundles app --config src-tauri/tauri.appstore.conf.json
¥Versioning
你的应用版本可以在 tauri.conf.json > version
配置选项中定义,这是管理应用版本的推荐方式。如果未设置该配置值,Tauri 将改用 src-tauri/Cargo.toml
文件中的 package > version
值。
¥Your application version can be defined in the tauri.conf.json > version
configuration option,
which is the recommended way for managing the app version. If that config value is not set,
Tauri uses the package > version
value from your src-tauri/Cargo.toml
file instead.
:::note 注意
某些平台对版本字符串有一些限制和特殊情况。请参阅各个分发文档页面以获取更多信息。
¥Some platforms have some limitations and special cases for the version string. See the individual distribution documentation pages for more information.
:::
¥Signing
代码签名通过对应用的可执行文件和打包包应用数字签名来增强应用的安全性,验证你作为应用提供商的身份。
¥Code signing enhances the security of your application by applying a digital signature to your application’s executables and bundles, validating your identity of the provider of your application.
大多数平台都需要签名。请参阅每个平台的文档以获取更多信息。
¥Signing is required on most platforms. See the documentation for each platform for more information.
¥Distributing
了解如何为每个平台分发你的应用。
¥Learn how to distribute your application for each platform.
对于 Linux,你可以使用 Debian 软件包、Snap、AppImage、Flatpak、RPM 或 Arch 用户存储库 (AUR) 格式分发你的应用。
¥For Linux you can distribute your app using the Debian package, Snap, AppImage, Flatpak, RPM or Arch User Repository (AUR) formats.
对于 macOS,你可以将应用直接分发到 App Store,也可以将 DMG 安装程序作为直接下载发送。这两种方法都需要代码签名,在 App Store 之外分发也需要公证。
¥For macOS you can either distribute your application directly to the App Store or ship a DMG installer as direct download. Both methods requires code signing, and distributing outside the App Store also requires notarization.
代码签名和公证
¥Code signing and notarization
了解如何分发到 Microsoft Store 或配置 Windows 安装程序。
¥Learn how to distribute to the Microsoft Store or configure a Windows installer.
将你的 Android 应用分发到 Google Play。
¥Distribute your Android application to Google Play.
了解如何将你的应用上传到 App Store。
¥Learn how to upload your application to the App Store.
¥Cloud Services
将你的应用分发到全局分发你的应用并支持开箱即用自动更新的云服务。
¥Distribute your application to Cloud services that globally distribute your application and support auto updates out of the box.
Tauri v2.8 中文网 - 粤ICP备13048890号
Nodejs.cn 旗下网站