Migration Summary
- Capgo 開発チームがライブアプリをデプロイ済みのアプリに送信するのに役立つサービスです。
- Capacitor jQuery Mobile、Framework 7、Sencha、KendoUI、Ionic、または独自のカスタムソリューションで書かれたJSアプリも移行できます。.
- 既存のIonicアプリは必要ありません。 Colt
App Center Build (Android/iOSアプリをビルドする) に対する同等のサービスを提供しています。Test、Diagnostics、Analyticsサービスも提供しています。
注意 アプリがまだCordovaを使用している場合、Capacitor に移行する必要があります。Capgo
Built by the Ionic team as a spiritual successor to Cordova, Capacitor allows development to move close to the native tooling and capabilities with the goal of providing an even better user experience and performance.
幸いなことに、移行プロセスは簡単で、Cordova プラグインの多くは Capacitor 互換性があります。 ここから始める.
Capgo について
Capgo は、時間の経過とともにアプリを更新することを取り巻くものです。開発チームは、アプリのユニークな機能に集中することができ、複雑なアプリ配信プロセスを Capgo に委託することができます。
Capgo は、Web 配信とモバイルの間のギャップを埋めます。
Capgo の前提条件
App Center と同様に Capgo Git リポジトリにホストされている Azure DevOps、Bitbucket、 GitHub、および GitLab をサポートします。
Capgo を CLI でインストールする
注意
Node と NPM がコンピューターにインストールされていることを確認し、続行する前に必要なものは何ですか。常に __CAPGO_KEEP_1__ を使用してください。 現在のLTSバージョン Capgo の古いバージョンは使用しないでください。
作成 package.json Capacitor の設定ファイルを作成し
注意
開始する前に、最新の変更を取り入れるために、Git ブランチを作成することをお勧めします。
しかし Capgo capacitor が自動化するために作成されたため、capacitor アプリには必要なファイルが 1 つあります。まず、ファイルを作成してください。アプリの root で実行することで、ファイルを作成する最も簡単な方法は capacitor.config.json 次に、__CAPGO_KEEP_0__ を __CAPGO_KEEP_1__ の質問状に基づいて初期化してください。
npm install @capacitor/core
Then, initialize Capacitor using the CLI questionnaire:
npx cap init
CLI
最後に、プロジェクトに新しいファイルをコミットしてください:
git add .git commit -m "added package json and capacitor config" && git push
Migrate the Code
新しい必要なファイルが置かれたら、実際のアプリケーションに焦点を当ててください。 Capgo アプリケーション自体に注目してください。 Capgo アプリケーションが、ディレクトリ名が「__CAPGO_KEEP_0__」のディレクトリ内に、すべてのビルド済みアプリケーションを含むことを期待しています。 dist.
ディレクトリにビルド済みのcodeが存在しない場合、codeの設定ファイルでこの値を変更してください。 dist directory, change this value in the Capacitor config file.
アプリケーションの構造

