Open10

Flutterの環境構築 / リリースメモ(M1 Mac)

emonoemono

開発環境の構築(M1mac / Flutter)

環境

  • sw_vers
    ProductName: macOS
    ProductVersion: 12.3
    BuildVersion: 21E230
emonoemono

やること

  • flutter doctorを全部greenにする。
  • flutterでバージョン管理できるようにする。

セットアップ

  • brew install flutter
  • flutter doctor
    • Android Studioの設定ができていない。
    • Xcodeの設定ができていない。
flutter doctor
Running "flutter pub get" in flutter_tools...                       9.3s
Doctor summary (to see all details, run flutter doctor -v):
[] Flutter (Channel stable, 2.10.4, on macOS 12.3 21E230 darwin-arm, locale ja-JP)
[] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

[!] Xcode - develop for iOS and macOS (Xcode 13.1)CocoaPods not installed.
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[] Chrome - develop for the web
[!] Android Studio (not installed)
[] VS Code (version 1.66.0)
[] Connected device (1 available)
[] HTTP Host Availability

Xcode対応

  • Xcodeをinstall

  • command lint toolをinstall

    • brew install cocoapods
  • flutter doctor

    • Xcodeがgreenになることを確認
    Doctor summary (to see all details, run flutter doctor -v):
    [] Flutter (Channel stable, 2.10.4, on macOS 12.3 21E230 darwin-arm, locale ja-JP)
    [] Android toolchain - develop for Android devices
        ✗ Unable to locate Android SDK.
          Install Android Studio from: https://developer.android.com/studio/index.html
          On first launch it will assist you in installing the Android SDK components.
          (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
          If the Android SDK has been installed to a custom location, please use
          `flutter config --android-sdk` to update to that location.
    
    [] Xcode - develop for iOS and macOS (Xcode 13.1)
    [] Chrome - develop for the web
    [!] Android Studio (not installed)
    [] VS Code (version 1.66.0)
    [] Connected device (1 available)
    [] HTTP Host Availability
    

Android Studio対応

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[] Flutter (Channel stable, 2.10.4, on macOS 12.3 21E230 darwin-arm, locale ja-JP)
[!] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
     Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[] Xcode - develop for iOS and macOS (Xcode 13.1)
[] Chrome - develop for the web
[] Android Studio (version 2021.1)
[] VS Code (version 1.66.0)
[] Connected device (1 available)
[] HTTP Host Availability


android-licenses

flutter doctor --android-licenses

emonoemono

all green

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.4, on macOS 12.3 21E230 darwin-arm, locale ja-JP)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 13.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.66.0)
[✓] Connected device (1 available)
[✓] HTTP Host Availability

• No issues found!
emonoemono

証明書

  • キーチェーンアクセス > 証明書アシスタント > 認証曲に証明書を要求…
  • ユーザーのメールアドレスに任意の値を入力
  • 通称に任意の値を入力(管理しやすい名前を付ける)
  • ディスクに保存を選択

証明書を保存

  • Apple Developperで作成する
  • Certificates, Identifiers & Profiles を選択
    • 保存