$ cd ~Desktop/development
$ unzip ~/Downloads/flutter_macos_3.16.0-stable.zip
$ export PATH="$PATH:`pwd`/flutter/bin"
永久性:
打開或創建`rc` file。
首先先輸入指令`echo $SHELL`查看自己的電腦用哪一種shell。
如果是Bash, 編輯`~/.bash_profile`或者`~/.bashrc` 。
如果是用Z shell, 則編輯`~/.zshrc`。
我的是Z shell,所以編輯`~/.zshrc`。
$ nano ~/.zshrc
$ export PATH="$PATH:`pwd`/flutter/bin"
^X存檔離開。
$ flutter doctor
$ flutter create my_first_app
App Store->Xcode (需要macOS 13以上)
下載連結:https://developer.android.com/studio?hl=zh-tw
如執行$ flutter doctor
有sdk update的問題,移除舊版本,安裝新版本
$ sudo gem install cocoapods
下載連結:https://code.visualstudio.com/download
安裝Extansion:Flutter, Dart
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
Run `flutter doctor --android-licenses`
Run `sudo gem install cocoapods`
ERROR: Error installing cocoapods: There are no versions of cocoapods-downloader (>= 2.0) compatible with your Ruby & RubyGems. Maybe try installing an older version of the gem you're looking for? cocoapods-downloader requires Ruby version >= 2.7.4. The current ruby version is 2.6.10.210.
(macOS Sonoma 14.1.1會遇到這個error)
Solution:
$ sudo gem install drb -v 2.0.5
$ sudo gem install activesupport -v 6.1.7.6
$ sudo gem install cocoapods -v 1.13.0