To configure an existing Flutter project to use Patchwing, use patchwing init
at the root of a Flutter project:
patchwing init
This does three things:
Tells Patchwing to create a unique app_id for your app. This app_id is
how Patchwing identifies your app and knows which updates to send to it. It
does not need to be kept secret.
Creates a patchwing.yaml file in your project’s root directory.
patchwing.yaml contains the app_id mentioned above.
Adds the patchwing.yaml to the assets section of your pubspec.yaml file,
ensuring patchwing.yaml is bundled with your app’s assets and is available
to the Patchwing updater at runtime.
You can safely commit these changes, they will have no affect on your app when
not using Patchwing.
Example output for an app named patchwing_test:
$ patchwing init✓ Detecting product flavors (0.6s)? How should we refer to this app? (patchwing_test) patchwing_test✓ Patchwing is up-to-date (0.6s)✓ Flutter install is correct (4.5s)✓ AndroidManifest.xml files contain INTERNET permission (23ms)No issues detected!🐦 Patchwing initialized successfully!✅ A patchwing app has been created.✅ A "patchwing.yaml" has been created.✅ The "pubspec.yaml" has been updated to include "patchwing.yaml" as an asset.Reference the following commands to get started:📦 To create a new release use: "patchwing release".🚀 To push an update use: "patchwing patch".👀 To preview a release use: "patchwing preview".For more information about Patchwing, visit https://patchwing.net
The generated patchwing.yaml should look similar to:
# This file is used to configure the Patchwing updater used by your application.# Learn more at https://patchwing.net# This file should be checked into version control.# This is the unique identifier assigned to your app.# It is used by your app to request the correct patches from Patchwing servers.app_id: 8c846e87-1461-4b09-8708-170d78331aca
If your application contains flavors, patchwing init will create an app per
flavor and patchwing.yaml will include all flavors and their corresponding
app_ids:
# This file is used to configure the Patchwing updater used by your application.# Learn more at https://patchwing.net# This file should be checked into version control.# This is the unique identifier assigned to your app.# It is used by your app to request the correct patches from Patchwing servers.app_id: 864ab1b0-ba78-4b15-990a-a63cec35a41bflavors: development: 864ab1b0-ba78-4b15-990a-a63cec35a41b production: 6b6e6631-4fbe-4645-8d9d-d5247656d975