✅应用程序已注册
您的应用程序已在Capgo中注册,生产频道
复制一个设置提示,包含安装步骤和该插件的完整Markdown指南。
该Capgo CLI提供了一个交互式引导程序,设置了对您的Capacitor应用程序的实时更新。您将:
预计时间: 10-20 分钟(根据您的互联网速度和构建时间而异)
使用您的API密钥运行入门命令:
npx @capgo/cli@latest init [APIKEY]您将看到欢迎消息:
Capgo onboarding 🛫CLI 将引导您完成 13 个交互式步骤:
设置阶段(步骤 1-6):
@capgo/capacitor-updater 插件测试阶段(第 7-12 步):
完成(第 13 步):
CLI检查您的开发环境以确保您已安装必要的工具。
什么会被检查:
可能的结果:
✅ 环境均已找到:
✅ Xcode detected - iOS development ready✅ Android SDK detected - Android development ready⚠️ 未找到环境:
⚠️ Xcode not found⚠️ Android SDK not found❌ No development environment detected
📱 To develop mobile apps with Capacitor, you need: • For iOS: Xcode (macOS only) - https://developer.apple.com/xcode/ • For Android: Android Studio - https://developer.android.com/studio可能会被询问的问题:
The CLI will log you into Capgo and add your app to your account.
(spinner) Running: npm @capgo/cli@latest login ***Login Done ✅
❓ Add {appId} in Capgo?如果您的应用 ID 已经被占用:
The CLI will suggest alternatives:
❌ App ID "com.example.app" is already taken💡 Here are some suggestions: 1. com.example.app2 2. com.example.app3 3. com.example.app.new 4. com.example.app.app
❓ What would you like to do?您可以选择建议的替代方案或输入自定义应用 ID。
是
❓ Create default channel production for {appId} in Capgo?如果您选择是:
(spinner) Running: npm @capgo/cli@latest channel add production {appId} --defaultChannel add Done ✅ (or "Channel already added ✅")将会创建并设置一个生产频道。对于大多数用户来说,这是推荐的选项。
如果您选择否:
If you change your mind, run it for yourself with: "npm @capgo/cli@latest channel add production {appId} --default"您需要手动创建和配置频道。或者,您可以:
capacitor.config.ts 文件setChannel() 方法动态设置频道The CLI will install the @capgo/capacitor-updater 插件与您的Capacitor版本兼容。
❓ Automatic Install "@capgo/capacitor-updater" dependency in {appId}?v5
@capgo/capacitor-updater v5@capgo/capacitor-updater v6@capgo/capacitor-updater v7即时更新选项:
安装后,您将被询问:
❓ Do you want to set instant updates in {appId}? Read more: https://capgo.app/docs/live-updates/update-behavior/#applying-updates-immediately如果您选择是:
autoUpdate: 'always' 并且 autoSplashscreen: true 将添加到您的配置@capacitor/splash-screen 将安装,如果缺失, launchAutoHide: falsecapacitor.config.ts 将自动更新always, atInstall, onLaunch)应继续使用 npx @capgo/cli@latest bundle upload --delta 所以只有改变的文件下载,用户不会等待一个完整的zip如果您选择否:
capacitor.config.ts集成 CLI 将自动将所需的 code 注入您的主应用程序文件中。
❓ Automatic Add "CapacitorUpdater.notifyAppReady()" code and import in {appId}?添加什么:
import { CapacitorUpdater } from '@capgo/capacitor-updater'
CapacitorUpdater.notifyAppReady()项目类型检测:
plugins/capacitorUpdater.client.ts终端到终端加密为你的更新添加了额外的安全层。
🔐 End-to-end encryption ✅ Use this for: Banking, healthcare, or apps with legal encryption requirements ⚠️ Note: Makes debugging harder - skip if you don't need it
❓ Enable end-to-end encryption for {appId} updates?如果你启用加密,CLI 将会:
选择测试期间的平台
📱 Platform selection for onboarding This is just for testing during onboarding - your app will work on all platforms
❓ Which platform do you want to test with during this onboarding? Options: - iOS - AndroidCLI将构建您的应用并与Capacitor同步。
❓ Automatic build {appId} with "npm run build"?发生了什么:
npx cap sync {platform}如果构建脚本丢失:
您将被询问是否要跳过构建或添加一个构建脚本到您的 package.json.
在设备或模拟器上测试您的应用的初始版本
❓ Run {appId} on {PLATFORM} device now to test the initial version?如果您选择 是:
(spinner) Running: npx cap run {platform}(device picker appears)App started ✅📱 Your app should now be running on your {platform} device with Capgo integrated🔄 This is your baseline version - we'll create an update next现在是时候测试 Capgo 的更新系统了,通过进行一个可见的修改。
🎯 Now let's test Capgo by making a visible change and deploying an update!
❓ How would you like to test the update? Options: - Auto: Let Capgo CLI make a visible change for you - Manual: I'll make changes myself自动模式: CLI会自动修改您的文件,添加可见的测试横幅或更改。
手动模式: 您自己进行修改(例如,改变文本、颜色或添加元素)。
版本处理:
❓ How do you want to handle the version for this update? Options: - Auto: Bump patch version ({currentVersion} → {nextVersion}) - Manual: I'll provide the version number构建修改
❓ Build {appId} with changes before uploading?Upload your updated app bundle to Capgo.
❓ Upload the updated {appId} bundle (v{version}) to Capgo?将您的更新后的应用程序包上传到 CLI。
npx @capgo/cli@latest bundle upload为即时更新提供最佳体验。
💡 Instant updates are enabled in your config Delta updates send only changed files instead of the full bundle
❓ Enable delta updates for this upload? (Recommended with instant updates)Success:
✅ Update v{version} uploaded successfully!🎉 Your updated bundle is now available on Capgo让我们看到更新的效果!
🧪 Time to test the Capgo update system!📱 Go to your device where the app is running实时更新:
🔄 IMPORTANT: Background your app (swipe up/press home button) and then reopen it⏱️ The update should be downloaded and applied automatically标准更新:
📱 With standard updates, you will need to: 1. Background the app (swipe up/press home button) to start download 2. Wait a few seconds for download to complete 3. Background and foreground again to see the update查看日志:
❓ Monitor Capgo logs to verify the update worked?如果您选择 是,你将看到设备的实时日志,显示更新过程。
Welcome onboard ✈️!恭喜!您成功地为应用程序设置了Capgo实时更新。
完成入门后,您有:
✅应用程序已注册
您的应用程序已在Capgo中注册,生产频道
✅插件已安装
Capacitor
Code
code
✅ __CAPGO_KEEP_0__
✅ live update
__CAPGO_KEEP_0__
npm run buildnpx @capgo/cli@latest bundle upload --channel=production__CAPGO_KEEP_0__ Live Update.
如果您退出入门流程,可以随时恢复:
npx @capgo/cli@latest init [APIKEY]您会看到:
You have already got to the step {stepNumber}/13 in the previous session❓ Would you like to continue from where you left off?问题: 未检测到 Xcode 或 Android SDK。
解决方案:
问题: 您的应用 ID 已经被注册。
解决方案: 选择建议的替代方案或在反向域名表示法中输入自定义应用 ID。
问题: 未在 package.json.
解决方案: 为您的项目添加一个构建脚本 package.json:
{ "scripts": { "build": "your-build-command" }}问题: CLI无法自动注入code
解决方案: 手动将code添加到主文件中:
import { CapacitorUpdater } from '@capgo/capacitor-updater'
CapacitorUpdater.notifyAppReady()问题: 您的Capacitor版本低于v5
解决方案: 升级到 Capacitor v5 或更高版本:
现在您已经完成了入门流程,了解这些主题:
一次性设置清单
配置通道、CI和delta上传一次,长期稳定
部署更新
了解如何从 Capgo 控制台部署更新
更新类型
所有OTA更新类型参考:应用时间、延迟条件、版本阻塞和交付
CI/CD集成
在CI/CD中自动化您的更新部署
频道
管理多个更新流程
加密
以端到端加密方式保护您的更新
更新行为
自定义更新的应用时间和方式(直接、差分等)
如果您在入门过程中遇到问题:
如果您正在使用 CLI 入门指南 为计划仪表板和API操作,连接它 API概览 了解API概览的实施细节 简介 了解简介的实施细节 API密钥 了解API密钥的实施细节 设备 设备 包 了解包的实施细节