Flutter Engine 编译与调试(2026)

7 阅读1分钟

Flutter Engine 编译与调试(2026)

网上大部分关于Flutter 引擎源码编译调试的博客都已经过时,过于古老。而且非常麻烦,需要Flutter 和 engine 需要有相同的commit id.

现在最新的Flutter engine 编译调试不再需要commit id,并且把 gn 和 ninja 工具集合到一个叫做 et 的工具包中。

相关命令:

// 编译环境的搭建
https://github.com/flutter/flutter/blob/main/docs/engine/contributing/Setting-up-the-Engine-development-environment.md


et build --config ios_debug_sim_unopt_arm64

et build --config host_debug


FLUTTER_ENGINE=/Users/chenghuanzhong/Desktop/flutter_src/engine/src
LOCAL_ENGINE=ios_debug_sim_unopt_arm64
LOCAL_ENGINE_HOST=host_debug


br set -n "touchesBegan:withEvent:"

详情请看:www.bilibili.com/video/BV12c…