Flutter Desktop: Packaging and Distributing macOS Applications with notarization

Summary
Summary
Summary
Summary

This tutorial covers Flutter Desktop packaging for macOS—from environment setup and Apple Developer credentials to building, code signing, notarization, stapling, and distributing your app. Follow Xcode CLI steps to meet Gatekeeper requirements and deliver a trusted install experience.

This tutorial covers Flutter Desktop packaging for macOS—from environment setup and Apple Developer credentials to building, code signing, notarization, stapling, and distributing your app. Follow Xcode CLI steps to meet Gatekeeper requirements and deliver a trusted install experience.

This tutorial covers Flutter Desktop packaging for macOS—from environment setup and Apple Developer credentials to building, code signing, notarization, stapling, and distributing your app. Follow Xcode CLI steps to meet Gatekeeper requirements and deliver a trusted install experience.

This tutorial covers Flutter Desktop packaging for macOS—from environment setup and Apple Developer credentials to building, code signing, notarization, stapling, and distributing your app. Follow Xcode CLI steps to meet Gatekeeper requirements and deliver a trusted install experience.

Key insights:
Key insights:
Key insights:
Key insights:
  • Preparing Your macOS Environment: Install Xcode, enable macOS Desktop in Flutter, and verify tooling before building.

  • Configuring Notarization Credentials: Generate an App-Specific Password, set environment variables, and locate your Developer ID Application certificate.

  • Building and Packaging the App: Use flutter build macos, then code sign the .app bundle with codesign --deep and verify signatures.

  • Notarizing, Stapling, and Distributing the Application: Upload via xcrun altool, poll status, staple with xcrun stapler, and create a ZIP or installer for distribution.

  • Notarizing, Stapling, and Distributing the Application: Validate the stapled ticket and host the signed package to ensure Gatekeeper compliance.

Introduction

Flutter Desktop extends Flutter’s cross-platform capabilities to macOS, enabling developers to build native desktop applications with the same codebase used for mobile. Packaging and distributing a macOS app requires code signing and notarization to meet Apple’s security requirements. This tutorial walks through setting up your macOS environment, configuring credentials, building and packaging your Flutter desktop app, and notarizing, stapling, and distributing a fully trusted application.

Preparing Your macOS Environment

First, install the latest version of Xcode and Xcode Command Line Tools (CLT). Ensure you can access xcodebuild, codesign, and xcrun in your shell. Verify with:

xcode-select --install
xcodebuild -version

Next, enable macOS Desktop support in Flutter. In your project directory run:

flutter config --enable-macos-desktop
flutter doctor  # Confirm macOS tooling is configured

Ensure the macos/ folder exists (created automatically on first desktop build). Open macos/Runner.xcworkspace in Xcode to inspect signing settings under the “Signing & Capabilities” tab.

Configuring Notarization Credentials

Apple notarization requires an App-Specific Password tied to your Apple ID and a valid Developer ID Application certificate.

  1. Log into appleid.apple.com, generate an App-Specific Password labeled “NotarizeFlutter”.

  2. Open Keychain Access, locate your Developer ID Application certificate under “My Certificates.”

  3. In Terminal, verify your certificate:

    security find-identity -p codesigning -v

    Copy the SHA-1 hash of your Developer ID Application entry.

Store credentials securely in environment variables:

export APPLE_ID="you@apple.com"
export APP_SPECIFIC_PASSWORD="abcd-efgh-ijkl-mnop"
export DEVELOPER_ID_APPLICATION="Developer ID Application: Your Company (TEAMID)"

Building and Packaging the App

Use Flutter’s build command to produce a release bundle:

flutter build macos --release

This generates build/macos/Build/Products/Release/YourApp.app. Next, code sign the .app bundle using your Developer ID Application certificate:

codesign --deep --force --verbose --sign "$DEVELOPER_ID_APPLICATION" \
  build/macos/Build/Products/Release/YourApp.app

Optionally, verify the signature:

codesign --verify --deep --strict --verbose=2 build/macos/Build/Products/Release/YourApp.app

Include a Dart snippet (optional) demonstrating platform-specific code initialization:

import 'dart:io';
import 'package:flutter/material.dart';

void main() {
  if (Platform.isMacOS) {
    WidgetsFlutterBinding.ensureInitialized();
    // macOS-specific setup
  }
  runApp(MyApp());
}

