capgo-cloud-migration
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCapgo Cloud Migration
Capgo 迁移至 Capawesome Cloud
Migrate an existing Capacitor project from Capgo to Capawesome Cloud.
将现有Capacitor项目从Capgo迁移到Capawesome Cloud。
Prerequisites
前提条件
- A Capacitor 6, 7, or 8 app currently using Capgo for live updates.
- Node.js 18+ and npm installed.
- Access to the project's source code repository.
- A Capawesome Cloud account and organization.
- 当前使用Capgo进行实时更新的Capacitor 6、7或8版本应用。
- 已安装Node.js 18+和npm。
- 可访问项目的源代码仓库。
- 拥有Capawesome Cloud账户和组织。
General Rules
通用规则
- Before running any command for the first time, run it with the
@capawesome/cliflag to review all available options.--help - Do not remove Capgo configuration, packages, or signing keys until the corresponding Capawesome Cloud feature is fully set up and verified.
- Determine the Capacitor version from (
package.json) before making any changes — it affects which plugin version and update strategy to use.@capacitor/core - The Capgo app ID is a native bundle ID (e.g. ), while the Capawesome Cloud app ID is a UUID. Never copy the Capgo app ID into the Capawesome configuration.
com.example.app
- 首次运行任何命令前,先添加
@capawesome/cli参数查看所有可用选项。--help - 在对应的Capawesome Cloud功能完全设置并验证通过前,请勿删除Capgo的配置、包或签名密钥。
- 在进行任何更改前,从的
package.json中确认Capacitor版本——这会影响插件版本和更新策略的选择。@capacitor/core - Capgo的应用ID是原生Bundle ID(例如),而Capawesome Cloud的应用ID是UUID。切勿将Capgo的应用ID复制到Capawesome的配置中。
com.example.app
MCP Server
MCP服务器
The Capawesome MCP server serves the current Capawesome documentation, so it is always ahead of the guidance bundled with this skill. With an API token it also exposes the Capawesome Cloud management API.
- If the Capawesome MCP tools are available, call for the topic and read the matching page with
search_docsbefore applying the guidance below. Where the two disagree, follow the documentation. Theget_doc_pagetools can carry out the Capawesome Cloud steps in this skill directly — creating apps, triggering builds, deploying to channels and stores, rolling back, and diagnosing failed jobs — as an alternative to the Capawesome CLI.cloud_* - If they are not available, mention once that the server can be added with the command below, then continue with this skill. Never block on it.
bash
claude mcp add --transport http capawesome "https://mcp.capawesome.io/mcp"The documentation tools need no account and no token. See the skill for full setup, including the Capawesome Cloud tools.
capawesome-mcpCapawesome MCP服务器提供最新的Capawesome文档,因此其内容始终比本技能内置的指南更超前。通过API令牌,它还能暴露Capawesome Cloud管理API。
- 如果Capawesome MCP工具可用,先调用查询相关主题,再使用
search_docs读取匹配页面,然后再应用下方的指南。若两者内容不一致,请以文档为准。get_doc_page工具可直接执行本技能中的Capawesome Cloud步骤——创建应用、触发构建、部署到渠道和商店、回滚以及诊断失败任务——作为Capawesome CLI的替代方案。cloud_* - 如果不可用,只需提及一次可通过以下命令添加服务器,然后继续使用本技能。无需在此步骤阻塞。
bash
claude mcp add --transport http capawesome "https://mcp.capawesome.io/mcp"文档工具无需账户和令牌。如需完整设置(包括Capawesome Cloud工具),请查看技能。
capawesome-mcpProcedures
迁移流程
Step 1: Detect Capgo Usage
步骤1:检测Capgo使用情况
Scan the project to determine which Capgo features are in use.
扫描项目以确定正在使用哪些Capgo功能。
1.1 Check for the Capgo Updater Plugin
1.1 检查Capgo更新器插件
Search for these signals:
- in
@capgo/capacitor-updater(dependencies or devDependencies).package.json - A key inside the
CapacitorUpdaterobject inpluginsorcapacitor.config.ts.capacitor.config.json - Imports of in TypeScript/JavaScript source files.
@capgo/capacitor-updater
If any signal is found, mark Live Updates as in use.
Record the current configuration values from the config (all optional):
CapacitorUpdater- (Capgo app ID, a bundle ID like
appId)com.example.app - (
autoUpdate,true,false,'off','atBackground','atInstall','onLaunch', or'always'; default'onlyDownload')true - (
directUpdate,true,'atInstall', or'onLaunch'; default'always')false defaultChannel- (milliseconds; default
appReadyTimeout)10000 - (default
autoDeletePrevious)true - (indicates end-to-end encryption is in use)
publicKey - (seconds)
periodCheckDelay - (seconds; default
responseTimeout)20 - /
updateUrl/statsUrl(indicates a self-hosted Capgo backend)channelUrl - (default
autoSplashscreen)false
搜索以下特征:
- 中(dependencies或devDependencies)的
package.json。@capgo/capacitor-updater - 或
capacitor.config.ts中capacitor.config.json对象内的plugins配置项。CapacitorUpdater - TypeScript/JavaScript源文件中对的导入。
@capgo/capacitor-updater
如果发现任一特征,标记实时更新为已启用。
记录配置中的当前值(均为可选):
CapacitorUpdater- (Capgo应用ID,类似
appId的Bundle ID)com.example.app - (可选值:
autoUpdate、true、false、'off'、'atBackground'、'atInstall'、'onLaunch'或'always';默认值'onlyDownload')true - (可选值:
directUpdate、true、'atInstall'或'onLaunch';默认值'always')false defaultChannel- (毫秒;默认值
appReadyTimeout)10000 - (默认值
autoDeletePrevious)true - (表示启用了端到端加密)
publicKey - (秒)
periodCheckDelay - (秒;默认值
responseTimeout)20 - /
updateUrl/statsUrl(表示使用自托管Capgo后端)channelUrl - (默认值
autoSplashscreen)false
1.2 Check for the Capgo CLI in CI/CD
1.2 检查CI/CD中的Capgo CLI
Search for these signals:
- in
@capgo/cli(usually devDependencies).package.json - or
capgocommands (e.g.@capgo/cli,bundle upload) in CI/CD configuration files (e.g.,channel set,.github/workflows/*.yml,.gitlab-ci.yml,bitrise.yml,Jenkinsfile) and npm scripts.azure-pipelines.yml - A (or similar) secret referenced in CI/CD files.
CAPGO_API_KEY
If any signal is found, mark CI/CD as in use and record every Capgo CLI command with its options.
搜索以下特征:
- 中(通常在devDependencies)的
package.json。@capgo/cli - CI/CD配置文件(如、
.github/workflows/*.yml、.gitlab-ci.yml、bitrise.yml、Jenkinsfile)和npm脚本中的azure-pipelines.yml或capgo命令(例如@capgo/cli、bundle upload)。channel set - CI/CD文件中引用的(或类似)密钥。
CAPGO_API_KEY
如果发现任一特征,标记CI/CD为已启用,并记录所有Capgo CLI命令及其选项。
1.3 Check for Code Signing / Encryption
1.3 检查代码签名/加密
Search for these signals:
- or
.capgo_key_v2files in the project root (created by.capgo_key_v2.pub).npx @capgo/cli key create - A value in the
publicKeyconfig.CapacitorUpdater - or
--key-v2flags on--key-data-v2commands in CI/CD.bundle upload
If any signal is found, mark Code Signing as in use.
搜索以下特征:
- 项目根目录中的或
.capgo_key_v2文件(由.capgo_key_v2.pub生成)。npx @capgo/cli key create - 配置中的
CapacitorUpdater值。publicKey - CI/CD中命令的
bundle upload或--key-v2参数。--key-data-v2
如果发现任一特征,标记代码签名为已启用。
1.4 Check for Capgo Native Builds
1.4 检查Capgo原生构建
Search for commands (e.g. , ) in CI/CD files or npm scripts. If found, mark Native Builds as in use.
capgo buildbuild requestbuild credentials在CI/CD文件或npm脚本中搜索命令(例如、)。如果找到,标记原生构建为已启用。
capgo buildbuild requestbuild credentials1.5 Record Channels
1.5 记录渠道信息
List the existing Capgo channels so they can be recreated in Capawesome Cloud:
bash
npx @capgo/cli channel list <CAPGO_APP_ID>If the command fails (e.g. no API key available), ask the user to list their channels from the Capgo Console instead.
列出现有Capgo渠道,以便在Capawesome Cloud中重新创建:
bash
npx @capgo/cli channel list <CAPGO_APP_ID>如果命令失败(例如无可用API密钥),请用户从Capgo控制台手动列出渠道。
1.6 Present Findings
1.6 展示检测结果
Present the detected features (Live Updates, CI/CD, Code Signing, Native Builds) and recorded configuration to the user. Ask the user to confirm which features to migrate.
向用户展示检测到的功能(实时更新、CI/CD、代码签名、原生构建)和记录的配置信息。请用户确认需要迁移哪些功能。
Step 2: Set Up Capawesome Cloud
步骤2:设置Capawesome Cloud
2.1 Authenticate
2.1 身份验证
bash
npx @capawesome/cli loginbash
npx @capawesome/cli login2.2 Create an App
2.2 创建应用
Skip if the user already has a Capawesome Cloud app ID.
bash
npx @capawesome/cli apps:createSave the returned app ID (UUID) for subsequent steps. This replaces the Capgo app ID everywhere, but has a different format — it is not the native bundle ID.
如果用户已有Capawesome Cloud应用ID,可跳过此步骤。
bash
npx @capawesome/cli apps:create保存返回的应用ID(UUID),用于后续步骤。它将替代所有场景中的Capgo应用ID,但格式不同——不是原生Bundle ID。
2.3 Recreate Channels
2.3 重新创建渠道
Create one Capawesome Cloud channel for each Capgo channel recorded in Step 1.5:
bash
npx @capawesome/cli apps:channels:create --app-id <APP_ID> --name <CHANNEL_NAME>Capgo channel settings like , , or device targeting (/) have no channel-level equivalent in Capawesome Cloud:
--self-assign--disable-auto-update--ios--android- Device self-assignment is not required — the Live Update SDK can request any channel via or
sync({ channel })without a server-side opt-in.setChannel() - Update blocking by native version is configured per bundle at upload time (,
--android-min, and related flags).--ios-min
为步骤1.5中记录的每个Capgo渠道创建一个Capawesome Cloud渠道:
bash
npx @capawesome/cli apps:channels:create --app-id <APP_ID> --name <CHANNEL_NAME>Capgo渠道的设置(如、或设备目标选择/)在Capawesome Cloud中没有渠道级别的对应项:
--self-assign--disable-auto-update--ios--android- 无需设备自分配——Live Update SDK可通过或
sync({ channel })请求任意渠道,无需服务器端授权。setChannel() - 按原生版本阻止更新的配置在上传包时设置(、
--android-min及相关参数)。--ios-min
Step 3: Replace the Plugin
步骤3:替换插件
Skip this step if Live Updates was not detected or the user chose not to migrate it.
如果未检测到实时更新,或用户选择不迁移此功能,可跳过此步骤。
3.1 Remove the Capgo Updater Plugin
3.1 移除Capgo更新器插件
bash
npm uninstall @capgo/capacitor-updaterbash
npm uninstall @capgo/capacitor-updater3.2 Install the Capawesome Live Update Plugin
3.2 安装Capawesome实时更新插件
Install the version matching the project's Capacitor version:
- Capacitor 8:
npm install @capawesome/capacitor-live-update@latest - Capacitor 7:
npm install @capawesome/capacitor-live-update@v7-lts - Capacitor 6:
npm install @capawesome/capacitor-live-update@v6-lts
安装与项目Capacitor版本匹配的插件版本:
- Capacitor 8:
npm install @capawesome/capacitor-live-update@latest - Capacitor 7:
npm install @capawesome/capacitor-live-update@v7-lts - Capacitor 6:
npm install @capawesome/capacitor-live-update@v6-lts
Step 4: Update the Capacitor Configuration
步骤4:更新Capacitor配置
Replace the plugin config with in (or ). Map the configuration options as follows:
CapacitorUpdaterLiveUpdatecapacitor.config.ts.jsonCapgo ( | Capawesome ( | Notes |
|---|---|---|
| | Different value — use the Capawesome Cloud app ID (UUID) from Step 2 |
| | Both in milliseconds. Capgo defaults to |
| | Capgo defaults to |
| (remove) | Use |
| | See Step 6 for the strategy mapping |
| (remove) | Handled in code — see the Force Update pattern in Step 6 |
| | Same value |
| (remove) | Handled in code — see Step 6 |
| (remove) | Handled in code — sync on the App |
| | New value required — generate a new key pair in Step 7. Do not reuse the Capgo key |
| (remove) | Handled automatically by the SDK |
| | Unit change: Capgo uses seconds (default |
| (remove) | Not needed |
| | Only set for EU hosting ( |
| (remove) | The native version code is used by the SDK |
All other Capgo options (, , , , , , , , , , , , , , , , , , , ) have no equivalent — remove them.
allowModifyUrlallowModifyAppIdallowManualBundleErrorallowPreviewpersistCustomIdpersistModifyUrlallowSetDefaultChannelkeepUrlPathAfterReloaddisableJSLoggingosLoggingshakeMenushakeMenuGestureallowShakeChannelSelectorlocalS3localHostlocalWebHostlocalSupalocalSupaAnonlocalApilocalApiFilesExample:
diff
// capacitor.config.ts
const config: CapacitorConfig = {
plugins: {
- CapacitorUpdater: {
- appId: 'com.example.app',
- autoUpdate: true,
- defaultChannel: 'production',
- appReadyTimeout: 10000,
- autoDeletePrevious: true,
- responseTimeout: 20
- }
+ LiveUpdate: {
+ appId: '<CAPAWESOME_APP_ID>',
+ autoUpdateStrategy: 'background',
+ defaultChannel: 'production',
+ readyTimeout: 10000,
+ autoDeleteBundles: true,
+ autoBlockRolledBackBundles: true,
+ httpTimeout: 20000
+ }
}
};在(或)中,将插件配置替换为。按以下方式映射配置选项:
capacitor.config.ts.jsonCapacitorUpdaterLiveUpdateCapgo( | Capawesome( | 说明 |
|---|---|---|
| | 值不同——使用步骤2中获取的Capawesome Cloud应用ID(UUID) |
| | 均为毫秒单位。Capgo默认值为 |
| | Capgo默认值为 |
| (移除) | 使用 |
| | 请查看步骤6的策略映射 |
| (移除) | 通过代码实现——请查看步骤6中的强制更新模式 |
| | 值相同 |
| (移除) | 通过代码实现——请查看步骤6 |
| (移除) | 通过代码实现——改为在App |
| | 需要新值——在步骤7中生成新密钥对。请勿复用Capgo密钥 |
| (移除) | SDK会自动处理 |
| | 单位变更:Capgo使用秒(默认 |
| (移除) | 无需设置 |
| | 仅在使用欧盟托管时设置( |
| (移除) | SDK会使用原生版本号 |
所有其他Capgo选项(、、、、、、、、、、、、、、、、、、、)均无对应项——直接移除。
allowModifyUrlallowModifyAppIdallowManualBundleErrorallowPreviewpersistCustomIdpersistModifyUrlallowSetDefaultChannelkeepUrlPathAfterReloaddisableJSLoggingosLoggingshakeMenushakeMenuGestureallowShakeChannelSelectorlocalS3localHostlocalWebHostlocalSupalocalSupaAnonlocalApilocalApiFiles示例:
diff
// capacitor.config.ts
const config: CapacitorConfig = {
plugins: {
- CapacitorUpdater: {
- appId: 'com.example.app',
- autoUpdate: true,
- defaultChannel: 'production',
- appReadyTimeout: 10000,
- autoDeletePrevious: true,
- responseTimeout: 20
- }
+ LiveUpdate: {
+ appId: '<CAPAWESOME_APP_ID>',
+ autoUpdateStrategy: 'background',
+ defaultChannel: 'production',
+ readyTimeout: 10000,
+ autoDeleteBundles: true,
+ autoBlockRolledBackBundles: true,
+ httpTimeout: 20000
+ }
}
};Step 5: Update Imports and API Calls
步骤5:更新导入和API调用
Search all TypeScript/JavaScript files for imports of and replace:
@capgo/capacitor-updaterdiff
-import { CapacitorUpdater } from '@capgo/capacitor-updater';
+import { LiveUpdate } from '@capawesome/capacitor-live-update';Replace all references to the class with , applying the method mapping below. Read for the complete method, event, and result-field mapping. The most common replacements:
CapacitorUpdaterLiveUpdatereferences/api-mapping.mdApp ready notification — becomes . Keep it as early as possible in app startup:
notifyAppReady()ready()diff
-import { CapacitorUpdater } from '@capgo/capacitor-updater';
+import { LiveUpdate } from '@capawesome/capacitor-live-update';
-CapacitorUpdater.notifyAppReady();
+void LiveUpdate.ready();Check for updates — becomes . The result fields change ( → , → ):
getLatest()fetchLatestBundle()versionbundleIdurldownloadUrldiff
-const latest = await CapacitorUpdater.getLatest();
-if (latest.url) {
- console.log('Update available:', latest.version);
+const result = await LiveUpdate.fetchLatestBundle();
+if (result.downloadUrl) {
+ console.log('Update available:', result.bundleId);
}Download a bundle — becomes :
download()downloadBundle()diff
-const bundle = await CapacitorUpdater.download({
- url: latest.url,
- version: latest.version
-});
+await LiveUpdate.downloadBundle({
+ url: result.downloadUrl,
+ bundleId: result.bundleId
+});Set the next bundle — becomes . Capgo's (apply immediately) becomes followed by :
next()setNextBundle()set()setNextBundle()reload()diff
-await CapacitorUpdater.next({ id: bundle.id });
+await LiveUpdate.setNextBundle({ bundleId: result.bundleId });diff
-await CapacitorUpdater.set({ id: bundle.id });
+await LiveUpdate.setNextBundle({ bundleId: result.bundleId });
+await LiveUpdate.reload();Channel switching — prefer passing the channel directly to or instead of persisting it with :
sync(...)fetchLatestBundle(...)setChannel()diff
-await CapacitorUpdater.setChannel({ channel: 'beta', triggerAutoUpdate: true });
+await LiveUpdate.sync({ channel: 'beta' });Use only if the channel assignment must persist across app restarts, and as the replacement for Capgo's .
setChannel({ channel })setChannel({ channel: null })unsetChannel()搜索所有TypeScript/JavaScript文件中对的导入并替换:
@capgo/capacitor-updaterdiff
-import { CapacitorUpdater } from '@capgo/capacitor-updater';
+import { LiveUpdate } from '@capawesome/capacitor-live-update';将所有对类的引用替换为,并应用以下方法映射。完整的方法、事件和结果字段映射请查看。最常见的替换如下:
CapacitorUpdaterLiveUpdatereferences/api-mapping.md应用就绪通知——改为。请在应用启动时尽早调用:
notifyAppReady()ready()diff
-import { CapacitorUpdater } from '@capgo/capacitor-updater';
+import { LiveUpdate } from '@capawesome/capacitor-live-update';
-CapacitorUpdater.notifyAppReady();
+void LiveUpdate.ready();检查更新——改为。结果字段变更( → , → ):
getLatest()fetchLatestBundle()versionbundleIdurldownloadUrldiff
-const latest = await CapacitorUpdater.getLatest();
-if (latest.url) {
- console.log('Update available:', latest.version);
+const result = await LiveUpdate.fetchLatestBundle();
+if (result.downloadUrl) {
+ console.log('Update available:', result.bundleId);
}下载包——改为:
download()downloadBundle()diff
-const bundle = await CapacitorUpdater.download({
- url: latest.url,
- version: latest.version
-});
+await LiveUpdate.downloadBundle({
+ url: result.downloadUrl,
+ bundleId: result.bundleId
+});设置下一个包——改为。Capgo的(立即应用)改为后调用:
next()setNextBundle()set()setNextBundle()reload()diff
-await CapacitorUpdater.next({ id: bundle.id });
+await LiveUpdate.setNextBundle({ bundleId: result.bundleId });diff
-await CapacitorUpdater.set({ id: bundle.id });
+await LiveUpdate.setNextBundle({ bundleId: result.bundleId });
+await LiveUpdate.reload();切换渠道——建议直接将渠道传递给或,而非使用持久化:
sync(...)fetchLatestBundle(...)setChannel()diff
-await CapacitorUpdater.setChannel({ channel: 'beta', triggerAutoUpdate: true });
+await LiveUpdate.sync({ channel: 'beta' });仅当渠道分配需要跨应用重启持久化时,才使用;使用替代Capgo的。
setChannel({ channel })setChannel({ channel: null })unsetChannel()Step 6: Migrate the Update Strategy
步骤6:迁移更新策略
Map the recorded and values to a Capawesome update strategy.
autoUpdatedirectUpdate将记录的和值映射到Capawesome更新策略。
autoUpdatedirectUpdate6.1 Background Updates (Capgo default)
6.1 后台更新(Capgo默认)
For , , , or without , use the background strategy: set in the config (already done in Step 4) — no sync code is needed. Downloaded updates are applied on the next app start.
autoUpdate: true'atBackground''atInstall''onLaunch'directUpdateautoUpdateStrategy: 'background'对于、、或且未设置的情况,使用后台策略:在配置中设置(步骤4已完成)——无需同步代码。下载的更新将在下次应用启动时应用。
autoUpdate: true'atBackground''atInstall''onLaunch'directUpdateautoUpdateStrategy: 'background'6.2 Always Latest (Capgo autoUpdate: 'always'
)
autoUpdate: 'always'6.2 始终保持最新(Capgo autoUpdate: 'always'
)
autoUpdate: 'always'Combine the background strategy with a listener that prompts the user to apply the update immediately. Add this code early in the app's initialization:
nextBundleSettypescript
import { LiveUpdate } from '@capawesome/capacitor-live-update';
LiveUpdate.addListener('nextBundleSet', async (event) => {
if (event.bundleId) {
const shouldReload = confirm('A new update is available. Install now?');
if (shouldReload) {
await LiveUpdate.reload();
}
}
});Copy this snippet exactly. Do not simplify or omit the dialog.
confirm()将后台策略与监听器结合,提示用户立即应用更新。在应用初始化早期添加以下代码:
nextBundleSettypescript
import { LiveUpdate } from '@capawesome/capacitor-live-update';
LiveUpdate.addListener('nextBundleSet', async (event) => {
if (event.bundleId) {
const shouldReload = confirm('A new update is available. Install now?');
if (shouldReload) {
await LiveUpdate.reload();
}
}
});请完全复制此代码片段,请勿简化或省略对话框。
confirm()6.3 Force Update (Capgo directUpdate
/ autoSplashscreen
)
directUpdateautoSplashscreen6.3 强制更新(Capgo directUpdate
/ autoSplashscreen
)
directUpdateautoSplashscreenIf Capgo was configured with (any non- value), replicate it by extending the splash screen until the sync completes. Omit from the config and add:
directUpdatefalseautoUpdateStrategytypescript
import { SplashScreen } from '@capacitor/splash-screen';
import { LiveUpdate } from '@capawesome/capacitor-live-update';
const initializeApp = async () => {
const { nextBundleId } = await LiveUpdate.sync();
if (nextBundleId) {
await LiveUpdate.reload();
} else {
await SplashScreen.hide();
}
};
initializeApp();This replaces both and — no separate splash screen config is needed. This pattern may impact user experience on slow connections; consider the background strategy instead.
directUpdateautoSplashscreen如果Capgo配置了(任何非值),可通过延长启动屏显示时间直到同步完成来实现。从配置中移除并添加以下代码:
directUpdatefalseautoUpdateStrategytypescript
import { SplashScreen } from '@capacitor/splash-screen';
import { LiveUpdate } from '@capawesome/capacitor-live-update';
const initializeApp = async () => {
const { nextBundleId } = await LiveUpdate.sync();
if (nextBundleId) {
await LiveUpdate.reload();
} else {
await SplashScreen.hide();
}
};
initializeApp();这将替代和——无需单独配置启动屏。此模式在慢速网络下可能影响用户体验;建议考虑使用后台策略。
directUpdateautoSplashscreen6.4 Manual / Download-Only (Capgo autoUpdate: 'off'
or 'onlyDownload'
)
autoUpdate: 'off''onlyDownload'6.4 手动/仅下载(Capgo autoUpdate: 'off'
或 'onlyDownload'
)
autoUpdate: 'off''onlyDownload'Keep unset and migrate the existing manual // flow using the method mapping from Step 5, or replace the whole flow with a single call. A common pattern is to sync on the App event:
autoUpdateStrategygetLatest()download()next()sync()resumetypescript
import { App } from '@capacitor/app';
import { LiveUpdate } from '@capawesome/capacitor-live-update';
void LiveUpdate.ready();
App.addListener('resume', async () => {
await LiveUpdate.sync();
});With this pattern, downloaded updates are applied on the next app start.
不设置,使用步骤5中的方法映射迁移现有的手动//流程,或用单次调用替换整个流程。常见模式是在App事件时同步:
autoUpdateStrategygetLatest()download()next()sync()resumetypescript
import { App } from '@capacitor/app';
import { LiveUpdate } from '@capawesome/capacitor-live-update';
void LiveUpdate.ready();
App.addListener('resume', async () => {
await LiveUpdate.sync();
});使用此模式,下载的更新将在下次应用启动时应用。
6.5 Periodic Checks (Capgo periodCheckDelay
)
periodCheckDelay6.5 定期检查(Capgo periodCheckDelay
)
periodCheckDelayThere is no interval-based check option. The background strategy already checks for updates on app start and resume (throttled to once every 15 minutes). For a custom interval, sync on the App event (see 6.4) or implement a JavaScript timer that calls .
resumesync()Capawesome没有基于间隔的检查选项。后台策略已在应用启动和恢复时检查更新(限制为每15分钟一次)。如需自定义间隔,可在App事件时同步(见6.4)或实现JavaScript定时器调用。
resumesync()6.6 Sync the Capacitor Project
6.6 同步Capacitor项目
bash
npx cap syncbash
npx cap syncStep 7: Migrate Code Signing
步骤7:迁移代码签名
Skip this step if Code Signing was not detected.
Capgo's key system () provides end-to-end encryption, while Capawesome Cloud uses RSA signing for bundle integrity verification. The keys are not interchangeable — generate a new key pair:
.capgo_key_v2bash
npx @capawesome/cli apps:liveupdates:generatesigningkey --app-type capacitorThis prints the config snippet for . Store the private key securely (e.g. as a CI/CD secret) and never commit it. Sign every upload by passing (see Step 8).
publicKeycapacitor.config.ts--private-keyKeep the files until the migration is verified, then delete them (Step 9).
.capgo_key_v2如果未检测到代码签名,可跳过此步骤。
Capgo的密钥系统()提供端到端加密,而Capawesome Cloud使用RSA签名进行包完整性验证。密钥不可互换——需生成新的密钥对:
.capgo_key_v2bash
npx @capawesome/cli apps:liveupdates:generatesigningkey --app-type capacitor这将打印中的配置片段。请安全存储私钥(例如作为CI/CD密钥),切勿提交到仓库。每次上传时需传递参数(见步骤8)进行签名。
capacitor.config.tspublicKey--private-key在迁移验证完成前保留文件,之后再删除(步骤9)。
.capgo_key_v2Step 8: Update CI/CD Pipelines
步骤8:更新CI/CD流水线
Skip this step if CI/CD was not detected.
如果未检测到CI/CD,可跳过此步骤。
8.1 Replace Authentication
8.1 替换身份验证方式
Generate a token in the Capawesome Cloud Console and store it as a CI/CD secret named . Then replace the Capgo API key:
CAPAWESOME_CLOUD_TOKENdiff
-- run: npx @capgo/cli@latest login "$CAPGO_API_KEY"
+- run: npx @capawesome/cli login --token ${{ secrets.CAPAWESOME_CLOUD_TOKEN }}Capgo commands often pass (or ) inline instead of using — remove those flags; the Capawesome CLI uses the token from .
--apikey-aloginlogin --token在Capawesome Cloud控制台生成令牌,并将其存储为名为的CI/CD密钥。然后替换Capgo API密钥:
CAPAWESOME_CLOUD_TOKENdiff
-- run: npx @capgo/cli@latest login "$CAPGO_API_KEY"
+- run: npx @capawesome/cli login --token ${{ secrets.CAPAWESOME_CLOUD_TOKEN }}Capgo命令通常会在命令行中传递(或)而非使用——请移除这些参数;Capawesome CLI会使用设置的令牌。
--apikey-aloginlogin --token8.2 Replace CLI Commands
8.2 替换CLI命令
Use the following command mapping (Capgo identifies apps by bundle ID as a positional argument; Capawesome uses ):
--app-id <UUID>| Capgo CLI | Capawesome CLI Equivalent |
|---|---|
| |
| No equivalent — follow this skill's steps instead |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| Manage bundles in the Console; set a bundle limit per channel for automatic cleanup |
| |
| |
| |
| |
| |
| |
| |
| |
Example upload replacement:
diff
-npx @capgo/cli@latest bundle upload com.example.app --apikey "$CAPGO_API_KEY" --path ./dist --channel production
+npx @capawesome/cli apps:liveupdates:upload --app-id <APP_ID> --path ./dist --channel productionThere is no equivalent for Capgo's flag — Capawesome Cloud assigns a bundle ID automatically. Use to associate a Git reference and for custom metadata instead.
--bundle <VERSION>--git-ref--custom-property key=value使用以下命令映射(Capgo通过Bundle ID作为位置参数识别应用;Capawesome使用):
--app-id <UUID>| Capgo CLI | Capawesome CLI等效命令 |
|---|---|
| |
| 无等效命令——请遵循本技能中的步骤 |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| 在控制台中管理包;为每个渠道设置包数量限制以自动清理 |
| |
| |
| |
| |
| |
| |
| |
| |
上传命令替换示例:
diff
-npx @capgo/cli@latest bundle upload com.example.app --apikey "$CAPGO_API_KEY" --path ./dist --channel production
+npx @capawesome/cli apps:liveupdates:upload --app-id <APP_ID> --path ./dist --channel productionCapgo的参数无等效项——Capawesome Cloud会自动分配包ID。可使用关联Git引用,使用添加自定义元数据。
--bundle <VERSION>--git-ref--custom-property key=valueStep 9: Test and Verify
步骤9:测试与验证
9.1 Verify Live Updates
9.1 验证实时更新
Ask the user whether to test live update functionality. If accepted:
- Make a small, visible change in the app (e.g., append " - Migration Test" to a heading).
- Build the web assets: .
npm run build - Upload the bundle:
bash
npx @capawesome/cli apps:liveupdates:upload --app-id <APP_ID> --channel <CHANNEL_NAME> - Revert the visible change, rebuild, and sync:
bash
npm run build && npx cap sync - Open the native project (or
npx cap open ios) and run on a device or emulator.npx cap open android - Verify the live update is applied. With , force-close and reopen the app, or switch away from the app and return after more than 15 minutes to trigger a check.
autoUpdateStrategy: "background"
询问用户是否测试实时更新功能。如果同意:
- 在应用中进行一个小的可见更改(例如,在标题后添加" - 迁移测试")。
- 构建Web资源:。
npm run build - 上传包:
bash
npx @capawesome/cli apps:liveupdates:upload --app-id <APP_ID> --channel <CHANNEL_NAME> - 撤销可见更改,重新构建并同步:
bash
npm run build && npx cap sync - 打开原生项目(或
npx cap open ios)并在设备或模拟器上运行。npx cap open android - 验证实时更新已应用。如果设置了,请强制关闭并重新打开应用,或切换出应用后等待15分钟以上再返回以触发检查。
autoUpdateStrategy: "background"
9.2 Clean Up
9.2 清理工作
After all features are verified:
- Confirm and
@capgo/capacitor-updaterare removed from@capgo/cli.package.json - Confirm the config is removed from
CapacitorUpdater/capacitor.config.ts.capacitor.config.json - Delete and
.capgo_key_v2from the project root (if present)..capgo_key_v2.pub - Remove Capgo CI/CD secrets (e.g. ) and any remaining
CAPGO_API_KEYcommands.@capgo/cli - Remind the user to cancel their Capgo subscription once all app versions using Capgo have been phased out.
所有功能验证通过后:
- 确认和
@capgo/capacitor-updater已从@capgo/cli中移除。package.json - 确认/
capacitor.config.ts中的capacitor.config.json配置已移除。CapacitorUpdater - 删除项目根目录中的和
.capgo_key_v2文件(如果存在)。.capgo_key_v2.pub - 移除Capgo CI/CD密钥(如)和所有剩余的
CAPGO_API_KEY命令。@capgo/cli - 提醒用户,当所有使用Capgo的应用版本都已淘汰后,可取消Capgo订阅。
Error Handling
错误处理
- fails after the plugin swap → Verify the installed
npx cap syncversion matches the Capacitor version in@capawesome/capacitor-live-update(package.jsonfor 8,@latestfor 7,@v7-ltsfor 6).@v6-lts - or similar runtime errors → Ensure all imports were updated from
CapacitorUpdater is not definedto@capgo/capacitor-updaterand the class name changed from@capawesome/capacitor-live-updatetoCapacitorUpdater.LiveUpdate - App reverts to the previous bundle after an update → is not called early enough (Capgo's
LiveUpdate.ready()equivalent). Add it as the first call in app initialization, or increasenotifyAppReady().readyTimeout - No update is applied although a bundle was uploaded → Verify the in the config is the Capawesome Cloud UUID (not the Capgo bundle ID) and that the upload targeted the channel the device resolves (check with
appId).getChannel() - Updates not detected with → Updates are only checked if the last check was more than 15 minutes ago. Force-close and restart the app.
autoUpdateStrategy: "background" - Signature verification fails after enabling code signing → The Capgo key pair was reused. Generate a new key pair with , update
apps:liveupdates:generatesigningkeyin the config, and re-upload withpublicKey.--private-key - → The installed plugin release is outdated. Update to the latest release of the matching dist-tag (
setConfig is not a functionfor Capacitor 8,@latestfor 7,@v7-ltsfor 6) — all current tag releases include@v6-lts.setConfig() - returns an error → Channel discovery must be enabled for the app in the Capawesome Cloud Console.
fetchChannels() - CI/CD pipeline fails after migration → Ensure the secret is set,
CAPAWESOME_CLOUD_TOKENruns before other commands, and every command passeslogin --tokenwith the Capawesome Cloud UUID.--app-id
- 替换插件后失败 → 确认安装的
npx cap sync版本与@capawesome/capacitor-live-update中的Capacitor版本匹配(Capacitor 8使用package.json,7使用@latest,6使用@v7-lts)。@v6-lts - 运行时出现或类似错误 → 确保所有导入已从
CapacitorUpdater is not defined更新为@capgo/capacitor-updater,且类名已从@capawesome/capacitor-live-update改为CapacitorUpdater。LiveUpdate - 更新后应用回滚到之前的包 → 调用时机不够早(对应Capgo的
LiveUpdate.ready())。请在应用初始化时尽早添加该调用,或增大notifyAppReady()值。readyTimeout - 已上传包但未应用更新 → 确认配置中的是Capawesome Cloud的UUID(而非Capgo的Bundle ID),且上传目标渠道与设备解析的渠道一致(可使用
appId检查)。getChannel() - 设置但未检测到更新 → 仅当上次检查超过15分钟时才会检查更新。请强制关闭并重启应用。
autoUpdateStrategy: "background" - 启用代码签名后签名验证失败 → 复用了Capgo密钥对。请使用生成新密钥对,更新配置中的
apps:liveupdates:generatesigningkey,并使用publicKey重新上传包。--private-key - 出现错误 → 安装的插件版本过时。请更新到对应dist-tag的最新版本(Capacitor 8使用
setConfig is not a function,7使用@latest,6使用@v7-lts)——所有当前标签版本均包含@v6-lts。setConfig() - 返回错误 → 需在Capawesome Cloud控制台中为应用启用渠道发现功能。
fetchChannels() - 迁移后CI/CD流水线失败 → 确保已设置密钥,
CAPAWESOME_CLOUD_TOKEN在其他命令前运行,且每个命令都通过login --token传递Capawesome Cloud的UUID。--app-id
Related Skills
相关技能
- — Detailed Capawesome Cloud setup procedures for Live Updates, Native Builds, and App Store Publishing.
capawesome-cloud - — Installing, configuring, and using the Capawesome CLI.
capawesome-cli - — Use this skill instead if the project migrates from Ionic Appflow rather than Capgo.
ionic-appflow-migration - — Connect an MCP client to the hosted Capawesome MCP server for always-current documentation and Capawesome Cloud management.
capawesome-mcp
- —— 实时更新、原生构建和应用商店发布的Capawesome Cloud详细设置流程。
capawesome-cloud - —— Capawesome CLI的安装、配置与使用。
capawesome-cli - —— 如果项目是从Ionic Appflow迁移而非Capgo,请使用此技能。
ionic-appflow-migration - —— 连接MCP客户端到托管的Capawesome MCP服务器,获取最新文档和Capawesome Cloud管理功能。
capawesome-mcp