Install Flutter on macOS Apple Silicon

Ruby ChuRuby Chu
4 min read

What do you need to do?

  • Download Google Chrome (as most people have it on their laptop, so I’ll skip this)

  • Download Flutter SDK

  • Download VS Code

  • Download Xcode

  • Download Android Studio

Download Flutter SDK

# Go to your users folder on mac
$ cd /Users/your_mac_username
# You can name folder to other than "Developement". 
# This just my suggestion.
$ mkdr Development
  • Move the flutter zip to this folder, then unzip it (Once unzipped, you can trash that)

  • Don’t remove this Flutter folder as long as you’re still developing with Flutter ~ Your Mac needs this!

Setup Flutter Path

  • What is the path? Why do we need to set it up? See here.

  • Create a ~/.zshenv file on your computer

# Create a zsh environment
$ create'~/.zshenv'
  • Run this line to edit this file
# This will let you edit your zshenv file
$ vim ~/.zshenv
# Press i on your keyboard to enable editing mode
  • Paste this line in the file
export PATH=$HOME/Development/flutter_3.22.0/bin:$PATH
# Press esc on your keyboard to close editing mode
# Type :wq (press one key at a time) to quit editing page
# Press enter on your keyboard
  • Run this line
# This refresh the zsh environment
$ exec $SHELL

Install Homebrew

  • Open the terminal and run this
$ /bin/bash -c "$(curl -fsSL <https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh>)"

Install iTerm2 (Optional)

This is to make the Terminal easier to read.

I highly recommend doing this if you're new to software development.

brew install iterm2
  • add iterm2 to your zsh shell environment
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/yoonzy/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
$ exec $SHELL

Setup Xcode & License

  • If using MacBook Apple Silicon, you need to run this line. For MacBook with Intel, you can skip this line.
$ sudo softwareupdate --install-rosetta --agree-to-license
  • Run these 2 lines to complete the Xcode license & setup
$ sudo sh -c 'xcode-select -s /Applications/Xcode.app/Contents/Developer && xcodebuild -runFirstLaunch'
$ sudo xcodebuild -license

Install rbenv (Ruby version manager)

In the next section, when installing Cocoapods, you'll need Ruby setup on your MacBook. Although MacBook, by default, comes with Ruby installed, the Ruby version is old.

Installing Cocoapods will require a higher Ruby version. You'll learn how to update it in the section after this.

$ brew install rbenv
  • Run this line to edit ~/.zshrc file
$ vim ~/.zshenv
  • If you don’t have this file on your computer, run this to create it
$ create'~/.zshrc'
  • Open ~/.zshrc and add these 2 lines
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
  • Run this command on the terminal
$ exec $SHELL

Upgrade Ruby version on MacBook

  • Check the Ruby versions that can be installed (only stable versions are displayed)
$ rbenv install -l
  • Install Ruby with the specified version.$ rbenv install 3.2.2
$ rbenv install 3.2.2
  • Change Ruby version for Global env
 $ rbenv global 3.2.2
  • Check Ruby version
$ rbenv version

# Expected Return output (your version may be higher than mine)
>> 3.2.2 ( set by / home / account /. rbenv / version )
  • Check the Ruby version on your computer. If the output is the same as below, it means good to go to the next step.
$ ruby -v
# Expected output
>> ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin23]

Android SDK Manager Install

  • Open Android Studio

  • Go to Settings >> Search sdk >> Select Android SDK

  • Go to SDK Tools Tab

  • Download and select Android SDK Command-line Tools (latest)

  • Click Apply, and wait for the download to be finish

  • Then, you can run this

$ flutter doctor --android-licenses

Check Development Setup

Xcode Useful Tools (Optional)

  • DB Browser for SQLite (Visualize CoreData DB)
$ brew install --cask db-browser-for-sqlite
  • Xcodes (manage Xcode versions on Mac)
$ brew install --cask xcodes

References

Flutter Official Installation Doc

Ruby Installations

Homebrew, iTerms & oh-my-zsh Installation

Android Studio SDK Manager

0
Subscribe to my newsletter

Read articles from Ruby Chu directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Ruby Chu
Ruby Chu

I'm a Mobile App Developer specializing in Flutter, iOS, and WebRTC. I am passionate about creating user-centric applications that meet technical, design, and business objectives. Currently, I am focused on expanding my knowledge in areas such as SOLID principles, Bloc management, design patterns, HLS, and Android to stay up-to-date with the latest technologies. This blog is where I share insights and learnings from my ongoing studies and professional experience, to contribute to the developer community while refining my skills. Excited to connect and collaborate with fellow developers!