 |
 |
Large applications
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Mar 2001
Location: Göteborg, Sweden
Status:
Offline
|
|
Made a little program and built it using Project Builder. But when I looked at the program in Finder it was 1.5 MB large. I tested to build using build style "Deployment" but the size was the same. So the questions are:
- How do I build the final version of my app?
- Is the Name.app file in the "build" folder all of my application or does it need anything else in the "build" folder? (I have no other targets)
- Any other tips before building the final app?
/fredrik
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Feb 2000
Location: Storrs,Connecticut, USA
Status:
Offline
|
|
Are you using Cocoa? I know that carbon apps tend to be really bloated for some reason but everything that I have written in Cocoa has always ended up being fairly small. I wrote a decent sized program and not counting graphics and sounds it was only about 800k. So, do you have lots of graphics or sounds to make the size of your app swell? Are you looking at the size of you build folder and not you app? The build folder also contains a bunch of object code in a folder named intermediates that was used in making the app so if you just look at the size of your build folder it will be too big.
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Sep 2000
Status:
Offline
|
|
If you're seeing executable size of 500-800K for a small app, it's most likely due to debugging symbols and such. Typically the binary for a small app is in the 30-60K range; with icon and other resources you might get 100-200K for the package.
Off the top of my head I am not sure how you do this in PB, but in a shell, if you do "pbxbuild install", the app will be built (if needed) and installed. This includes copying the cleaned-up, stripped app to the correct install location. Typically your install location might be something like "/Applications" (you specify this in the Build Settings in PB), but while testing, you would do
pbxbuild install DSTROOT=/Users/yourusername/testfolder
which will install the app and all its associated resources in a hierarchy rooted at /Users/yourusername/testfolder.
I believe there's a way to do the install from within PB, but I can't recall how to do it exactly...
Ali
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Feb 2001
Location: OR
Status:
Offline
|
|
Are you using Public Beta or Release Candidate? The file size of a very simple cocoa app compiled in the public beta was 64 KB. That very same app compiled in the release candidate was 928 KB. The actual compile time is much longer in the RC also. I have been trying to find some kind of setting in Project Builder which would cause this extra size boost, but I can't find anything. Anyone have some ideas of what it could be? Perhaps some of the Cocoa code is being written into the app? Sorry I couldn't offer much help.
Ryan
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Mar 2001
Location: Göteborg, Sweden
Status:
Offline
|
|
Yes I'm using a Release Candidate. I got the size down to 1 MB by build it from the command-line with "pbxbuild install" (but it won't install at the right location). 1 MB is still much I think. I have just a bit of code written in cocoa, no icons, sounds or images.
/fredrik
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Mar 2001
Location: Göteborg, Sweden
Status:
Offline
|
|
Weird, removed the build folder and build it again with "pbxbuild install DSTROOT=/..." then it installed at the right location and 52KB small. It seams that the pbxbuild ignored the install location set by PB.
/fredrik
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Feb 2001
Location: OR
Status:
Offline
|
|
I believe I've found the cause for the extreme file sizes. Go to your target then click on it to bring up the settings. Go to the "Build Settings" Tab, then find the "Generate Debugging Symbols" checkbox. Uncheck this, clean the targets, and then recompile. It should be a much smaller file size. Mine jumped from 928k to 52k. However this doesn't seem to alter the compiling time. I am guessing this setting was turned off by default on the PB.
Ryan
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Sep 2000
Status:
Offline
|
|
You can use the "size" command on a binary to find out how much space is being used up by what in the binary. For instance, if I build TextEdit and do:
size ~/TextEdit/build/TextEdit.app/Contents/MacOS/TextEdit
I get the following, which shows the total size (in bytes, usually rounded up to the page size) of the various "segments" in the executable:
__TEXT __DATA __OBJC others dec hex
126976 4096 8192 651264 790528 c1000
Here, __TEXT segment is the executable code plus any truly readonly (const) data (such as bodies of strings), __DATA is writable data, __OBJC is the Obj-C class information, and others is usually mostly the symbols & debugging info. (dec and hex are the decimal and hex versions of the total size).
If I do the same thing on the released version:
size /Applications/TextEdit.app/Contents/MacOS/TextEdit
__TEXT __DATA __OBJC others dec hex
81920 4096 8192 10188 104396 197cc
you will see both the __TEXT and others segments are way smaller.
You can use "size -m" to get more detailed info about these segments (segments are made up of sections, size -m gives you section-level info).
Ali
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Feb 2001
Location: OR
Status:
Offline
|
|
I believe I've found the cause for the extreme file sizes. Go to your target then click on it to bring up the settings. Go to the "Build Settings" Tab, then find the "Generate Debugging Symbols" checkbox. Uncheck this, clean the targets, and then recompile. It should be a much smaller file size. Mine jumped from 928k to 52k. However this doesn't seem to alter the compiling time. I am guessing this setting was turned off by default on the PB.
Ryan
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|