当前位置:网站首页>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!
边栏推荐
猜你喜欢
Whole process of web page request
Customize to prevent repeated submission of annotations (using redis)
plt.gca()画框及打标签
Startups must survive
Thingspanel releases Internet of things mobile client (multiple pictures)
ThingsPanel 發布物聯網手機客戶端(多圖)
Specific meanings of node and edge in Flink graph
Old ou, a fox friend, has had a headache all day. The VFP format is always wrong when it is converted to JSON format. It is actually caused by disordered code
黑马畅购商城---3.商品管理
Actual combat summary of Youpin e-commerce 3.0 micro Service Mall project
随机推荐
2022 mathematical modeling competition time and registration fee
文献之有效阅读
Record the process of submitting code to openharmony once
Source code analysis of AQS & reentrantlock
现在网上炒股开户身份证信息安全吗?
Detailed explanation of spark specification
Redis雪崩、穿透和击穿是什么?
数据库系列:MySQL索引优化总结(综合版)
What is the development history, specific uses and structure of the chip
plt.gca()画框及打标签
Spark runs wordcount (case 2)
分享7个神仙壁纸网站,让新的壁纸,给自己小小的雀跃,不陷入年年日日的重复。
Cesium building loading (with height)
Manually rollback abnormal data
云原生数据湖以存储、计算、数据管理等能力通过信通院评测认证
Application of analytic hierarchy process in college teaching evaluation system (principle + example + tool)
Continue to cut the picture after the ArcGIS Server is disconnected
Recommend a virtual machine software available for M1 computer
Use of JSP sessionscope domain
Customize to prevent repeated submission of annotations (using redis)