随笔 - 262  文章 - 0  评论 - 5  阅读 - 20万

【flutter】flutter混合开发、原生项目集成flutter 断点调试

1.android 项集成flutter 

以module形式集成。

include ':flutter_module'
setBinding(new Binding([gradle: this]))
evaluate(new File(
settingsDir.parentFile,
'flutter_module/.android/include_flutter.groovy'
))
project(':flutter_module').projectDir = new File('../flutter_module')

implementation project(':flutter')
使用android studio 开发。
在主端直接发起调试即可。主端和flutter 即可断点。
或者 在as菜单执行 是菜单,不是命令行。让as启动调试。

 

 

ios 调试开启。

项目集成方试 脚本项目组件方式集成。

集成完成后。从xocde端启动项目。如果xcode 加as开发。那么调试开启和上面一样。从菜单发起flutter attach成功后可以打断点。

如果是vscode开发flutter ,app启动以后 打开flutter项目-》

切到调试页。-》添加运行配置:

 

或者

 

 

添加配置:

 

 

"configurations": [


{
"name": "Flutter: Attach to Device",
"type": "dart",
"request": "attach"
},
// {
// "name": "flutter_module",
// "request": "launch",
// "type": "dart"
// },
{
"name": "flutter_module (profile mode)",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
}
]
 
执行成功,可以断点调试。
 或者:
{
"name": "Flutter: Attach --app-id com.xxx.xxx",
"type": "dart",
"request": "attach"
}
 
com.xxx.xxx应用appid 
Iphone需要关闭热点。

 

 这就可以撸了。

 

posted on   wp7ers  阅读(2374)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
历史上的今天:
2021-03-02 【flutter 入门】listview
2020-03-02 【android 动画小技巧】一个控制顺序播放多个动画。
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示