码迷,mamicode.com
首页 > 其他好文 > 详细

flutter 混合开发实现热更新

时间:2020-05-01 17:05:02      阅读:244      评论:0      收藏:0      [点我收藏+]

标签:rip   for   命令   files   detach   html   profile   执行命令   xcode   

flutter混合开发后,在Xcode中运行工程,由于flutter项目没有运行起来,是没办法热更新的,但是这种场景是可以解决的

  1. Flutter和原生(这里只说iOS 参考https://www.cnblogs.com/qqcc1388/p/12693991.html)混合开发配置
  2. Xcode中运行App
  3. Flutter工程中(我这里是VSCode中)执行命令行
chenhaodeMac:flutter_project chenhao$ flutter attach
Syncing files to device iPhone 11 Pro Max...                            
 6,854ms (!)                                       

??  To hot reload changes while running, press "r". To hot restart (and rebuild state), press
"R".
An Observatory debugger and profiler on iPhone 11 Pro Max is available at:
http://127.0.0.1:64758/Ohwd6eZv1eY=/
For a more detailed help message, press "h". To detach, press "d"; to quit, press "q".

执行完flutter attack你会发现,命令行熟悉的页面出现了,此时试试看,在VSCode中做Flutter页面的修改,会直接修改模拟器中的页面

注意 需要先让native代码运行起来,在执行flutter attach

flutter 混合开发实现热更新

标签:rip   for   命令   files   detach   html   profile   执行命令   xcode   

原文地址:https://www.cnblogs.com/vwvwvwgwgvervae/p/12813774.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!