Windows Setup

System requirements

To install and run Flutter, your development environment must meet these minimum requirements:

  • Operating Systems: Windows 7 SP1 or later (64-bit)
  • Disk Space: 400 MB (does not include disk space for IDE/tools).
  • Tools: Flutter depends on these tools being available in your environment.
    • Windows PowerShell 5.0 or newer (this is pre-installed with Windows 10)
    • Git for Windows 2.x, with the Use Git from the Windows Command Prompt option.If Git for Windows is already installed, make sure you can run git commands from the command prompt or PowerShell.

Get the Flutter SDK

  1. Download the following installation bundle to get the latest stable release of the Flutter SDK:flutter_macos_v1.12.13+hotfix.5-stable.zipFor other release channels, and older builds, see the SDK archive page.
  2. Extract the file in the desired location, for example:content_copy$ cd ~/development $ unzip ~/Downloads/flutter_macos_v1.12.13+hotfix.5-stable.zip Steps 1 and 2 can be replaced. If you don’t want to install a fixed version of the installation bundle. The Flutter SDK is free and open source, so you can get the source code from the Flutter repo on GitHub, and change branches or tags as needed.content_copy $ git clone https://github.com/flutter/flutter.git
  3. Add the flutter tool to your path:content_copy $ export PATH="$PATH:`pwd`/flutter/bin" This command sets your PATH variable for the current terminal window only. To permanently add Flutter to your path, see Update your path.
  4. Optionally, pre-download development binaries:The flutter tool downloads platform-specific development binaries as needed. For scenarios where pre-downloading these artifacts is preferable (for example, in hermetic build environments, or with intermittent network availability), iOS and Android binaries can be downloaded ahead of time by running:content_copy$ flutter precache For additional download options, see flutter help precache.

You are now ready to run Flutter commands!

 Note: To update an existing version of Flutter, see Upgrading Flutter.

Run flutter doctor

Run the following command to see if there are any dependencies you need to install to complete the setup (for verbose output, add the -v flag):content_copy

$ flutter doctor

This command checks your environment and displays a report to the terminal window. The Dart SDK is bundled with Flutter; it is not necessary to install Dart separately. Check the output carefully for other software you might need to install or further tasks to perform (shown in bold text).

For example:content_copy

[-] Android toolchain - develop for Android devices
    • Android SDK at /Users/obiwan/Library/Android/sdk
    ✗ Android SDK is missing command line tools; download from https://goo.gl/XxQghQ
    • Try re-installing or updating your Android SDK,
      visit https://flutter.dev/setup/#android-setup for detailed instructions.

The following sections describe how to perform these tasks and finish the setup process.

Once you have installed any missing dependencies, run the flutter doctor command again to verify that you’ve set everything up correctly.

 Warning: The flutter tool uses Google Analytics to anonymously report feature usage statistics and basic crash reports. This data is used to help improve Flutter tools over time.

Flutter tool analytics are not sent on the very first run. To disable reporting, type flutter config --no-analytics. To display the current setting, type flutter config. If you opt out of analytics, an opt-out event will be sent, and then no further information will be sent by the Flutter tool.

By downloading the Flutter SDK, you agree to the Google Terms of Service. Note: The Google Privacy Policy describes how data is handled in this service.

Moreover, Flutter includes the Dart SDK, which may send usage metrics and crash reports to Google.

Update your path

You can update your PATH variable for the current session at the command line, as shown in Get the Flutter SDK. You’ll probably want to update this variable permanently, so you can run flutter commands in any terminal session.

The steps for modifying this variable permanently for all terminal sessions are machine-specific. Typically you add a line to a file that is executed whenever you open a new window. For example:

  1. Determine the directory where you placed the Flutter SDK. You need this in Step 3.
  2. Open (or create) the rc file for your shell. For example, macOS Mojave (and earlier) uses the Bash shell by default, so edit $HOME/.bash_profile or $HOME/.bashrc. macOS Catalina uses the Z shell by default, so edit $HOME/.zshrc. If you are using a different shell, the file path and filename will be different on your machine.
  3. Add the following line and change [PATH_TO_FLUTTER_GIT_DIRECTORY] to be the path where you cloned Flutter’s git repo:content_copy$ export PATH="$PATH:[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/bin"
  4. Run source $HOME/.<rc file> to refresh the current window, or open a new terminal window to automatically source the file.
  5. Verify that the flutter/bin directory is now in your PATH by running:content_copy$ echo $PATH Verify that the flutter command is available by running:content_copy$ which flutter

