首页/移动开发/flutter-setting-up-on-macos
F

flutter-setting-up-on-macos

by @flutterv
4.5(34)

协助用户在macOS系统上配置Flutter开发环境,确保移动应用开发的顺利进行。

fluttermacos-developmentenvironment-setupxcodedevelopment-workflowGitHub
安装方式
npx skills add flutter/skills --skill flutter-setting-up-on-macos
compare_arrows

Before / After 效果对比

1
使用前

手动配置macOS上的Flutter开发环境,步骤繁琐且容易出错。

使用后

提供清晰的指南,高效配置macOS环境,快速开始Flutter开发。

SKILL.md

Setting Up a macOS Environment for Flutter Development

Contents

Prerequisites

Ensure the following baseline requirements are met before configuring the macOS-specific toolchain:

  • macOS operating system.
  • Flutter SDK installed and added to the system PATH.
  • Active internet connection for downloading toolchains and dependencies.

Tooling Configuration

macOS desktop development requires specific Apple toolchains to compile and debug native Swift and Objective-C code.

  • Xcode: Required for compiling macOS desktop applications.
  • CocoaPods: Required for managing native dependencies used by Flutter plugins.

Workflow: Configuring macOS Tooling

Copy and follow this checklist to configure the macOS build environment.

  • Install Xcode: Install the latest version of Xcode from the Mac App Store or the Apple Developer portal.
  • Configure Command-Line Tools: Link the Xcode command-line tools to the installed Xcode version. Run the following command in the terminal:
    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.
  • Accept Xcode Licenses: Accept the required developer licenses by running:
    sudo xcodebuild -license
    
    Read and agree to the prompts.
  • Install CocoaPods: Install CocoaPods to handle native macOS plugin dependencies.
    sudo gem install cocoapods
    
    Conditional: If CocoaPods is already installed, ensure it is updated to the latest version (sudo gem update cocoapods).

Workflow: Validating the Environment

Execute this feedback loop to ensure the environment is correctly configured for macOS desktop development.

  • Run Validator: Execute the Flutter diagnostic tool with verbose output:
    flutter doctor -v
    
  • Review Errors: Check the Xcode section in the output.
  • Fix & Retry: If errors or missing components are reported under the Xcode section, resolve them according to the output instructions, then re-run flutter doctor -v until the Xcode section passes.
  • Verify Device Availability: Confirm that Flutter recognizes the macOS desktop as a valid deployment target:
    flutter devices
    
    Success Criteria: The output must contain at least one entry with macos listed as the platform.

Troubleshooting

If the validation workflow fails, apply the following resolutions:

  • Missing Command-Line Tools: If flutter doctor reports missing tools, ensure the xcode-select command was run with sudo and points to the correct .app directory.
  • CocoaPods Not Found: If CocoaPods is installed but not detected, verify that your Ruby gem binary path is included in your shell's PATH environment variable.
  • Device Not Listed: If flutter devices does not list macos, ensure desktop support is enabled in your Flutter configuration:
    flutter config --enable-macos-desktop
    

用户评价 (0)

发表评价

效果
易用性
文档
兼容性

暂无评价

统计数据

安装量7.9K
评分4.5 / 5.0
版本
更新日期2026年5月19日
对比案例1 组

用户评分

4.5(34)
5
24%
4
50%
3
24%
2
3%
1
0%

为此 Skill 评分

0.0

兼容平台

🔧Claude Code
🔧OpenClaw
🔧OpenCode
🔧Codex
🔧Gemini CLI
🔧GitHub Copilot
🔧Amp
🔧Kimi CLI

时间线

创建2026年3月16日
最后更新2026年5月19日