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
載入中......
此文章數據所有權由區塊鏈加密技術和智能合約保障僅歸創作者所有。