Notarizing, Stapling, and Distributing the Application

Notarization is a server-side verification by Apple. Use xcrun altool to upload the signed .app:

xcrun altool --notarize-app \
  --primary-bundle-id "com.yourcompany.yourapp" \
  --username "$APPLE_ID" \
  --password "$APP_SPECIFIC_PASSWORD" \
  --file build/macos/Build/Products/Release/YourApp.app

Record the RequestUUID returned by the command. Poll the notarization status:

xcrun altool --notarization-info <RequestUUID> \
  --username "$APPLE_ID" --password "$APP_SPECIFIC_PASSWORD"

Once status is “Package Approved,” staple the notarization ticket to your .app:

xcrun stapler staple build/macos/Build/Products/Release/YourApp.app

Verify stapling:

xcrun stapler validate build/macos/Build/Products/Release/YourApp.app

Finally, create a distributable installer or zip archive:

cd build/macos/Build/Products/Release
zip -r YourApp-macOS.zip YourApp.app

Host the ZIP or use an installer package (PKG). Users on macOS 10.15+ will install without alarming Gatekeeper warnings.

// Optional: automate notarization via Dart script
import 'dart:io';

void main() async {
  await Process.run('xcrun', ['stapler', 'validate', 'YourApp.app']);
  print('Staple validation complete.');
}

Vibe Studio

Vibe Studio, powered by Steve’s advanced AI agents, is a revolutionary no-code, conversational platform that empowers users to quickly and efficiently create full-stack Flutter applications integrated seamlessly with Firebase backend services. Ideal for solo founders, startups, and agile engineering teams, Vibe Studio allows users to visually manage and deploy Flutter apps, greatly accelerating the development process. The intuitive conversational interface simplifies complex development tasks, making app creation accessible even for non-coders.

Conclusion

Packaging and distributing a Flutter macOS application involves preparing your environment, configuring Apple notarization credentials, building and code signing, and using Xcode command-line tools for notarization and stapling. With a notarized and stapled .app or installer package, your Flutter desktop application meets Apple’s security requirements and delivers a seamless installation experience for end users.

Introduction

Flutter Desktop extends Flutter’s cross-platform capabilities to macOS, enabling developers to build native desktop applications with the same codebase used for mobile. Packaging and distributing a macOS app requires code signing and notarization to meet Apple’s security requirements. This tutorial walks through setting up your macOS environment, configuring credentials, building and packaging your Flutter desktop app, and notarizing, stapling, and distributing a fully trusted application.

Preparing Your macOS Environment

First, install the latest version of Xcode and Xcode Command Line Tools (CLT). Ensure you can access xcodebuild, codesign, and xcrun in your shell. Verify with:

xcode-select --install
xcodebuild -version

Next, enable macOS Desktop support in Flutter. In your project directory run:

flutter config --enable-macos-desktop
flutter doctor  # Confirm macOS tooling is configured

Ensure the macos/ folder exists (created automatically on first desktop build). Open macos/Runner.xcworkspace in Xcode to inspect signing settings under the “Signing & Capabilities” tab.

Configuring Notarization Credentials

Apple notarization requires an App-Specific Password tied to your Apple ID and a valid Developer ID Application certificate.

  1. Log into appleid.apple.com, generate an App-Specific Password labeled “NotarizeFlutter”.

  2. Open Keychain Access, locate your Developer ID Application certificate under “My Certificates.”

  3. In Terminal, verify your certificate:

    security find-identity -p codesigning -v

    Copy the SHA-1 hash of your Developer ID Application entry.

Store credentials securely in environment variables:

export APPLE_ID="you@apple.com"
export APP_SPECIFIC_PASSWORD="abcd-efgh-ijkl-mnop"
export DEVELOPER_ID_APPLICATION="Developer ID Application: Your Company (TEAMID)"

Building and Packaging the App

Use Flutter’s build command to produce a release bundle:

flutter build macos --release

This generates build/macos/Build/Products/Release/YourApp.app. Next, code sign the .app bundle using your Developer ID Application certificate:

codesign --deep --force --verbose --sign "$DEVELOPER_ID_APPLICATION" \
  build/macos/Build/Products/Release/YourApp.app

Optionally, verify the signature:

