What you need ?
- Download Google Chrome (as most people has 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
flutterdevFlutter SDK archive
Flutter SDK archive
- Download versions under Stable Channel (macOS)
x64
for Mac with Intel chip;arm64
for Mac with Apple Silicon
- Run these 2 lines to create a folder called directory
$ cd /Users/rubychew $ mkdir Development
- Move the flutter zip to this folder, then unzip it (Once unzip, you can trash that)
- Don’t remove this flutter folder as long as you’re still developing with Flutter ~ Your Mac need this!
Setup Flutter Path
- Why set path? See here.
- Create a
~/.zshenv
file on your computer
$ create'~/.zshenv'
- Run this line to edit this file
$ vim ~/.zshenv
- Paste this line in the file
export PATH=$HOME/Development/flutter_3.22.0/bin:$PATH
- Press
esc
- Press
shift
+:
- Type
wq
- Press
enter
- Run this line
$ exec $SHELL
Install Homebrew
- Open terminal and run this
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install iTerm2
brew install iterm2
- add iterm2 to your zsh shell environment
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/rubychew/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
exec $SHELL
Setup Xcode & License
- If using Macbook Apple Silicon, do run this line below
$ sudo softwareupdate --install-rosetta --agree-to-license
- Run this 2 lines to complete Xcode license & setup
$ sudo sh -c 'xcode-select -s /Applications/Xcode.app/Contents/Developer && xcodebuild -runFirstLaunch'
$ sudo xcodebuild -license
Install rbenv (Ruby version manager)
$ brew install rbenv
- Run this line to edit
~/.zshrc
file
$ vim ~/.zshenv
- If don’t have this file in 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
- Change Ruby version for Global env
$ rbenv global 3.2.2
- Check Ruby version
$ rbenv version # Return output >> 3.2.2 ( set by / home / account /. rbenv / version )
- Check Ruby version on your computer. If the output is the same as below, it means good to go next step.
$ ruby -v >> ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin23]
Install Cocoapods
This is like the most tricky steps among all these installation 😟
$ sudo gem install cocoapods
Android SDK Manager Install
- Open Android Studio
- Go to Settings >> Search
sdk
>> SelectAndroid 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
- run
flutter doctor
orflutter docotor -v
(to see more details)
- Btw, if using Android Studio preview, flutter won’t be able to capture version number. That’s normal.
"Unable to determine Android Studio version" in flutter doctor when Android Studio is installed via Flatpak
Xcode Useful Tools
- 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
flutterdevStart building Flutter iOS apps on macOS
Start building Flutter iOS apps on macOS
Ruby Installations
note(ノート)【flutter 環境構築】ERROR: Error installing cocoapods: There are no versions of cocoapods-downloader (>=|ない
【flutter 環境構築】ERROR: Error installing cocoapods: There are no versions of cocoapods-downloader (>=|ない
在 MacOS Catalina 安裝 Ruby · GitBook
在 MacOS Catalina 安裝 Ruby · GitBook
QiitarbenvによるRubyのインストール手順まとめ - Qiita
rbenvによるRubyのインストール手順まとめ - Qiita
働くエンジニアマガジン「ポテパンスタイル」まずはruby –versionで!Rubyのバージョン管理方法とは | ポテパンスタイル
まずはruby –versionで!Rubyのバージョン管理方法とは | ポテパンスタイル
Homebew, iTerms & oh-my-zsh Installtion
不止數據|Not Only Data超快速打造 iTerms 2 + Oh-my-zsh 全攻略|如何讓 Terminal 看起來好用又好看
超快速打造 iTerms 2 + Oh-my-zsh 全攻略|如何讓 Terminal 看起來好用又好看
Android Studio SDK Manager
Android DevelopersUpdate the IDE and SDK tools | Android Studio | Android Developers
Update the IDE and SDK tools | Android Studio | Android Developers