Xcode for Flutter: iPhone, simulator and macOS apps

Egor Dolgov · 09.11.2026
iOS
Xcode
iPhone · simulator · macOS apps — only on a Mac
Show me step by step
Subtitles
For iPhone and macOS apps you need Xcode — and it installs only on a Mac.

To run a Flutter app on an iPhone, in the iPhone simulator or as a macOS program, you need Xcode — Apple's development environment. Xcode runs only on a Mac, so you can build an iPhone app only on a Mac.

Contents:

  1. Installing Xcode
  2. Setup commands
  3. The iOS platform and the simulator
  4. Your own iPhone
  5. Signing the app
  6. Swift Package Manager and CocoaPods
  7. A macOS program
  8. Summary

1. Installing Xcode

Install the latest Xcode from the Mac App Store . Other Xcode versions and the command-line tools are at developer.apple.com/download — you need an Apple Account, but no paid Apple Developer Program membership.

Xcode 27 requires macOS Tahoe 26.6 or later. Flutter 3.47 works with Xcode 15 and later and recommends Xcode 16 or later.

If you have an Intel Mac: Flutter is phasing out support for them — future versions will require an Apple Silicon Mac.

2. Setup commands

After installing, run this in Terminal (how to open it and paste a command is on the Installing Git page). sudo asks for your Mac account password. The command selects the installed Xcode and installs the required system components:

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

If Xcode is not in Applications, replace /Applications/Xcode.app with your path. Then accept the Xcode license:

sudo xcodebuild -license

The command shows the licenses — read them and agree.

Check the version:

xcodebuild -version
Xcode 27.2
Build version 27B52

3. The iOS platform and the simulator

For iPhone, download iOS support and the latest simulators:

xcodebuild -downloadPlatform iOS

Start the simulator — in Xcode 27 it is called Device Hub :

open -a DeviceHub

On Xcode 26 and earlier the command is open -a Simulator . Flutter sees the simulator too:

flutter emulators
Id                  • Name          • Manufacturer • Platform

apple_ios_simulator • iOS Simulator • Apple        • ios

4. Your own iPhone

  1. Connect the iPhone to the Mac with a cable. The phone asks “Trust This Computer?” — tap Trust .
  2. Turn on Developer Mode : Settings → Privacy & Security → Developer Mode , restart the phone and confirm after the restart. The option appears in Settings only after the phone has been connected to a Mac with Xcode at least once — if it's missing, open Xcode with the phone connected.

5. Signing the app

To install an app on an iPhone, Xcode has to sign it. For testing on your own phone, a free Apple Account is enough.

  1. Open the project in Xcode — run this in your Flutter project folder (we create it in Lesson 1 ):
open ios/Runner.xcworkspace
  1. Sign in to your Apple Account: Xcode → Settings → Apple Accounts .
  2. Select the Runner target, the Signing & Capabilities tab, turn on Automatically manage signing , in the Team field choose your Apple Account and set a unique Bundle Identifier .
  3. Running: in the project folder run flutter devices — the list shows the iPhone and its id — then flutter run -d <id> . If macOS asks “codesign wants to access key…”, enter your Mac password and click Always Allow .
  4. If the iPhone won't open an app from an unknown developer: Settings → General → VPN & Device Management , choose your developer profile and tap Trust , then run the app again.

6. Swift Package Manager and CocoaPods

Since Flutter 3.44, the native iOS and macOS code of plugins comes through Swift Package Manager , which is on by default. Flutter uses CocoaPods only for plugins that don't support Swift Package Manager yet; CocoaPods itself is in maintenance mode, and its registry becomes read-only on December 2, 2026.

flutter doctor still checks for CocoaPods: without it the Xcode line shows [!] and the warning CocoaPods not installed . If your plugins need it, install it following the CocoaPods guide :

sudo gem install cocoapods

( sudo is needed if you use the Ruby that comes with macOS.)

7. A macOS program

A macOS program needs the same Xcode with the commands from section 2 — no need to download the iOS platform or the simulator. Run it with:

flutter run -d macos

You don't need signing to run it on your own Mac unless the app uses capabilities that require provisioning.

8. Summary

  • Xcode runs only on a Mac; after installing: xcode-select … -runFirstLaunch and xcodebuild -license .
  • For iPhone: xcodebuild -downloadPlatform iOS , the simulator — open -a DeviceHub .
  • Your own iPhone: trust the computer, Developer Mode, signing in Xcode (a free Apple Account).
  • Plugins come through Swift Package Manager; CocoaPods is only for older plugins.

Installing Flutter itself is in Lesson 0 .