codesign --verify --deep --strict --verbose=2 build/macos/Build/Products/Release/YourApp.app

Include a Dart snippet (optional) demonstrating platform-specific code initialization:

import 'dart:io';
import 'package:flutter/material.dart';

void main() {
  if (Platform.isMacOS) {
    WidgetsFlutterBinding.ensureInitialized();
    // macOS-specific setup
  }
  runApp(MyApp());
}

Notarizing, Stapling, and Distributing the Application

Notarization is a server-side verification by Apple. Use xcrun altool to upload the signed .app:

xcrun altool --notarize-app \
  --primary-bundle-id "com.yourcompany.yourapp" \
  --username "$APPLE_ID" \
  --password "$APP_SPECIFIC_PASSWORD" \
  --file build/macos/Build/Products/Release/YourApp.app

Record the RequestUUID returned by the command. Poll the notarization status:

xcrun altool --notarization-info <RequestUUID> \
  --username "$APPLE_ID" --password "$APP_SPECIFIC_PASSWORD"

Once status is “Package Approved,” staple the notarization ticket to your .app:

xcrun stapler staple build/macos/Build/Products/Release/YourApp.app

Verify stapling:

xcrun stapler validate build/macos/Build/Products/Release/YourApp.app

Finally, create a distributable installer or zip archive:

cd build/macos/Build/Products/Release
zip -r YourApp-macOS.zip YourApp.app

Host the ZIP or use an installer package (PKG). Users on macOS 10.15+ will install without alarming Gatekeeper warnings.

// Optional: automate notarization via Dart script
import 'dart:io';

void main() async {
  await Process.run('xcrun', ['stapler', 'validate', 'YourApp.app']);
  print('Staple validation complete.');
}

Vibe Studio

Vibe Studio, powered by Steve’s advanced AI agents, is a revolutionary no-code, conversational platform that empowers users to quickly and efficiently create full-stack Flutter applications integrated seamlessly with Firebase backend services. Ideal for solo founders, startups, and agile engineering teams, Vibe Studio allows users to visually manage and deploy Flutter apps, greatly accelerating the development process. The intuitive conversational interface simplifies complex development tasks, making app creation accessible even for non-coders.

Conclusion

Packaging and distributing a Flutter macOS application involves preparing your environment, configuring Apple notarization credentials, building and code signing, and using Xcode command-line tools for notarization and stapling. With a notarized and stapled .app or installer package, your Flutter desktop application meets Apple’s security requirements and delivers a seamless installation experience for end users.

Build Flutter Apps Faster with Vibe Studio

Build Flutter Apps Faster with Vibe Studio

Build Flutter Apps Faster with Vibe Studio

Build Flutter Apps Faster with Vibe Studio

Vibe Studio is your AI-powered Flutter development companion. Skip boilerplate, build in real-time, and deploy without hassle. Start creating apps at lightning speed with zero setup.

Vibe Studio is your AI-powered Flutter development companion. Skip boilerplate, build in real-time, and deploy without hassle. Start creating apps at lightning speed with zero setup.

Vibe Studio is your AI-powered Flutter development companion. Skip boilerplate, build in real-time, and deploy without hassle. Start creating apps at lightning speed with zero setup.

Vibe Studio is your AI-powered Flutter development companion. Skip boilerplate, build in real-time, and deploy without hassle. Start creating apps at lightning speed with zero setup.

Other Insights

Other Insights

Other Insights

Other Insights

Join a growing community of builders today

Join a growing
community

of builders today

Join a growing

community

of builders today

The Jacx Office: 16-120

2807 Jackson Ave

Queens NY 11101, United States

© Steve • All Rights Reserved 2025

The Jacx Office: 16-120

2807 Jackson Ave

Queens NY 11101, United States

© Steve • All Rights Reserved 2025

The Jacx Office: 16-120

2807 Jackson Ave

Queens NY 11101, United States

© Steve • All Rights Reserved 2025

The Jacx Office: 16-120

2807 Jackson Ave

Queens NY 11101, United States

© Steve • All Rights Reserved 2025

The Jacx Office: 16-120

2807 Jackson Ave

Queens NY 11101, United States

© Steve • All Rights Reserved 2025

The Jacx Office: 16-120

2807 Jackson Ave

Queens NY 11101, United States

© Steve • All Rights Reserved 2025