Contributor Setup
flutter_compile automates the setup of Flutter framework, engine, and DevTools contributor environments. This replaces the manual steps in the official Flutter wiki.
Overview
There are three contributor environments you can install:
| Environment | Command | What It Sets Up |
|---|---|---|
| Flutter Framework | install flutter | Clones flutter/flutter, sets up remotes |
| Engine | install engine | depot_tools, gclient sync, engine repo |
| DevTools | install devtools | Clones flutter/devtools, sets up remotes |
install flutter before install engine.
Install Flutter Framework
flutter_compile install flutter
This command will:
- Prompt you to choose SSH or HTTPS for git cloning
- Prompt for your GitHub username (for fork remote)
- Clone the Flutter framework repository
- Set up
upstream(flutter/flutter) andorigin(your fork) remotes - Add the Flutter binary to your PATH via
~/.flutter_compile_env - Save the path to
~/.flutter_compilerc
IDE flag
When called from an IDE extension, the --ide flag skips or auto-accepts IDE-specific prompts:
flutter_compile install flutter --ide vscode
flutter_compile install flutter --ide intellij
Install Engine
flutter_compile install engine
This command will:
- Verify Flutter is installed (required dependency)
- Install depot_tools if not already present
- Configure gclient with the engine repository
- Run
gclient syncto fetch engine source - Set up git remotes (upstream/origin)
- Save paths to
~/.flutter_compilerc
Platform flag
flutter_compile install engine --platform android
flutter_compile install engine --platform ios
Force sync
If gclient sync fails or you need a clean state:
flutter_compile install engine --force
This runs gclient sync --reset --force with automatic retry.
Install DevTools
flutter_compile install devtools
Clones the DevTools repository, sets up git remotes, and configures tracking branches.
Syncing With Upstream
Keep your contributor environments up to date:
# Sync all environments
flutter_compile sync
# Sync individually
flutter_compile sync flutter # fetch upstream, rebase, update-packages
flutter_compile sync engine # gclient sync, ninja build
flutter_compile sync devtools # fetch upstream, rebase, pub get
For a forced engine sync (resets local changes):
flutter_compile sync engine --force
Verify Your Setup
Run doctor to check everything is configured correctly:
flutter_compile doctor
Doctor checks:
- Required Tools: git, python3, dart, flutter
- Engine Tools: gclient, ninja, Xcode (macOS) or Visual Studio (Windows)
- Config:
~/.flutter_compilercvalidity - Environments: Flutter contributor, DevTools contributor, Engine contributor
Uninstalling Environments
flutter_compile uninstall flutter
flutter_compile uninstall engine
flutter_compile uninstall devtools
Each uninstall command:
- Removes the installation directory
- Removes PATH exports from
~/.flutter_compile_env - Cleans the corresponding entry in
~/.flutter_compilerc
When uninstalling the engine, you'll be prompted whether to also remove depot_tools.
Default Installation Paths
| Component | Default Path |
|---|---|
| Flutter Framework | ~/flutter_compile/flutter |
| Flutter Binary | ~/flutter_compile/flutter/bin/flutter |
| Engine Workspace | ~/flutter_compile/engine |
| DevTools | ~/flutter_compile/devtools |
| Depot Tools | ~/flutter_compile/depot_tools |
Typical Contributor Workflow
# Initial setup (one-time)
flutter_compile install flutter
flutter_compile install engine
flutter_compile doctor
# Daily workflow
flutter_compile sync flutter
flutter_compile build engine
flutter_compile run -- -d macos
# Clean up builds
flutter_compile clean host_debug_unopt