Build Flutter iOS Apps on Windows: .ipa and iPhone Debugging
Build the iOS app on Windows and debug on your iPhone, with native breakpoints plus Dart breakpoints and hot reload.
Last updated
To build Flutter iOS apps on Windows you don't need flutter build ios: KXBuild builds and installs the \Runner project under ios/, and once your iPhone is connected over USB you press F5 to run it with native and Dart breakpoints and hot reload. Use KXBuild in place of flutter build ios and flutter run for the iOS side, keep using every other flutter command, and a \Release build writes build\Runner.ipa in the ios folder, ready for App Store Connect.
How do I set up Flutter on Windows and open a project?
1. Install Flutter
Install the Flutter SDK as described on the Flutter website and add the flutter command to PATH. Open a new terminal and check that this prints a version.
> flutter --versionThen install the Flutter extension from the VS Code Marketplace, which installs the Dart extension too.
2. Create a project
To use an existing project, open the Flutter project's root folder in VS Code with File > Open Folder…, or drag the folder into VS Code.
If you don't have a project yet, create one with flutter create or one of the options below.
Run KXBuild: New Project from the Command Palette and pick the Flutter App template.
> kxbuild project create -t flutter_app -n myflutterapp -o D:\work3. Run doctor
Do this first whenever you open a project for the first time. Doctor checks your Flutter setup and prepares the iOS project.
In the title bar of the KXBuild view, open the ··· menu and run Doctor (fix environment).
> kxbuild doctor D:\work\myflutterappIf the project uses plugins that need CocoaPods, install their dependencies in the ios folder after doctor. See CocoaPods. Otherwise, skip this. Run pod install again after adding plugins or changing the Podfile.
ios> pod installHow do I debug a Flutter app on an iPhone with hot reload?
4. Write code
The Flutter extension provides completion, go to definition and error checking for Dart. KXBuild provides them for the Swift and Objective-C code under ios/.
5. Debug
Select it in the KXBuild view and press F5. Native breakpoints hit first. Once the app starts, the Dart debugger attaches automatically, so Dart breakpoints and hot reload both work.
A Flutter Debug build only starts on the iPhone with a debugger attached, so from the command line use the Release configuration to build, install and launch:
> kxbuild run .\ios\Runner.xcworkspace -c ReleaseBefore you connect a phone for the first time, install and open Apple Devices from the Microsoft Store to get the USB driver on Windows. On iOS 16 and later, turn on Developer Mode in Settings > Privacy & Security and let the phone restart. If the computer doesn't find the phone, try another cable or USB port and unlock the phone. See connect an iPhone to Windows.
How do I build a Flutter iOS .ipa on Windows for the App Store?
6. Release
Build with the Release configuration to get build\Runner.ipa in the ios folder. To upload it to App Store Connect, see publish to the App Store from Windows.
Run KXBuild: Build for App Store (.ipa) from the Command Palette or the project's context menu.
> kxbuild build .\ios\Runner.xcworkspace -c Release --export app-storeAn App Store .ipa must be signed with an Apple Distribution certificate. Put your own .p12 certificate and .mobileprovision profile in a keychain/ folder and every build signs automatically; see sign iOS apps on Windows. Upload with kxstore (kxstore build upload, on Windows, Linux or macOS), then handle TestFlight and review on App Store Connect. That way you build Flutter iOS apps on Windows, debug them and ship them from one computer.
Next steps
Build and configure
Debug versus Release, choosing a scheme, target and configuration, overriding build settings, where build products go, when you get an .ipa and when Swift package dependencies resolve.
Release and App Store submission
Build Release with a Distribution certificate to get an .ipa, upload it to App Store Connect with kxstore (or Transporter on a Mac), then go through TestFlight and App Review. Ad Hoc and enterprise distribution work the same way.
Don't see your framework?
kxbuild is a general-purpose build toolchain, so if your framework produces an Xcode project, KXBuild can build it. The list above covers common cases only. Tell us about your setup.