On Tue, Feb 3, 2009 at 2:50 PM, Nanard <bsegon...@free.fr> wrote:
> If I test my application and generate a .apk, or if I use the 'Export
> unsigned' menu, I get the
> same application size.
>
> How can I remove debug information for my final releases ?

By "debug information" I assume you mean the local variable and line
number mapping tables. If not, please clarify. And if so:

I have to ask what your point is with the removal. If it's to save
space, then my bet is that the savings won't be significant enough to
bother. In particular, you can expect to save something like 10-15% of
your uncompressed dex file size, whereas in an apk the dex file is
compressed, and whereas in a typical app, the size of included media
resources (images, audio, etc.) probably dominate whatever the dex
savings are.

And with the info stripped out, you will of course no longer get
exception stack traces that have line numbers in them. Although
obviously you won't get feedback from everyone in the field who uses
your app and has trouble, just getting one good stack trace from the
field can be a godsend. Similarly, though you won't expect to hook a
debugger up to every broken instance of your app, the ability to do it
just once and see good local variable info can save you hours of
debugging time.

With that said, dx — the underlying tool used by the Eclipse plugin to
convert your code into a dex file — has options that cause it to omit
line number and/or local variable information ("--positions=none" and
"--no-locals" respectively). I don't believe the Eclipse plugin offers
you a way to include these options, though I could be wrong (sorry; I
don't use Eclipse myself). However, you can always call dx directly to
achieve whatever your goal is.

As a final note, if you are interested more in obfuscation than mere
space savings, you will probably want to run an obfuscator per se,
such as
ProGuard <http://proguard.sourceforge.net/>, over your class files
before converting them to a dex file. Again, I don't think the Eclipse
plugin gives you a way to do this, but with a normal shell command
line, it's easy enough to string together whatever tools you need.

I hope this helps.

-dan

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to