blob: 4dfb8591a2adab5c4a3bb64ea28d0fb79563ff6a [file] [log] [blame] [view]
Parker Lougheed22570da2024-09-24 16:03:08 -04001## Prerequisites
Kate Lovetted8eaf12024-05-17 17:12:18 -05002
Parker Lougheed22570da2024-09-24 16:03:08 -04003 * Linux, macOS, or Windows
Kate Lovetted8eaf12024-05-17 17:12:18 -05004
5 * `git` (used for source version control)
6
7 * An IDE, such as [Android Studio with the Flutter plugin](https://docs.flutter.dev/development/tools/android-studio) or [VS Code](https://docs.flutter.dev/development/tools/vs-code)
8
9 * Android platform tools
10 - Mac: `brew install --cask android-platform-tools`
11 - Linux: `sudo apt-get install android-tools-adb`
12
13 Verify that `adb` is in your [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) (that `which adb` prints sensible output).
14
15 If you're
Kate Lovett1fbcbb72024-05-28 10:12:10 -050016 [also working on the Flutter engine](../engine/contributing/Setting-up-the-Engine-development-environment.md),
Kate Lovetted8eaf12024-05-17 17:12:18 -050017 you can use the copy of the Android platform tools in
18 `.../engine/src/third_party/android_tools/sdk/platform-tools`.
19
20 * Python (used by some of our tools)
21
22## Set up your environment
23
241. Clone the flutter/flutter repo using either SSH or HTTPS (SSH is recommended, but requires a working [SSH key](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/about-ssh) on your GitHub account):
25 - SSH: `git clone git@github.com:flutter/flutter.git`
26 - HTTPS: `git clone https://github.com/flutter/flutter.git`
27
281. Change into the directory of the cloned repository and rename the origin remote to upstream:
29 1. `cd flutter`
30 1. `git remote rename origin upstream`
31
321. [Fork the flutter/flutter repo](https://github.com/flutter/flutter/fork) into your own GitHub account.
33
341. Add your fork as the origin remote to your local clone either using SSH or HTTPS (SSH is recommended, but requires a working [SSH key](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/about-ssh) on your GitHub account) by replacing ████████ with your GitHub account name:
35 - SSH: `git remote add origin git@github.com:████████/flutter.git`
36 - HTTPS: `git remote add origin https://github.com/████████/flutter.git`
37
381. Verify the upstream and origin repository you've specified for your clone.
39 - `git remote -v`
40
411. Add the repo's `bin` directory to your [PATH](https://en.wikipedia.org/wiki/PATH_(variable)): e.g. on UNIX, using `export PATH="$PATH:$HOME/<path to flutter repository>/bin"`
42
43 - If you already have a Flutter installation you will either need to remove it from your PATH, or use a full path whenever you are running `flutter` in this repository. If you have version solving errors when trying to run examples below, you are running a version of Flutter other than the one checked out here.
44
451. `flutter update-packages`
46
47 This will recursively fetch all the Dart packages that
48 Flutter depends on. If version solving failed, try `git fetch upstream` to update Flutter versions before `flutter update-packages`.
49
50
51> **Tip**
52> If you plan on using IntelliJ as your IDE, then also run
53> `flutter ide-config --overwrite` to create all of the IntelliJ configuration
54> files so you can open the main flutter directory as a project and run examples
55> from within the IDE.
56
57
58Next steps:
59
Kate Lovett1fbcbb72024-05-28 10:12:10 -050060 * [Running examples](../examples/Running-examples.md), to see if your setup works.
61 * [The flutter tool](../tool/README.md), to learn about how the `flutter` command line tool works.
Kate Lovett65abc952024-05-23 15:19:04 -050062 * [Style guide for Flutter repo](Style-guide-for-Flutter-repo.md), to learn how to write code for Flutter.
63 * [Tree hygiene](Tree-hygiene.md), to learn about how to submit patches.
64 * [Signing commits](Signing-commits.md), to configure your environment to securely sign your commits.