编译jit_release engine
$./flutter/tools/gn --runtime-mode jit_release --ios
$./flutter/tools/gn --runtime-mode jit_release --ios --ios-cpu=arm
$./flutter/tools/gn --runtime-mode jit_release
$ninja -C out/ios_jit_release
$ninja -C out/ios_jit_release_arm
$ninja -C out/host_jit_release
修改Generated.xcconfig
LOCAL_ENGINE=ios_jit_release
FLUTTER_ENGINE=~/Desktop/Workspace/engine/src
FLUTTER_BUILD_MODE=debug
VERBOSE_SCRIPT_LOGGING=YES
可能需要复制一份gen_snapshot到clang_x64下改名gen_snapshot_arm64
修改xcode_backend.sh
//去掉debug和relase检测的代码
if [[ $(echo "$LOCAL_ENGINE" | tr "[:upper:]" "[:lower:]") != *"$build_mode"* ]]; then
EchoError "========================================================================"
EchoError "ERROR: Requested build with Flutter local engine at '${LOCAL_ENGINE}'"
EchoError "This engine is not compatible with FLUTTER_BUILD_MODE: '${build_mode}'."
EchoError "You can fix this by updating the LOCAL_ENGINE environment variable, or"
EchoError "by running:"
EchoError " flutter build ios --local-engine=ios_${build_mode}"
EchoError "or"
EchoError " flutter build ios --local-engine=ios_${build_mode}_unopt"
EchoError "========================================================================"
exit -1
fi
生成flutter_assert
$flutter build bundle --release
网友评论