Capgo
With your app ready for __CAPGO_KEEP_0__ integration, it’s time to sign up, and get your __CAPGO_KEEP_0__ key to upload your first version! Capgoにアプリが用意できたので、サインアップして、Capgoキーを取得して、最初のバージョンをアップロードする準備ができました。 Begin by signing up for a API account. Capgoアカウントにサインアップすることから始めましょう。.
Once you’re logged into Capgo, navigate to the Account page then click on API key, then click on the ‘write’ key to copy it to your clipboard.
Capgoにログインしたら、Accountページに移動し、SDKキーをクリックし、‘write’キーをクリックして、クリップボードにコピーしてください。
Install the Capacitor __CAPGO_KEEP_1__
npm i @capgo/capacitor-updater && npx cap sync
Capacitorに__CAPGO_KEEP_1__をインストールする
From a command line, directly into the root of your code app folder, run the following command:
import { CapacitorUpdater } from '@capgo/capacitor-updater'
CapacitorUpdater.notifyAppReady()
コマンドラインから、__CAPGO_KEEP_0__アプリのルートフォルダに直接移動し、以下のコマンドを実行してください。
To install the plugin into your __CAPGO_KEEP_0__ app.
__CAPGO_KEEP_0__アプリにプラグインをインストールするには、以下の手順に従ってください。 Capgo SDK 特定なデプロイチャンネルデスティネーションにリスニングするために、nativeアプリケーションに追加します。Webビルドがチャンネルデスティネーションに割り当てられた場合、そのアップデートは、指定されたチャンネルデスティネーションにリスニングする設定されたバイナリを実行しているユーザー機器にデプロイされます。
Capgoにログイン
最初に、 all apikey present in your account to log in with the CLI:
npx @capgo/cli@latest login YOURKEY
__CAPGO_KEEP_0__:
Let’s get started by first creating the app in Capgo Cloud with the CLI.
npx @capgo/cli@latest app add
アプリを作成するには、まずCapacitor Cloudに__CAPGO_KEEP_1__を使用してアプリを作成してください。
This command will use all variables defined in the __CAPGO_KEEP_0__ config file to create the app.
Run the command to build your code and send it to Capgo with:
npx @capgo/cli@latest bundle upload --channel production
__CAPGO_KEEP_0__をビルドし、__CAPGO_KEEP_1__に送信するコマンドを実行してください。 package.json ファイル。
チェックイン Capgo ビルドが存在する場合にチェックする。
__CAPGO_KEEP_0__でテストすることもできます。私のモバイルサンドボックスアプリ デフォルトのチャンネルを設定.
__CAPGO_KEEP_0__にアプリを送信した後、チャンネルを設定する必要があります。__CAPGO_KEEP_0__からアプリが更新を受け取るようにします。
After you have sent your app to Capgo, you need to make your channel default to let apps receive updates from Capgo.
npx @capgo/cli@latest channel set production -s default
次に、
__CAPGO_KEEP_0__
import { CapacitorUpdater } from '@capgo/capacitor-updater'
CapacitorUpdater.notifyAppReady()
__CAPGO_KEEP_0__ npm run build && npx cap copy を更新してください。
デバイスでライブアップデートを受信
Deployからアプリケーションにライブアップデートを受信するには、デバイスまたはエミュレータでアプリを実行する必要があります。 この方法でアプリをローカルでエミュレータまたはコンピュータに接続されたデバイスで起動するのは簡単です。
npx cap run [ios | android]
アプリを開き、バックグラウンドに置き、再度アプリを開きます。 ログに表示されるのは、アプリがアップデートしたことを示すものです。
おめでとうございます! 🎉 これが最初のライブアップデートの成功です。これは、ライブアップデートのすべてのことができることの始まりです。 さらに学びたい場合は、ライブアップデートのドキュメントをご覧ください。 ライブアップデートのドキュメント.
アプリセンター依存関係を削除
Now that we’ve integrated Capgo’s services, you should remove any references to App Center. Besides being a best practice to remove unused code/services, removing the SDK should reduce the size of your apps.
最初に、ターミナルを開き、App Center プラグインをアンインストールしてください。
cordova plugin remove cordova-plugin-appcenter-analytics cordova-plugin-appcenter-crashes cordova-plugin-code-push
次に、 config.xml をオープンし、以下の値を削除してください。 形式は次のようになります: preference __CAPGO_KEEP_0__
<preference name="APP_SECRET" value="0000-0000-0000-0000-000000000000" /><preference name="CodePushDeploymentKey" value="YOUR-ANDROID-DEPLOYMENT-KEY" /><preference name="CodePushPublicKey" value="YOUR-PUBLIC-KEY" />
If you were using App Center Analytics in your app, remove the following preferences elements: APPCENTER_ANALYTICS_ENABLE_IN_JS and APPCENTER_CRASHES_ALWAYS_SEND.
Remove the following <access /> elements:
<access origin="https://codepush.appcenter.ms" /><access origin="https://codepush.blob.core.windows.net" /><access origin="https://codepushupdates.azureedge.net" />
Remove the reference to CodePush in the CSP meta tag in the index.html file (https://codepush.appcenter.ms):
<meta http-equiv="Content-Security-Policy" content="default-src https://codepush.appcenter.ms 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *" />
Finally, within your app, remove any code references to App Center services, such as codePush.sync();.
Next Steps
You’ve migrated from App Center to Capgo, utilizing the Live Updates. This is just the beginning of what you can use Capgo for. Explore the rest of the service includes Channel (multiple environments) and override. Cloud CLI integration, use Capgo inside your CI/CD platform of choice (such as GitHub Action, GitLab, Jenkins, and more).
Automatic send app update
あなたの code が GitHub にホストされている場合、 GitHub アクションを利用して、自動ビルドとリリースを設定できます。
2 番目の記事を作成し、設定方法を説明しました。
クレジット
__CAPGO_KEEP_1__ に多大な感謝を。 Ionicこの記事は、以下の記事を参考にしています。 この記事は Chat-GPT-3 で書き直され、適応されました。 __CAPGO_KEEP_0__ から App Center への移行から続けてください。
あなたが Capgo を使用している場合
__CAPGO_KEEP_0__ から App Center への移行 Migrating from App Center to Capgo エンタープライズオペレーション Capgo Enterprise Capgoの製品ワークフローについて Ionic Enterprise Plugin Alternatives Ionic Enterprise Plugin Alternativesの製品ワークフローについて Capgo Alternatives Capgo Alternativesの製品ワークフローについて Capgo Consulting Capgo Consultingの製品ワークフローについて Capgo Premium Support Capgo Premium Supportの製品ワークフローについて