mohumohu studio みずきの技術&読書ブログ&無料ゲーム

mohumohu studio

           

みずきの技術&読書ブログ&無料ゲーム

プロフィール画像

How to Set Up the Flutter Environment!! (Mac Edition)

Today, we will walk through setting up the Flutter environment on Mac!

We plan to cover Windows setup in the next article.

This guide is based on official documentation for setting up Flutter on Mac.


Table of Contents

  1. Setting Up the Mac Environment
  2. Installing the Flutter SDK
  3. Setting the PATH
  4. Setting Up Xcode
  5. Setting Up Android Studio
  6. Configuring Android Licenses
  7. Running flutter doctor
  8. Summary

Setting Up the Mac Environment

First, visit the official Flutter website and navigate to the macOS section.

Select iOS as your target platform.

Installing the Flutter SDK

Next, install the Flutter SDK.

  • If you have a Mac with an Apple Silicon processor, download the Apple Silicon version.
  • If you have a Mac with an Intel processor, download the Intel Processor version.

💡 Not sure which Mac you have?

  • Click the Apple menuAbout This Mac
    • If the Processor section mentions “Intel,” it’s an Intel Mac.
    • If the Chip section mentions “Apple,” it’s an Apple Silicon Mac.

After downloading the file, double-click to extract it.

Then, create a folder named development in your home directory and move the extracted flutter folder inside it.

Setting the PATH

Now, let’s add Flutter to the system PATH.

Open Terminal and run:

(Replace [path_to_flutter] with the actual path to the Flutter folder.)

💡 How to Find the Flutter Folder Path?

Drag and drop the Flutter folder into the Terminal, and the full directory path will appear.

If you don’t know your shell configuration file, run:

  • If it returns /bin/zsh, you are using zsh (.zshrc).
  • If it returns /bin/bash, you are using bash (.bash_profile).

If the configuration file doesn’t exist, create it using:

Apply the changes:

Verify the PATH is set correctly:

If the correct path appears, the setup was successful! 🎉


Setting Up Xcode

Install Xcode from the App Store.

Install CocoaPods (needed for iOS development).

💡 If you have an Apple Silicon Mac, install Rosetta 2 first:

Install CocoaPods:

Enter your Mac password when prompted.

Install the iOS Simulator:

Open Xcode → Click Xcode → Settings.

Under Platforms, find iOS, click Get, and install it.


Setting Up Android Studio

Download Android Studio from the official website.

Install it by following the on-screen instructions.

Open Android Studio and install the Flutter plugin:

Go to PreferencesPlugins.

Search for Flutter, click Install, and restart the IDE.

Install Android SDK Command-line Tools:

Open Android StudioSDK Manager.

Go to Android SDKSDK Tools tab.

Check Android SDK Command-line Tools (latest) → Click ApplyOK.

Configuring Android Licenses

Open Terminal and run:

You’ll be asked to review several license agreements. Type y and press Enter for each one.

Once you return to the normal terminal prompt, the setup is complete. ✅


Running flutter doctor

After setting up Android Studio and Xcode, run:

This command checks your Flutter environment and lists any missing dependencies.

💡 If you encounter errors, try running:

This will show detailed information about the issues.

If all items show green checkmarks (✔), you’re good to go! 🎉


Summary

Today, we walked through setting up Flutter on Mac!

If you encounter any errors, take a deep breath and search for solutions using the error message.

Next time, we’ll cover Flutter setup for Windows!

🚀 Happy Flutter Development! 🚀

2025-03-08

0件のコメント

コメントはまだありません。最初の一人になりましょう!

Leave a Reply

Your email address will not be published. Required fields are marked *