Sets up a macOS environment for Flutter development. Use when configuring a macOS machine to run, build, or deploy Flutter applications for iOS or macOS.
Ensure the following baseline requirements are met before configuring the macOS-specific toolchain:
PATH.macOS desktop development requires specific Apple toolchains to compile and debug native Swift and Objective-C code.
Copy and follow this checklist to configure the macOS build environment.
sudo sh -c 'xcode-select -s /Applications/Xcode.app/Contents/Developer && xcodebuild -runFirstLaunch'
Conditional: If Xcode is installed in a custom directory, replace /Applications/Xcode.app with the correct absolute path.sudo xcodebuild -license
Read and agree to the prompts.sudo gem install cocoapods
Conditional: If CocoaPods is already installed, ensure it is updated to the latest version (sudo gem update cocoapods).Execute this feedback loop to ensure the environment is correctly configured for macOS desktop development.
flutter doctor -v
Xcode section in the output.flutter doctor -v until the Xcode section passes.flutter devices
Success Criteria: The output must contain at least one entry with macos listed as the platform.If the validation workflow fails, apply the following resolutions:
flutter doctor reports missing tools, ensure the xcode-select command was run with sudo and points to the correct .app directory.gem binary path is included in your shell's PATH environment variable.flutter devices does not list macos, ensure desktop support is enabled in your Flutter configuration:
flutter config --enable-macos-desktop