[Flutter]在Mac上安装Flutter运行环境

一、安装Xcode

二、安装Android Studio

三、安装brew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

四、下载Flutter SDK

地址:https://flutter.dev/docs/development/tools/sdk/releases#macos

五、解压缩到合适的目录

六、配置环境变量,设置代理

vim ~/.bash_profile

添加

export PATH=地址/flutter/bin:$PATH

export PUB_HOSTED_URL=https://pub.flutter-io.cn

export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn

 

七、加载环境变量

source ~/.bash_profile

八、检测是否安装成功

flutter -h

九、运行doctor

flutter doctor

十、配置环境

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer 

brew update

brew install --HEAD usbmuxd

brew link usbmuxd

brew install --HEAD libimobiledevice 

brew install ideviceinstaller ios-deploy cocoapods

pod setup

十一、创建项目

cd 合适的位置

flutter create flutterdemo

十二、打开iPhone模拟器

open -a Simulator

十三、运行iOS应用

cd demo位置

flutter run

 

posted @ 2021-01-11 14:55  EverNight  阅读(182)  评论(0编辑  收藏  举报