macOS install

System requirements

To install and run Flutter, your development environment must meet these minimum requirements:

  • Operating Systems: macOS (64-bit)
  • Disk Space: 2.8 GB (does not include disk space for IDE/tools).
  • Tools: Flutter depends on these command-line tools being available in your environment.
    • bash
    • curl
    • git 2.x
    • mkdir
    • rm
    • unzip
    • which

Install Xcode

To develop Flutter apps for iOS, you need a Mac with Xcode.

  1. Install the latest stable version of Xcode (using web download or the Mac App Store).
  2. Configure the Xcode command-line tools to use the newly-installed version of Xcode by running the following from the command line:content_copy$ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer $ sudo xcodebuild -runFirstLaunch This is the correct path for most cases, when you want to use the latest version of Xcode. If you need to use a different version, specify that path instead.
  3. Make sure the Xcode license agreement is signed by either opening Xcode once and confirming or running sudo xcodebuild -license from the command line.

Versions older than the latest stable version may still work, but are not recommended for Flutter development. Using old versions of Xcode to target bitcode is not supported, and is likely not to work.

With Xcode, you’ll be able to run Flutter apps on an iOS device or on the simulator.

Set up the iOS simulator

To prepare to run and test your Flutter app on the iOS simulator, follow these steps:

  1. On your Mac, find the Simulator via Spotlight or by using the following command:content_copy$ open -a Simulator
  2. Make sure your simulator is using a 64-bit device (iPhone 5s or later) by checking the settings in the simulator’s Hardware > Device menu.
  3. Depending on your development machine’s screen size, simulated high-screen-density iOS devices might overflow your screen. Set the device scale under the Window > Scale menu in the simulator.

Create and run a simple Flutter app

To create your first Flutter app and test your setup, follow these steps:

  1. Create a new Flutter app by running the following from the command line:content_copy$ flutter create my_app
  2. my_app directory is created, containing Flutter’s starter app. Enter this directory:content_copy$ cd my_app
  3. To launch the app in the Simulator, ensure that the Simulator is running and enter:content_copy$ flutter run

Deploy to iOS devices

To deploy your Flutter app to a physical iOS device you need the third-party CocoaPods dependency manager and an Apple Developer account. You’ll also need to set up physical device deployment in Xcode.

  1. Install and set up CocoaPods by running the following commands:content_copy$ sudo gem install cocoapods $ pod setup
  2. Follow the Xcode signing flow to provision your project:
    1. Open the default Xcode workspace in your project by running open ios/Runner.xcworkspace in a terminal window from your Flutter project directory.
    2. Select the device you intend to deploy to in the device drop-down menu next to the run button.
    3. Select the Runner project in the left navigation panel.
    4. In the Runner target settings page, make sure your Development Team is selected. The UI varies depending on your version of Xcode.
      • For Xcode 10, look under General > Signing > Team.
      • For Xcode 11 and newer, look under Signing & Capabilities > Team.
      When you select a team, Xcode creates and downloads a Development Certificate, registers your device with your account, and creates and downloads a provisioning profile (if needed).
      • To start your first iOS development project, you might need to sign into Xcode with your Apple ID.  Development and testing is supported for any Apple ID. Enrolling in the Apple Developer Program is required to distribute your app to the App Store. For details about membership types, see Choosing a Membership.
      • The first time you use an attached physical device for iOS development, you need to trust both your Mac and the Development Certificate on that device. Select Trust in the dialog prompt when first connecting the iOS device to your Mac.Then, go to the Settings app on the iOS device, select General > Device Management and trust your Certificate.
      • If automatic signing fails in Xcode, verify that the project’s General > Identity > Bundle Identifier value is unique. 
  3. Start your app by running flutter run.

Linux install

System requirements

