发送无线更新
了解如何发送无线更新以向用户推送关键错误修复和改进。
你可以向用户发送包含关键错误修复和改进的无线更新。
¥You can send over-the-air updates containing critical bug fixes and improvements to your users.
开始使用
¥Get started
要设置更新,请运行以下 EAS 命令行接口 命令:
¥To set up updates, run the following EAS CLI command:
-
eas update:configure
命令完成后,你需要进行新构建,然后才能继续下一部分。
¥After the command completes, you'll need to make new builds before continuing to the next section.
发送更新
¥Send an update
要发送更新,请运行以下 EAS 命令行接口 命令:
¥To send an update, run the following EAS CLI command:
-
eas update --channel production
此命令将创建一个更新,并将其提供给配置为在 production
通道上接收更新的应用版本。此通道在 eas.json 中定义。
¥This command will create an update and make it available to builds of your app that are configured to receive updates on the production
channel. This channel is defined in eas.json.
你可以通过强制关闭应用并重新打开两次来验证更新是否有效。更新应在第二次启动时应用。
¥You can verify the update works by force closing the app and reopening it two times. The update should be applied on the second launch.
自动发送更新
¥Send updates automatically
你可以使用 EAS 工作流程 自动发送更新。首先,你需要执行 配置你的项目 操作,在项目根目录下添加一个名为 .eas/workflows/send-updates.yml 的文件,然后添加以下工作流配置:
¥You can automatically send updates with EAS Workflows. First, you'll need to configure your project, add a file named .eas/workflows/send-updates.yml at the root of your project, then add the following workflow configuration:
name: Send updates
on:
push:
branches: ['main']
jobs:
send_updates:
name: Send updates
type: update
params:
channel: production
上述工作流程将在每次提交到项目的 main
分支时,通过无线方式向 production
更新渠道发送更新。你也可以使用以下 EAS CLI 命令手动运行此工作流程:
¥The workflow above will send an over-the-air update for the production
update channel on every commit to your project's main
branch. You can also run this workflow manually with the following EAS CLI command:
-
eas workflow:run send-updates.yml
了解更多关于 工作流示例指南 的常见模式。
¥Learn more about common patterns with the workflows examples guide.
了解更多
¥Learn more
你可以通过我们的 更新指南 了解如何使用 推出更新、优化资源 等。
¥You can learn how to rollout an update, optimize assets, and more with our update guides.