您的位置:首页 > 博客中心 > 网络系统 >

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

时间:2022-04-03 16:26

一、安装Xcode

二、安装Android Studio

三、安装brew

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

四、下载Flutter SDK

地址:

五、解压缩到合适的目录

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

vim ~/.bash_profile

添加

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

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

export FLUTTER_STORAGE_BASE_URL=

技术图片 

七、加载环境变量

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

技术图片

 技术图片

本类排行

今日推荐

热门手游