Add macOS as a target platform for Flutter from web start

To add macOS as a Flutter app target for macOS, follow this procedure.

Install Xcode

  1. Allocate a minimum of 26 GB of storage for Xcode. Consider allocating 42 GB of storage for an optimal configuration.
  2. Install Xcode 15 to debug and compile native Swift or ObjectiveC code.

Configure iOS development


Install and configure Xcode


To develop Flutter apps for macOS, install Xcode to compile to native bytecode.

  1. Open the App Store and sign in.

  2. Search for Xcode.

  3. Click Install.

    The Xcode installer takes up 6+ GB of storage. The download make take some time.

  4. To configure the command-line tools to use the installed version of Xcode, use the following commands.

    sudo sh -c 'xcode-select -s /Applications/ && xcodebuild -runFirstLaunch'

    Use this path for the latest version of Xcode. If you need to use a different version, specify that path instead.

  5. Sign the Xcode license agreement.

    sudo xcodebuild -license

Try to keep to the current version of Xcode.

Install CocoaPods


If your apps depend on Flutter plugins with native macOS code, install CocoaPods. This program bundles various dependencies across Flutter and macOS code.

To install and set up CocoaPods, run the following commands:

  1. Install cocoapods following the CocoaPods install guide.

    sudo gem install cocoapods
  2. Launch your preferred text editor.

  3. Open the Zsh environmental variable file ~/.zshenv in your text editor.

  4. Copy the following line and paste it at the end of your ~/.zshenv file.

    export PATH=$HOME/.gem/bin:$PATH
  5. Save your ~/.zshenv file.

  6. To apply this change, restart all open terminal sessions.

Check your development setup


help Help

Run Flutter doctor


The flutter doctor command validates that all components of a complete Flutter development environment for macOS.

  1. Open your Terminal.

  2. To verify your installation of all the components, run the following command.

    flutter doctor

As you chose to develop for macOS, you do not need all components. If you followed this guide, the result of your command should resemble:

Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.22.1, on macOS 14.4.0 23E214 darwin-arm64, locale en)
[!] Android toolchain - develop for Android devices
[✓] Chrome - develop for the web
[✓] Xcode - develop for iOS and macOS (Xcode 15)
[!] Android Studio (not installed)
[✓] VS Code (version 1.89)
[✓] Connected device (1 available)
[✓] Network resources

! Doctor found issues in 2 categories.

Troubleshoot Flutter doctor issues


When the flutter doctor command returns an error, it could be for Flutter, VS Code, Xcode, the connected device, or network resources.

If the flutter doctor command returns an error for any of these components, run it again with the verbose flag.

flutter doctor -v

Check the output for other software you might need to install or further tasks to perform.

If you change the configuration of your Flutter SDK or its related components, run flutter doctor again to verify the installation.

Start developing macOS desktop apps with Flutter


Congratulations! Now that you have installed all prerequisites and the Flutter SDK, you should be able to start developing Flutter apps for macOS desktop.