在命令行中#
- 在 profile 模式下運行你的 app
flutter run --profile --cache-sksl -d 00008110-xxxxx
00008110-xxxxx
是你的設備 id - 在 app 中做各種操作,主要是可能會產生卡頓 (jank) 的那些
- 按下 shift+m (M), 這時候會生成一個 flutter_01.sksl.json 的文件到項目根目錄下.
Press M at the command line of flutter run to write the captured SkSL shaders into a file named something like flutter_01.sksl.json. For best results, capture SkSL shaders on an actual iOS device. A shader captured on a simulator isn’t likely to work correctly on actual hardware.
- 在打包 ipa 上傳時,增加命令參數:
--bundle-sksl-path flutter_01.sksl.json