flutterの環境構築

softwareupdate --install-rosetta --agree-to-license

vscodeでインストールしたが、パスを自動で通してくれると思ったらそんなことはないので手動で ~/.zshrc
に追加
export PATH=$HOME/development/flutter/bin:$PATH

flutter doctor -v
3つのエラー/警告がでている
- Android toolchain - develop for Android devices
- Xcode - develop for iOS and macOS
- Android Studio (not installed)
このPCはXcodeもはいってなかったか・・・・

sudo sh -c 'xcode-select -s /Applications/Xcode.app/Contents/Developer && xcodebuild -runFirstLaunch'

sudo xcodebuild -license

Try to keep to the current version of Xcode.
Xcode の最新バージョンを維持するようにしてください。
お、おう……

xcodebuild -downloadPlatform iOS
はインストール時に指定したのでスキップ

open -a Simulator
開いたのでオッケーのはず

貧弱なプレイベートMacbook Airだと起こりそうなので覚えておこう

物理iOSデバイス、そんなものはない

sudo gem install cocoapods
なんかおそろしく反応ないが、本当に進行してるのかこれ……

ERROR: Error installing cocoapods:
The last version of drb (>= 0) to support your Ruby & RubyGems was 2.0.6. Try installing it with `gem install drb -v 2.0.6` and then running the current command again
drb requires Ruby version >= 2.7.0. The current ruby version is 2.6.10.210.
4分かかった上にこれ

miseをいれる。rtxから名前が変わっていたようだ

curl https://mise.run | sh
~/.local/bin/mise --version
mise 2024.x.x

echo 'eval "$(~/.local/bin/mise activate zsh)"' >> ~/.zshrc

rubyなんもわからん
mise use -g ruby@3.2

なんかエラーになった

brew install libyaml

このあとにリトライでインストールは成功

sudo gem install cocoapods
もっかいチャレンジ

こちらも成功

flutter doctor -v
で [✓] Xcode - develop for iOS and macOS (Xcode 15.4)
になっていることを確認

つぎはこっち

Android SDK Command-line Tools がないようだが一旦気にしない

flutter doctor --android-licenses
Android sdkmanager not found. Update to the latest Android SDK and ensure that the cmdline-tools are installed to resolve this.
だめだった

いた

これにてflutter doctor
がNo issues found!

mise use --global flutter@3.22
mise ~/.local/share/mise/plugins/flutter/bin/install failed
なんかエラーになった

どうも jq がはいっていないとだめらしい。このPCはjqはいってなかったんかい
brew install jq
でインストールが成功