Initialize
Connect a Flutter project to an app in the console. You do this once per project; it works for Android and iOS together.
Before you start
- The OverPush CLI installed. See Quick start.
- An app created in the console, and its app id copied. You need the developer role or higher in its organization. See Roles.
Connect the project
-
Run init
From the project root, the folder with
pubspec.yaml:$ overpush init --app-id cp_your_app_idWithout
--app-id, it asks for it. If this computer isn't signed in yet, your browser opens to sign in, and the project is connected as soon as you do. There's nothing to copy back. -
Add the package
$ flutter pub add overpushThat's the only change to your app's code. You don't call anything from
main.dart. -
Commit
Commit
overpush.yamland thepubspec.yamlchange. Teammates who clone the project runoverpush initonce on their own computer.
What init changes
| File | What | Commit it? |
|---|---|---|
overpush.yaml | The app id, and any options you add later. | Yes |
.overpush/key | This computer's key for this app. | No. It's added to .gitignore for you. |
AndroidManifest.xml | Adds the INTERNET permission if the app doesn't have it, so Android can download patches. --no-fix only reports it. | Yes |
The app id isn't a secret; it ends up inside your app. What lets a computer publish is its key, which stays on that computer.
Several computers, and CI
Each computer that runs overpush init gets its own key. The console lists them under the app's Settings, where you can remove one; that computer stops being able to publish at once. For CI, see Continuous integration.
Reconnecting
To connect a project to a different app, or start fresh:
$ overpush init --force
To disconnect this computer, overpush logout removes its key.