Start building Flutter iOS apps on macOS
Software requirements
#To write and compile Flutter code for iOS, install the following packages.
Operating system
#Flutter supports developing on macOS 12 (Monterey) or later. This guide presumes your Mac runs the zsh
as your default shell.
Some Flutter components require the Rosetta 2 translation process. If you're developing on an Apple Silicon (ARM) Mac, install Rosetta 2:
sudo softwareupdate --install-rosetta --agree-to-license
Development tools
#Download and install the following packages.
- Xcode to debug and compile native Swift or Objective-C code. The Xcode installation also includes Git to manage Flutter versions and your own source code versioning.
- CocoaPods to compile and enable Flutter plugins in your native apps.
The developers of the preceding software provide support for those products. To troubleshoot installation issues, consult that product's documentation.
Text editor or integrated development environment
#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, widget editing assists, debugging, and other features.
Popular options include:
- Visual Studio Code with the Flutter extension for VS Code.
- Android Studio with the Flutter plugin for IntelliJ.
- IntelliJ IDEA with both the Flutter plugin for IntelliJ and the Android plugin for IntelliJ.
Install the Flutter SDK
#To install the Flutter SDK, you can use the VS Code Flutter extension or download and install the Flutter bundle yourself.
Use VS Code to install Flutter
#To install Flutter using these instructions, verify that you've installed Visual Studio Code and the Flutter extension for VS Code.
Prompt VS Code to install Flutter
#Launch VS Code.
To open the Command Palette, press Command + Shift + P.
In the Command Palette, type
flutter
.Select Flutter: New Project.
VS Code prompts you to locate the Flutter SDK on your computer.
If you have the Flutter SDK installed, click Locate SDK.
If you don't have the Flutter SDK installed, click Download SDK.
This option sends you the Flutter install page if you haven't installed Git as directed in the development tools prerequisites.
When prompted Which Flutter template?, ignore it. Press Esc. You can create a test project after checking your development setup.
Download the Flutter SDK
#When the Select Folder for Flutter SDK dialog displays, choose where you want to install Flutter.
VS Code places you in your user profile to start. Choose a different location.
Consider
~/development/
Click Clone Flutter.
While downloading Flutter, VS Code displays these pop-up notifications:
Downloading the Flutter SDK. This may take a few minutes.
Initializing the Flutter SDK. This may take a few minutes.
The download and installation take a few minutes. If you suspect that the download has hung, click Cancel, then start the installation again.
When the Flutter installation succeeds, VS Code displays this pop-up notification:
Do you want to add the Flutter SDK to PATH so it's accessible in external terminals?
Click Add SDK to PATH.
When successful, a notification displays:
The Flutter SDK was added to your PATH
VS Code might display a Google Analytics notice.
If you agree, click OK.
To enable
flutter
in all Terminal windows:- Close, then reopen all Terminal windows.
- Restart VS Code.
Download then install Flutter
#To install Flutter, download the Flutter SDK bundle from its archive, move the bundle to where you want it stored, then extract the SDK.
Download the following installation bundle to get the latest stable release of the Flutter SDK.
Intel Processor Apple Silicon (loading...) (loading...) For other release channels, and older builds, check out the SDK archive.
The Flutter SDK should download to the macOS default download directory:
~/Downloads/
.Create a folder where you can install Flutter.
Consider creating a directory at
~/development/
.Extract the file into the directory you want to store the Flutter SDK.
unzip ~/Downloads/flutter_sdk_v1.0.0.zip \ -d ~/development/
When finished, the Flutter SDK should be in the
~/development/flutter
directory.
Add Flutter to your PATH
#To run Flutter commands in the terminal, add Flutter to the PATH
environment variable. This guide presumes your Mac runs the latest default shell, zsh
. Zsh uses the .zshenv
file for environment variables.
Launch your preferred text editor.
If it exists, open the Zsh environmental variable file
~/.zshenv
in your text editor. If it doesn't, create~/.zshenv
.Copy the following line and paste it at the end of your
~/.zshenv
file.bashexport PATH=$HOME/development/flutter/bin:$PATH
Save your
~/.zshenv
file.To apply this change, restart all open terminal sessions.
If you use another shell, check out this tutorial on setting your PATH.
Configure iOS development
#Install and configure Xcode
#To develop Flutter apps for iOS, install Xcode to compile to native bytecode.
Open the App Store and sign in.
Search for
Xcode
.Click Install.
The Xcode installer takes up 6+ GB of storage. The download might take some time.
To configure the command-line tools to use the installed version of Xcode, use the following commands.
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.
Sign the Xcode license agreement.
sudo xcodebuild -license
Try to keep to the current version of Xcode.
Configure your target iOS device
#With Xcode, you can run Flutter apps on an iOS device or on the simulator.
Configure your iOS simulator
#To prepare to run and test your Flutter app on the iOS simulator, follow this procedure.
To install the iOS Simulator, run the following command.
xcodebuild -downloadPlatform iOS
To start the Simulator, run the following command:
open -a Simulator
Set up your target physical iOS device
#To deploy your Flutter app to a physical iPhone or iPad, you need to do the following:
- Create an Apple Developer account.
- Set up physical device deployment in Xcode.
- Create a development provisioning profile to self-sign certificates.
- Install the third-party CocoaPods dependency manager if your app uses Flutter plugins.
Create your Apple ID and Apple Developer account
#You can skip this step for now. You don't actually need an Apple Developer account until you are ready to distribute your app to the App Store.
If you only need to test deploying your app, complete the first step and move on to the next section.
If you don't have an Apple ID, create one.
If you haven't enrolled in the Apple Developer program, enroll now.
To learn more about membership types, check out Choosing a Membership.
Attach your physical iOS device to your Mac
#Configure your physical iOS device to connect to Xcode.
Attach your iOS device to the USB port on your Mac.
On first connecting your iOS device to your Mac, your iOS device displays the Trust this computer? dialog.
Click Trust.
When prompted, unlock your iOS device.
Enable Developer Mode on iOS 16 or later
#Starting with iOS 16, Apple requires you to enable Developer Mode to protect against malicious software. Enable Developer Mode before deploying to a device running iOS 16 or later.
Tap on Settings > Privacy & Security > Developer Mode.
Tap to toggle Developer Mode to On.
Tap Restart.
After the iOS device restarts, unlock your iOS device.
When the Turn on Developer Mode? dialog appears, tap Turn On.
The dialog explains that Developer Mode requires reducing the security of the iOS device.
Unlock your iOS device.
Enable developer code signing certificates
#To deploy to a physical iOS device, you need to establish trust with your Mac and the iOS device. This requires you to load signed developer certificates to your iOS device. To sign an app in Xcode, you need to create a development provisioning profile.
To provision your project, follow the Xcode signing flow.
Launch Xcode.
Go to Xcode > Settings...
- Go to Xcode > Settings...
- Click Accounts.
- Click +.
- Select Apple ID and click Continue.
- When prompted, enter your Apple ID and Password.
- Close the Settings dialog.
Development and testing supports any Apple ID.
Go to File > Open...
You can also press Cmd + O.
Navigate to your Flutter project directory.
Open the default Xcode workspace in your project:
ios/Runner.xcworkspace
.Select the physical iOS device you intend to deploy to in the device drop-down menu to the right of the run button.
It should appear under the iOS devices heading.
In the left navigation panel under Targets, select Runner.
In the Runner settings pane, click Signing & Capabilities.
Select All at the top.
Select Automatically manage signing.
Select a team from the Team dropdown menu.
Teams are created in the App Store Connect section of your Apple Developer Account page. If you have not created a team, you can choose a personal team.
The Team dropdown displays that option as Your Name (Personal Team).
After you select a team, Xcode performs the following tasks:
- Creates and downloads a Development Certificate
- Registers your device with your account,
- Creates and downloads a provisioning profile if needed
If automatic signing fails in Xcode, verify that the project's General > Identity > Bundle Identifier value is unique.
Enable trust of your Mac and iOS device
#When you attach your physical iOS device for the first time, enable trust for both your Mac and the Development Certificate on the iOS device.
You should have enabled trust of your Mac on your iOS device when you attached the device to your Mac.
Enable developer certificate for your iOS devices
#Enabling certificates varies in different versions of iOS.
Open the Settings app on the iOS device.
Tap on General > Profiles & Device Management.
Tap to toggle your Certificate to Enable
Open the Settings app on the iOS device.
Tap on General > VPN & Device Management.
Tap to toggle your Certificate to Enable.
Open the Settings app on the iOS device.
Tap on General > VPN & Device Management.
Under the Developer App heading, you should find your certificate.
Tap your Certificate.
Tap Trust "<certificate>".
When the dialog displays, tap Trust.
If the codesign wants to access key... dialog displays:
Enter your macOS password.
Tap Always Allow.
Set up wireless debugging on your iOS device (Optional)
#To debug your device using a Wi-Fi connection, follow this procedure.
Connect your iOS device to the same network as your macOS device.
Set a passcode for your iOS device.
Open Xcode.
Go to Window > Devices and Simulators.
You can also press Shift + Cmd + 2.
Select your iOS device.
Select Connect via Network.
Once the network icon appears next to the device name, unplug your iOS device from your Mac.
If you don't see your device listed when using flutter run
, extend the timeout. The timeout defaults to 10 seconds. To extend the timeout, change the value to an integer greater than 10.
flutter run --device-timeout 60
Install CocoaPods
#If your apps depend on Flutter plugins with native iOS code, install CocoaPods. This program bundles various dependencies across Flutter and iOS code.
To install and set up CocoaPods, run the following commands:
Install
cocoapods
following the CocoaPods install guide.sudo gem install cocoapods
Launch your preferred text editor.
Open the Zsh environmental variable file
~/.zshenv
in your text editor.Copy the following line and paste it at the end of your
~/.zshenv
file.bashexport PATH=$HOME/.gem/bin:$PATH
Save your
~/.zshenv
file.To apply this change, restart all open terminal sessions.
Check your development setup
#Run Flutter doctor
#The flutter doctor
command validates that all components of a complete Flutter development environment for macOS.
Open your Terminal.
To verify your installation of all the components, run the following command.
flutter doctor
As you chose to develop for iOS, you do not need all components. If you followed this guide, the command should output [✓]
for the tooling and platforms you set up.
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 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.
To continue on your learning journey, consult the following guides:
Manage your Flutter SDK
#To learn more about managing your Flutter SDK installation, consult the following resources.
- Upgrade Flutter
- Add web as a build target
- Add Android compilation tools
- Add macOS compilation tools
- Uninstall Flutter
Unless stated otherwise, the documentation on this site reflects the latest stable version of Flutter. Page last updated on 2025-05-19. View source or report an issue.