Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter what does --split-debug-info do

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?

like image 351
Robin Dijkhof Avatar asked Jul 01 '20 16:07

Robin Dijkhof


1 Answers

--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.

like image 115
Rémi Rousselet Avatar answered Sep 24 '22 08:09

Rémi Rousselet