zohar

zohar

flutter iOS 如何使用 sksl 预热

在命令行中#

  1. 在 profile 模式下运行你的 app
    flutter run --profile --cache-sksl -d 00008110-xxxxx
    00008110-xxxxx 是你的设备 id
  2. 在 app 中做各种操作,主要是可能会产生卡顿 (jank) 的那些
  3. 按下 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.

  4. 在打包 ipa 上传时,增加命令参数: --bundle-sksl-path flutter_01.sksl.json
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.