入门指南
复制包含安装步骤和该插件完整 Markdown 指南的配置 prompt。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-updater`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/updater/self-hosted/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
本文档将介绍如何运行你自己的自动更新服务器。
如果你觉得这些内容有帮助,请考虑支持我的工作,成为 Github 赞助者.
我赌了一把,把在这里构建的所有 code 都开源,而不是把它设为付费内容。我相信,通过开放而非对抗和隐藏,我们可以让世界变得更好。
此外,我想专注于 Capgo 工具链,并把它做成一项开放透明的业务。
但为了实现这一目标,我们需要共同努力,也包括你 🥹。
如果 Capgo 不适合你,你可以选择自担成本,并 支持独立开发者 以你喜欢的方式。
功能对齐
标题为 “功能对齐” 的章节如果你选择使用自己的服务器,将无法享受 5 分钟快速配置流程。
你需要自行实现所有这些功能。
| 功能 | Capgo | 自托管 |
|---|---|---|
| 更新 | ✅ | 🚧 |
| 自动回滚 | ✅ | 🚧 |
| 失败邮件通知 | ✅ | 🚧 |
| 通道 | ✅ | 🚧 |
| 渠道覆盖 | ✅ | 🚧 |
| 设备覆盖 | ✅ | 🚧 |
| 渠道设置 | ✅ | 🚧 |
| 设备设置 | ✅ | 🚧 |
| 自定义 ID | ✅ | 🚧 |
| 自动设置渠道 | ✅ | 🚧 |
| API 渠道 | ✅ | 🚧 |
| 更新统计 | ✅ | 🚧 |
| 下载失败统计 | ✅ | 🚧 |
| App 使用统计 | ✅ | 🚧 |
| 更新加密 | ✅ | 🚧 |
| 增量(manifest)更新 | ✅ | ❌ |
请注意,你不能同时使用 Capgo 云端和你自己的服务器。
在自动和手动之间选择
选择“自动”或“手动”模式在自动模式下,部分逻辑由 Native code 处理,更新决策由服务端决定。这种方式更安全,支持精细化更新、针对特定设备或群组进行部分部署等功能。
在手动模式下,所有逻辑均由 JS 处理。
安装 Capacitor updater
安装 Capacitor updaternpm install @capgo/capacitor-updaternpx cap sync准备你的 bundle
准备你的 bundle要向应用发送更新,你需要先把它打包成 zip。 要确保 zip 没问题,最好使用 Capgo CLI 来打包。
npx @capgo/cli@latest bundle zip你需要自行从你的服务器托管这个 zip 文件。
从“入门指南”继续
章节标题:“从入门到进阶”如果你正在使用 入门指南 要规划迁移和企业运营,请将其与 使用 @capgo/capacitor-updater 用于“使用 @capgo/capacitor-updater”中的原生能力, Capgo 企业版 用于 Capgo Enterprise 中的产品工作流, Ionic Enterprise 插件替代方案 用于 Ionic Enterprise 插件替代方案的产品工作流, Capgo 替代方案 适用于 Capgo Alternatives 的产品工作流,以及 Capgo 咨询 适用于 Capgo Consulting 的产品工作流。