Parker Lougheed | 22570da | 2024-09-24 16:03:08 -0400 | [diff] [blame] | 1 | ## Prerequisites |
Kate Lovett | ed8eaf1 | 2024-05-17 17:12:18 -0500 | [diff] [blame] | 2 | |
Parker Lougheed | 22570da | 2024-09-24 16:03:08 -0400 | [diff] [blame] | 3 | * Linux, macOS, or Windows |
Kate Lovett | ed8eaf1 | 2024-05-17 17:12:18 -0500 | [diff] [blame] | 4 | |
| 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 Lovett | 1fbcbb7 | 2024-05-28 10:12:10 -0500 | [diff] [blame] | 16 | [also working on the Flutter engine](../engine/contributing/Setting-up-the-Engine-development-environment.md), |
Kate Lovett | ed8eaf1 | 2024-05-17 17:12:18 -0500 | [diff] [blame] | 17 | 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 | |
| 24 | 1. 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 | |
| 28 | 1. 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 | |
| 32 | 1. [Fork the flutter/flutter repo](https://github.com/flutter/flutter/fork) into your own GitHub account. |
| 33 | |
| 34 | 1. 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 | |
| 38 | 1. Verify the upstream and origin repository you've specified for your clone. |
| 39 | - `git remote -v` |
| 40 | |
| 41 | 1. 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 | |
| 45 | 1. `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 | |
| 58 | Next steps: |
| 59 | |
Kate Lovett | 1fbcbb7 | 2024-05-28 10:12:10 -0500 | [diff] [blame] | 60 | * [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 Lovett | 65abc95 | 2024-05-23 15:19:04 -0500 | [diff] [blame] | 62 | * [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. |