flutter

Windows下安装配置flutter

安装flutter

使用git命令克隆dev版本的Flutter到本地

1
git clone -b dev https://github.com/flutter/flutter.git

环境变量配置

在系统环境变量中找到Path,在最后添加Flutter的bin目录路径,例如:

1
F:\flutter\bin

配置国内镜像

二选一

1
2
3
4
5
6
7
# 上海交通大学 Linux 用户组
FLUTTER_STORAGE_BASE_URL: https://mirrors.sjtug.sjtu.edu.cn
PUB_HOSTED_URL: https://dart-pub.mirrors.sjtug.sjtu.edu.cn

# Flutter 社区
FLUTTER_STORAGE_BASE_URL: https://storage.flutter-io.cn
PUB_HOSTED_URL: https://pub.flutter-io.cn

运行

1
flutter doctor

问题及解决办法

1
2
# 卡住不动删除如下文件
F:\flutter\bin\cache

模拟器

推荐雷电模拟器,可以直接识别到

flutter android-studio 连接模拟器(已废弃)

进入android-studio SDK目录F:\AndroidSDK\platform-tools

1
cd F:\AndroidSDK\platform-tools

连接模拟器

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 夜神模拟器:
adb connect 127.0.0.1:62001

# 逍遥安卓模拟器:
adb connect 127.0.0.1:21503

# 天天模拟器:
adb connect 127.0.0.1:6555

# 海马玩模拟器:
adb connect 127.0.0.1:53001

# 网易MUMU模拟器:
adb connect 127.0.0.1:7555

# 原生模拟器:
adb connect (你的IP地址):5555

# 车机端:
adb connect 192.168.1.100:5555 (我这边是这个)

运行项目

1
flutter run --enable-software-rendering

Linux下安装配置flutter

1
2
3
4
5
6
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
git clone -b dev https://github.com/flutter/flutter.git
export PATH="$PWD/flutter/bin:$PATH"
cd ./flutter
flutter doctor

flutter
http://example.com/20200805-flutter/
作者
csorz
发布于
2020年8月5日
许可协议