Skip to content

Setup iOS apps develop environment on macOS

System requirements

Hardware requirements

Software requirements

TIP

You do not need to install Dart SDK separately as the Flutter SDK includes the full Dart SDK.

Operating system

  • macOS 10.15 (Catalina) or later.

Development tools

Download and install the following packages:

  • Xcode 15 to debug and compile native Swift or ObjectiveC code. The Xcode installation includes Git to manage source code.

    WARNING

    Use the latest Xcode if possible, but do not choose the beta version.

    Install
    1. Open the App Store and sign in.

    2. Search for Xcode.

    3. Click Install.

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

      bash
      sudo sh -c 'xcode-select -s /Applications/Xcode.app/Contents/Developer && xcodebuild -runFirstLaunch'

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

      TIP

      For example, the name of Xcode located in Applications is Xcode-15.1.0; adjust the command to:

      bash
      sudo sh -c 'xcode-select -s /Applications/Xcode-15.1.0.app/Contents/Developer && xcodebuild -runFirstLaunch'
    5. Sign the Xcode license agreement:

      bash
      sudo xcodebuild -license
  • Cocoapods 1.15 or later to compile enable Flutter plugins in your native apps.

    Install
    1. Use brew to install. Run the command in Terminal:

      bash
      brew install cocoapods
    2. When install finishs, run the command:

      bash
      brew link cocoapods

Configure a text editor or IDE

You can build apps with Flutter using any text editor or integrated development environment (IDE) combined with Flutter's command-line tools.

Using an IDE with a Flutter extension or plugin provides code completion, syntax highlighting, and other features.

Popular options include:

RECOMMENDED

The Flutter team recommends installing Visual Studio Code and the Flutter extension for VS Code. This combination simplifies installing the Flutter SDK.

Install the Flutter SDK

In this guide, we will setup Flutter SDK at . You can change where you want to put it.

Warning

Don't install Flutter to a directory or path that meets the following conditions:

  • The path contains special characters or spaces.

As an example, fails the condition.

Add Flutter to your PATH

The guide will show you two commonly used shells: and . If you are using other shell, please search for their guide of setting PATH.

Configure your target iOS device

WARNING

For the Hackathon participants, Please setup a simulator for demo.

WARNING

Since the requirement of deploying to a physical ios device is way too high, our guide will only cover iOS virtual device setup.
To deploy to physical iOS device, you need:

  • Create an Apple ID, then register to Apple Developer Program (annual payment required).
  • Create a development provisioning profile to self-sign certificates.

Configure your iOS virtual device

  1. To install the iOS virtual device, run the following command:

    bash
    xcodebuild -downloadPlatform iOS
  2. Check if any virtual device exists in Xcode:

    1. Open Xcode.

      ▼ Xcode 起始頁

    2. In menu bar: WindowDevice and Simulators, hotkey: + + .
      Click Simulators tab.

      ▼ Xcode Device and Simulators

    3. If there is no existing virtual device, click + at left-bottom corner to add one.

      ▼ Xcode Device and Simulators

  3. To start the virtual device, run the following command:

    bash
    open -a Simulator

    ▼ Open iOS virtual device

Check your development setup

Run Flutter doctor

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

  1. Open your Terminal.

  2. run the following command:

    bash
    flutter doctor
  3. As you chose to develop for iOS, 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.24.0, on macOS ...).
    [!] Android toolchain - develop for Android devices
    [!] Chrome - develop for the web
    [✓] Xcode - develop for iOS and macOS
    [!] Android Studio (not installed)
    [✓] VS Code (version ...)
    [✓] Connected device (1 available)
    [✓] Network resources
    
    
    ! Doctor found issues in ... categories.

    Highlights are required:

    • : build Flutter.
    • : build iOS app.
    • : at least one simulator to demo.
    • : project's components and plugin requires network connection to download or update.

Troubleshoot Flutter doctor issues

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

If the command returns an error, you can run with again to gain more information:

bash
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 iOS on macOS apps with Flutter

Congratulations. Having installed all prerequisites and the Flutter SDK, you can start developing Flutter apps for iOS on macOS.