mac flutter 环境配置

更新时间:2023-05-25 21:55
相关:mac Homebrew 安装 设置国内源 和 git安装


2020macOS Big Sur配置Java开发环境之jdk安装_lxyoucan的博客-CSDN博客
 


下载flutter   并解压/Users/jisjian/sdk/

在 macOS 上安装和配置 Flutter 开发环境 - Flutter 中文文档 - Flutter 中文资源


配置~/.zshrc文件

//需要替换你安装的java版本号
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk/Contents/Home
export PATH=$PATH:$JAVA_HOME/bin:.
export CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:.
 

export PUB_HOSTED_URL=https://mirrors.tuna.tsinghua.edu.cn/dart-pub

 

export FLUTTER_STORAGE_BASE_URL=https://mirrors.tuna.tsinghua.edu.cn/flutter

 

export PATH=/Users/jisjian/sdk/flutter/bin:$PATH

export PATH=/Users/jisjian/sdk/flutter/bin/cache/dart-sdk/bin:$PATH



配置android sdk 
export ANDROID_HOME=/Users/jisjian/sdk/android
export PATH=${PATH}:${ANDROID_HOME}/platform-tools
export PATH=${PATH}:${ANDROID_HOME}/tools
source ~/.zshrc  立即生效

安装idea  在setting 环境变量中安装android sdk到/Users/jisjian/sdk/android
安装 chinese , dart , flutter 插件

idea 设置中安装android sdk

安装cocoapods
gem sources --remove https://rubygems.org/
gem sources --add https://gems.ruby-china.com/
sudo gem install cocoapods