当前位置:网站首页>flutter常用命令及问题
flutter常用命令及问题
2022-06-25 11:47:00 【ruiurrui】
检测
检测当前版本
flutter doctor -v检测环境
flutter doctor查看连接设备
flutter devices
分支
查看当前分支
flutter channel切换分支
flutter channel master更新当前分支SDK
flutter upgrade
配置
查看配置
flutter config设置启用配置
flutter config <配置选项>
例如:flutter config --enable-windows-desktop,配置选项是根据flutter config查看出来的选项列表。
创建项目
- 指定项目名称和包名,创建全平台工程
flutter create <项目名称> --org <应用Id>
例如:flutter create flutter_test --org com.example.flutter
运行应用
直接运行
flutter run运行release
flutter run --release在指定设备运行
flutter run -d <设备名称>
设备名称是通过flutter devices查出来的设备。
在浏览器运行
flutter run -d chrome在macos上运行
flutter run -d macos
常见问题
web sdk下载超时
当设置支持了web平台的时候,运行flutter run,下载web sdk超时。
renzhongruideMacBook-Pro:all_platform_app renzhongrui$ flutter run
Downloading Web SDK... 6.5s
Downloading CanvasKit... 75.0s
Downloading CanvasKit... 75.5s⣄
Failed to download
https://chrome-infra-packages.appspot.com/dl/flutter/web/canvaskit_bundle/+/4PosNK
iHa3EaBK4alMD4idrKYxAk0I0QiRVDDQplhOYC. Ensure you have network connectivity and
then try again. SocketException: Operation timed out (OS Error: Operation timed out, errno = 60),
address = chrome-infra-packages.appspot.com, port = 59334
mac本设置export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn,再次执行flutter run。
renzhongruideMacBook-Pro:all_platform_app renzhongrui$ export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
renzhongruideMacBook-Pro:all_platform_app renzhongrui$ flutter run
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure
you trust this source!
边栏推荐
- RPC typical framework
- Two ways of redis persistence -- detailed explanation of RDB and AOF
- 文献之有效阅读
- JSON format processing
- Spark runs wordcount (case 2)
- 2022 mathematical modeling competition time and registration fee
- Simple use of stream (II)
- 云原生数据湖以存储、计算、数据管理等能力通过信通院评测认证
- 记一次给OpenHarmony提交代码的过程
- Oracle Spatial creating spatial tables
猜你喜欢

Whole process of web page request

Why distributed IDS? What are the distributed ID generation schemes?

Why can't the form be closed? The magic of revealing VFP object references

Continue to cut the picture after the ArcGIS Server is disconnected

Capacity expansion mechanism of Dict Of redis (rehash)

架构师为你揭秘在阿里、腾讯、美团工作的区别

黑马畅购商城---2.分布式文件存储FastDFS

Shichuang Energy sprint Technology Innovation Board: le chiffre d'affaires annuel prévu de 1,1 milliard de RMB est de 0,7 milliard de RMB, en baisse de 36%

Dark horse shopping mall ---8 Microservice gateway and JWT token

4 life distributions
随机推荐
What is the development history, specific uses and structure of the chip
机器学习自学成才的十条戒律
Actual combat summary of Youpin e-commerce 3.0 micro Service Mall project
TCP如何處理三次握手和四次揮手期間的异常
How terrible is it not to use error handling in VFP?
confluence7.4.X升级实录
Is industrial securities a state-owned enterprise? Is it safe to open an account in industrial securities?
ThingsPanel 发布物联网手机客户端(多图)
Dark horse shopping mall ---8 Microservice gateway and JWT token
Why distributed IDS? What are the distributed ID generation schemes?
Startups must survive
Customize to prevent repeated submission of annotations (using redis)
Tool usage summary
Real software developers will use this method to predict the future
Spark runs wordcount (case 1)
Spark history server performance improvement (I) -- Application List
推荐一款M1电脑可用的虚拟机软件
Data Lake survey
Sword finger offer II 091 Painting house: application of state machine DP
SMS verification before deleting JSP