Flutter what does --split-debug-info do

1,389

--split-debug-info is about extracting the data needed to produce a humanly readable StackTrace.

When we have a StackTrace, we have both the class/method name and the associated line. Having this information means that the app includes all the information needed to produce such StackTrace – which can weight a lot

--split-debug-info is about minimizing the names and other similar elements. Then, since it makes the StackTrace unreadable, --split-debug-info also produce some files that should be preserved, which allows converting a minimized stack trace into something humanly readable.

This unpacking of the StackTrace is done through the flutter symbolize command – which takes both a minimized stack trace and the outputs of a --split-debug-info to produce in a normal StackTrace.

Share:
1,389
Robin Dijkhof
Author by

Robin Dijkhof

me

Updated on December 22, 2022

Comments

  • Robin Dijkhof
    Robin Dijkhof over 1 year

    From the docs:

    When building a release version of your app, consider using the --split-debug-info tag. This flag can dramatically reduce code size. For an example of using this flag

    I also checked Obfuscating Dart code:

    To obfuscate your app, build a release version using the --obfuscate flag, combined with the --split-debug-info flag. The --split-debug-info flag specifies the directory where Flutter can output debug files. This command generates a symbol map. The apk, appbundle, ios, and ios-framework targets are currently supported (macos and aar are supported on the master and dev channels).

    I do understand what obfuscating dart code means, but I can't find what --split-debug-info does on its own. I read it splits debug info. What info are we talking about, are there any disadvantages and how is it different from obfuscating?