To install and run Flutter, your development environment must meet these minimum requirements:

  • Operating Systems: Linux (64-bit)
  • Disk Space: 600 MB (does not include disk space for IDE/tools).
  • Tools: Flutter depends on these command-line tools being available in your environment.
    • bash
    • curl
    • git 2.x
    • mkdir
    • rm
    • unzip
    • which
    • xz-utils
  • Shared libraries: Flutter test command depends on this library being available in your environment.
    • libGLU.so.1 – provided by mesa packages such as libglu1-mesa on Ubuntu/Debian

Get the Flutter SDK

  1. Download the following installation bundle to get the latest stable release of the Flutter SDK:flutter_linux_v1.12.13+hotfix.5-stable.tar.xzFor other release channels, and older builds, see the SDK archive page.
  2. Extract the file in the desired location, for example:content_copy$ cd ~/development $ tar xf ~/Downloads/flutter_linux_v1.12.13+hotfix.5-stable.tar.xz Steps 1 and 2 can be replaced. If you don’t want to install a fixed version of the installation bundle. The Flutter SDK is free and open source, so you can get the source code from the Flutter repo on GitHub, and change branches or tags as needed.content_copy$ git clone https://github.com/flutter/flutter.git
  3. Add the flutter tool to your path:content_copy$ export PATH="$PATH:`pwd`/flutter/bin" This command sets your PATH variable for the current terminal window only. To permanently add Flutter to your path, see Update your path.
  4. Optionally, pre-download development binaries:The flutter tool downloads platform-specific development binaries as needed. For scenarios where pre-downloading these artifacts is preferable (for example, in hermetic build environments, or with intermittent network availability), iOS and Android binaries can be downloaded ahead of time by running:content_copy$ flutter precache For additional download options, see flutter help precache.

You are now ready to run Flutter commands!

 Note: To update an existing version of Flutter, see Upgrading Flutter.

Run flutter doctor

Run the following command to see if there are any dependencies you need to install to complete the setup (for verbose output, add the -v flag):content_copy

$ flutter doctor

This command checks your environment and displays a report to the terminal window. The Dart SDK is bundled with Flutter; it is not necessary to install Dart separately. Check the output carefully for other software you might need to install or further tasks to perform (shown in bold text).

For example:content_copy

[-] Android toolchain - develop for Android devices
    • Android SDK at /Users/obiwan/Library/Android/sdk
    ✗ Android SDK is missing command line tools; download from https://goo.gl/XxQghQ
    • Try re-installing or updating your Android SDK,
      visit https://flutter.dev/setup/#android-setup for detailed instructions.

The following sections describe how to perform these tasks and finish the setup process.

Once you have installed any missing dependencies, run the flutter doctor command again to verify that you’ve set everything up correctly.

Update your path

You can update your PATH variable for the current session at the command line, as shown in Get the Flutter SDK. You’ll probably want to update this variable permanently, so you can run flutter commands in any terminal session.

The steps for modifying this variable permanently for all terminal sessions are machine-specific. Typically you add a line to a file that is executed whenever you open a new window. For example:

  1. Determine the directory where you placed the Flutter SDK. You need this in Step 3.
  2. Open (or create) the rc file for your shell. For example, Linux uses the Bash shell by default, so edit $HOME/.bashrc. If you are using a different shell, the file path and filename will be different on your machine.
  3. Add the following line and change [PATH_TO_FLUTTER_GIT_DIRECTORY] to be the path where you cloned Flutter’s git repo:content_copy$ export PATH="$PATH:[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/bin"
  4. Run source $HOME/.<rc file> to refresh the current window, or open a new terminal window to automatically source the file.
  5. Verify that the flutter/bin directory is now in your PATH by running:content_copy$ echo $PATH Verify that the flutter command is available by running:content_copy$ which flutter

Update path directly

In some cases, your distribution may not permanently acquire the path when using the above directions. When this occurs, you can change the environment variables file directly. These instructions require administrator privileges:

  1. Determine the directory where you placed the Flutter SDK.
  2. Locate the etc directory at the root of the system, and open the profile file with root privileges.content_copy $ sudo nano /etc/profile
  3. Update the PATH string with the location of your Flutter SDK directory.content_copyif [ "`id -u`" -eq 0 ]; then PATH="..." else PATH="/usr/local/bin:...:[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/bin" fi export PATH
  4. End the current session or reboot your system.
  5. Once you start a new session, verify that the flutter command is available by running:content_copy$ which flutter