高级发布渠道
本文档于 2022 年 8 月归档,将不再更新。想了解更多关于发布渠道被废弃的原因,请参考我们的EAS Update 博客文章。我们建议改用EAS Update。
介绍
🌐 Introduction
想快速了解发布渠道,请阅读此文。
🌐 For a quick introduction to release channels, read this.
当你通过运行 expo publish --release-channel staging 发布你的应用时,它会创建:
🌐 When you publish your app by running expo publish --release-channel staging, it creates:
- 一次发布,用
publicationId标识,适用于 Android 和 iOS 平台。发布是指你在发布时打包的源代码和资源。 - 一个指向
staging发布渠道中发布版本的链接,由channelId标识。这就像 git 分支上的一次提交。
为了简便,本文其余部分将仅指 ios 版本,但你随时可以将 ios 替换为 android,一切仍然成立。
🌐 For simplicity, the rest of this article will refer to just the ios releases, but you could swap out ios for android at any point and everything would still be true.
查看过去发布的内容
🌐 See past publishes
你可以看到你用 expo publish:history 发布的所有内容。
🌐 You can see everything that you've published with expo publish:history.
命令和输出示例
🌐 Example command and output
expo publish:history --platform ios
| 发布时间 | 应用版本 | SDK版本 | 平台 | 渠道 | 发布ID |
|---|---|---|---|---|---|
| 2018-01-05T23:55:04.603Z | 1.0.0 | 24.0.0 | iOS | staging | 80b1ffd7-4e05-4851-95f9-697e122033c3 |
要查看更多有关此特定版本的详细信息,你可以运行 expo publish:details
🌐 To see more details about this particular release, you can run expo publish:details
命令和输出示例
🌐 Example command and output
expo publish:details --publish-id 80b1ffd7-4e05-4851-95f9-697e122033c3

我的用户将获得什么版本的应用?
🌐 What version of the app will my users get?
你的用户将获得推送到发布通道的最新兼容版本。影响兼容性的因素有:
🌐 Your users will get the most recent compatible release that was pushed to a release channel. Factors that affect compatibility:
- sdkVersion(独立应用仅支持单个 SDK 版本)
- platform
- releaseChannel
以下流程图显示了我们如何确定将哪个版本返回给用户:
🌐 The following flowchart shows how we determine which release to return to a user:

将版本提升到新的版本渠道
🌐 Promoting a release to a new release channel
示例用例:你之前发布了一个到 staging 的版本,并且在测试中一切顺利。现在你希望将此版本在另一个发布渠道(例如生产环境)中生效。
🌐 Example use case: you previously published a release to staging and everything went well in your testing. Now you want this release to be active in another release channel (ie) production
我们运行 expo publish:set 将我们的版本推送到 production 发布渠道。
expo publish:set --publish-id 80b1ffd7-4e05-4851-95f9-697e122033c3 --release-channel production
🌐 We run expo publish:set to push our release to the production release channel.
expo publish:set --publish-id 80b1ffd7-4e05-4851-95f9-697e122033c3 --release-channel production
继续上一部分的内容,我们可以看到我们的版本在 staging 和 production 发布渠道中都可用。
🌐 Continuing from the previous section, we can see that our release is available in both the staging and the production release channels.
expo publish:history --platform ios
| 发布时间 | 应用版本 | SDK版本 | 平台 | 渠道 | 发布ID |
|---|---|---|---|---|---|
| 2018-01-05T23:55:04.603Z | 1.0.0 | 36.0.0 | iOS | 测试 | 80b1ffd7-4e05-4851-95f9-697e122033c3 |
| 2018-01-05T23:55:04.603Z | 1.0.0 | 36.0.0 | iOS | 生产 | 80b1ffd7-4e05-4851-95f9-697e122033c3 |
| 2018-01-04T22:43:19.302Z | 1.0.0 | 36.0.0 | iOS | 生产 | d6b61741-a8dc-11e9-852a-3b0715b88238 |
回滚发布通道条目
🌐 Rollback a release channel entry
示例用例:你将一个版本发布到你的 production 发布渠道,但随后发现它对部分用户造成了重大回归,因此你想要回退到之前的版本。
🌐 Example use case: you published a release to your production release channel, only to realize that it includes a major regression for some of your users, so you want to revert to the previous version.
接着上一部分,我们使用 expo publish:set 仅回滚 iOS 平台上的 production 发布通道条目
🌐 Continuing from the previous section, we roll back our production release channel entry for just the iOS platform with expo publish:set
expo publish:set --release-channel production --publish-id d6b61741-a8dc-11e9-852a-3b0715b88238
或者,我们可以使用以下方式回滚 Android 和 iOS 的 production 发布通道条目:
expo publish:rollback --release-channel production --sdk-version 36.0.0
🌐 Or, we could roll back the production release channel entry for both Android and iOS with:
expo publish:rollback --release-channel production --sdk-version 36.0.0
现在我们可以看到我们的版本已在生产版本渠道上可用。
🌐 Now we can see that our releases are available on the production release channel.
expo publish:history --platform ios
| 发布时间 | 应用版本 | SDK版本 | 平台 | 渠道 | 发布ID |
|---|---|---|---|---|---|
| 2018-01-04T22:43:19.302Z | 1.0.0 | 36.0.0 | ios | 生产 | d6b61741-a8dc-11e9-852a-3b0715b88238 |
发布渠道 CLI 工具
🌐 Release channels CLI tools
发布历史
🌐 Publish history
Usage: expo publish:history [--release-channel <channel-name>] [--count <number-of-logs>] View a log of your published releases. Options: -c, --release-channel <channel-name> Filter by release channel. If this flag is not included, the most recent publications will be shown. -count, --count <number-of-logs> Number of logs to view, maximum 100, default 5. -r, --raw Produce some raw output. -p, --platform <ios|android> Filter by platform, android or ios.
发布详情
🌐 Publish details
Usage: expo publish:details --publish-id <publish-id> View the details of a published release. Options: --publish-id <publish-id> Publication id. (Required) -r, --raw Produce some raw output.
发布回滚
🌐 Publish rollback
Usage: expo publish:rollback Rollback an update to a release channel. Equivalent to running `expo publish:set` with publish-id set to the most recent release to the specified sdk version Options: -c, --release-channel <channel-name> The name of the release channel to roll back (Required) -s, --sdk-version <version> The SDK version to roll back (e.g. 37.0.0) (Required) -p, --platform <ios|android> The platform to roll back (roll back both unless specified)
发布集
🌐 Publish set
Usage: expo publish:set --release-channel <channel-name> --publish-id <publish-id> Set a published release to be served from a specified channel. Options: -c, --release-channel <channel-name> The channel to set the published release. (Required) -p, --publish-id <publish-id> The id of the published release to serve from the channel. (Required)