Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Corona SDK produced iPhone app size

I have built the following app for Corona SDK

    local hello = "hello";
    print(hello);

using iPhone as a target.. The final binary is staggering 8.7Mbytes..

This is a real problem when I try to deploy a complex application with multiple grfx to the field. I like to believe I am doing something wrong and this image size could be smaller..

Any ideas or pointers?

According to this blog post, Corona is small.. http://blog.anscamobile.com/2010/02/flash-iphone-and-beyond/

Thx, F.

like image 499
Frank Avatar asked Jun 29 '11 08:06

Frank


2 Answers

If you are a Corona (Indie or Pro) subscriber, then you will get an optimized binary. I just did a test on build 484 (the latest public release as of today) and HelloWorld is only 2.2 MB on iOS.

The exe is actually an universal binary, meaning it targets armv6 and arm7 (run lipo to see) instruction sets. If we only supported one instruction set, Hello World would be only 1.1 MB, still less than a 5.25" floppy disk!

If you are a trial user, then you will get an unoptimized/trial binary that is 8.7 MB. The reason is b/c for trial users, we do not optimize the binary code size based on libraries that you "require" in Lua code.

For trial users, the OpenFeint library gets included in the unoptimized/trial version whether or not it actually gets used. And believe it or not, OpenFeint is responsible for nearly quadrupling the code size of Corona!

like image 177
walter Avatar answered Oct 21 '22 08:10

walter


I don't think it's that large for what it is. You have to remember that your app must include all the libraries that are required for Corona. The majority of that 8.7 megabytes is the Corona engine itself. What you also need to remember is may be producing a fat binary by default, which would almost double the size of your app.

like image 24
lxt Avatar answered Oct 21 '22 08:10

lxt