mac M1 安装flutter

M1 安装 Flutter

1- 官网下载flutter SDK 盘符自己记好

https://docs.flutter.dev/release/archive?tab=macos

2- 控制台配置环境变量

open .zshrc  / bash_profile //平常在哪配就打开哪个文件

3- 复制粘贴

export PATH="$PATH:/Users/xnr/Documents/flutter/bin:$PATH" // 自己安装的目录
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn

4- 控制台执行

$ flutter doctor


Doctor summary (to see all details, run flutter doctor -v):
[] Flutter (Channel stable, 3.19.6, on macOS 14.1.1 23B81 darwin-arm64, locale
    zh-Hans-CN)
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    ✗ 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 15.3)
    ! CocoaPods 1.12.1 out of date (1.13.0 is recommended).
        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 upgrade see
      https://guides.cocoapods.org/using/getting-started.html#updating-cocoapods
      for instructions.
[] Chrome - develop for the web
[] Android Studio (version 2022.3)
[] IntelliJ IDEA Ultimate Edition (version 2023.2.5)
[] VS Code (version 1.81.1)
[] Connected device (2 available)
    ! Error: Browsing on the local area network for 菠萝🍍. Ensure the device is
      unlocked and attached with a cable or associated with the same local area
      network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code
      -27)
[] Network resources

! Doctor found issues in 2 categories.
注- 没安装过Java环境的去下jdk 环境变量都是这么配的
Android Studio 开发工具, 可以安装 安卓手机模拟器

VS Code 跑IOS真机 可以直接在 Xcode 跑不过需要配置,还没看

  • 5
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值