mirror of
https://github.com/flutter/flutter
synced 2024-10-13 11:42:54 +00:00
Strip debug symbols from App.framework for non-debug builds (#22245)
A dSYM file is created for the stripped `App.framework` and placed at `build/aot/App.dSYM`. Reduces `App.framework` for Flutter Gallery by 6MB uncompressed, minus 23%. Reduces `App.framework` for Hello World by 1.6MB uncompressed, minus 22%. Fixes #4287. Fixes #18693. Helps with #21813. See also #12012. This change depends on https://dart-review.googlesource.com/c/sdk/+/76306.
This commit is contained in:
parent
f330e27dbd
commit
eda228404c
|
@ -141,7 +141,26 @@ BuildApp() {
|
|||
fi
|
||||
StreamOutput "done"
|
||||
|
||||
RunCommand cp -r -- "${build_dir}/aot/App.framework" "${derived_dir}"
|
||||
local app_framework="${build_dir}/aot/App.framework"
|
||||
|
||||
RunCommand cp -r -- "${app_framework}" "${derived_dir}"
|
||||
|
||||
StreamOutput " ├─Generating dSYM file..."
|
||||
RunCommand xcrun dsymutil -o "${build_dir}/aot/App.dSYM" "${app_framework}/App"
|
||||
if [[ $? -ne 0 ]]; then
|
||||
EchoError "Failed to generate debug symbols (dSYM) file for ${app_framework}/App."
|
||||
exit -1
|
||||
fi
|
||||
StreamOutput "done"
|
||||
|
||||
StreamOutput " ├─Stripping debug symbols..."
|
||||
RunCommand xcrun strip -x -S "${derived_dir}/App.framework/App"
|
||||
if [[ $? -ne 0 ]]; then
|
||||
EchoError "Failed to strip ${derived_dir}/App.framework/App."
|
||||
exit -1
|
||||
fi
|
||||
StreamOutput "done"
|
||||
|
||||
else
|
||||
RunCommand mkdir -p -- "${derived_dir}/App.framework"
|
||||
|
||||
|
|
Loading…
Reference in a new issue