安装fluttersdk之前的准备动作,先把xcode和谷歌浏览器下载了
1、下载sdk:
docs.flutter.dev/release/arc... 就是下载这个

2.下载后,解压文件,在向往文件夹下 /users/用户名 ,输入这个内容, 会看到下面这个图片

在这里创建一个文件夹名为development,这个名称随意,但是不要中文,不要有特殊字符

把之前解压的文件放在这个文件夹里

3.打开终端,输入cd development ,然后输入ls 就能查看到这个flutter 文件夹了

4.接着输入 vi ~/.bash_profile 回车后按i键,输入一下内容
export PATH=/Users/ylellen/development/flutter/bin:$PATH
export PUB_HOSTED_URL=pub.flutter-io.cn export FLUTTER_STORAGE_BASE_URL=storage.flutter-io.cn 只修改第一行的内容,自己找下这个路径做对应的修改 ,然后按esc退出编辑状态,:wq保存
5、接着在终端内打入source ~/.bash_profile,执行下。但是这样设置只能本次有效,关闭终端后,flutter doctor 依然执行不了
6、在终端输入vim ~/.zshrc
里面编辑这句话:source ~/.bash_profile

7、在执行一次source ~/.bash_profile。flutter SDK就配置好了。
8、下面执行flutter doctor,就会看到这样一个界面

9、经验,先做这一个
在终端内输入,brew install cocoapods
如果没有安装brew,先安装下brew,安装命令如下
/bin/zsh -c "$(curl -fsSL gitee.com/cunkai/Home...)"
然后镜像选择输入:1
然后输入密码,等待安装即可完成。会提示终端重新打开,国内源生效,
安装完成后输入brew install cocoapods
速度还是很快的

10、安装完成后,从新输入flutter doctor,发现就差一个android了。

11、去android studio 官网把android studio 下载下来
下载地址:developer.android.google.cn/studio?hl=z...

12、安装android studio后,打开它,







13、默认去创建一个项目


看下右下角的进度条走完没有,完了之后,【不然,特别卡】
在左上角找到setting 打开后,在这里输入sdk



14、马上就快结束了,在终端内输入flutter doctor,出现这个界面,那就按照里面的命令:flutter doctor --android-licenses 输入,一直输入y

15、最后在终端内输入flutter doctor ,全部绿灯,flutter环境也全部通过了,在这里说一下,android studio 里自带的那个虚拟机不好用。下面我创建一个新的。

16、创建android 虚拟机,打开我们刚才创建的测试程序,




创建完成了,把原来的那个删除了。
👀关注公众号:Android老皮!!!欢迎大家来找我探讨交流👀