iOS ipa file size

3685
7
Jump to solution
04-18-2018 10:08 AM
PaulHaakma
Regular Contributor

Hi all, just interested to get any comments on the final built ipa file sizes...

I have an app with about 40MB worth of files on disk, most of it is one 25MB tpk and then a hundred or so small graphics files.
However, since the folder is git enabled, there is about 65MB worth of hidden files, so the true size of the folder is a little over 100MB.
The whole folder zipped up comes to about 80MB.

If I remove the hidden git folder, the total files come to about 45MB.
Zipped up, these come to about 21MB.
In ArcGIS Online, the item says it is 21MB. So I'm assuming that it has uploaded the true files and ignored the hidden git ones.

After the build process, the resulting ipa file is 104MB.

And then I get the following email from Apple:

The app binary listed below was 104.3 MB when you submitted it, but will be 192 MB once processed for the App Store. This exceeds the cellular network download size limit and would require your app to be downloaded over Wi-Fi

Can someone sense check that, and verify that those built sizes are about correct? It seems a bit over the top that a zipped 21MB file ends up being a 192MB download from the store! I expect it to increase, but that seems excessive.

Although, as a comparison, the Android builds come in at 55MB and 68MB.

I have another app that has 26MB of files on disk unzipped, which translates to a 60MB ipa file. This one has a small 2MB basemap, so the difference in size on disk is about 16MB (40MB - 24MB). Using that as a baseline, I was expecting this one to come in around 75-80MB, so I'm not sure why it's over 100MB. (Note that the smaller app is using Runtime 10.2.6 and the new one is using 100.1, would that make any difference?)

Just interested in any comments, or suggestions on ways to keep the size down (other than the obvious!). I remember reading somewhere that AppStudio 3.0 I think was dropping support for 32bit iOS devices and would result in smaller installs - is that correct?

0 Kudos
1 Solution

Accepted Solutions
ShobanaSuresh
Esri Contributor

Hi Paul,

AppStudioApp found inside the ipa is a fat binary which includes 32bit and 64bit components.

- App Code ( including the tpk )

- AppFramework libraries statically linked ( Only the plugins used by the app will get included )

- Qt libraries ( Only the Qt modules used by the app will get included )

As a test, can you remove the tpk from the app, rebuild and compare the ipa sizes?

> In ArcGIS Online, the item says it is 21MB. So I'm assuming that it has uploaded the true files and ignored the hidden git >ones.

Yes. AppStudio Upload tool excludes the git hidden files while uploading an app to ArcGIS Online.

> I remember reading somewhere that AppStudio 3.0 I think was dropping support for 32bit iOS devices and would result in > smaller installs - is that correct?

Yes, this is correct. When an app is built using AppStudio 3.0, the AppStudioApp binary inside the ipa will include only 64bit components which will reduce the size of the ipa.

Other useful tips:

- Check if there are any unused 10.2.6 Runtime import statements in the app's code. This will cause both the 10.2.6 and 100.x Runtime libraries to be included in AppStudioApp binary.

- Consider adding an ignore filter in the app's appinfo.json to define a list of file name patterns to be excluded from an app's resources when built. This allows files to be kept in the app item that are useful during development and testing but aren't needed when building an app.

e.g.,

"make": {     
    "ignore": [        
        "*.html",        
        "*.psd",        
        "test*.png",        
        "Folder1/Folder2/",        
        "Folder3/*.qml"    
    ]
}

Ref: Edit appinfo—AppStudio for ArcGIS | ArcGIS 

Thanks

Shobana

View solution in original post

0 Kudos
7 Replies
ChrisLeSueur
Esri Contributor

Paul,

I have seen other instances where the ipa file grows much bigger than the original app project and other platform binaries. I'm not sure, but I suspect the issue is probably with the "launchimage" in your project.

The reason is because Apple requires that a separate “launchimage” gets created for all the different Apple iphone and pad resolutions and it is stored as lossless PNG files in the ipa, and AppStudio cloudmake does this for you. When you have a complex image with lots of details and different colors this can result huge increase in app size.

I have seen where a very colorful and detailed 1mb jpeg was used as a "luanchimage" and when converted to PNGs for Apple it added about 90mb to the size of  they ipa.

The Solution: The solution is to use a very simple graphic with only a few colors and maybe some simple text as your launch image, in many cases this will greatly reduce the size of the ipa file. The launch image is only shown for a second or two as the app first starts up so it has little impact on the aesthetics of the app.

The ipa file is actually just a zipped up folder of files, you can unzip it with something like 7zip and see if the launchimages are taking up a lot of space.

0 Kudos
PaulHaakma
Regular Contributor

Hi Chris

I unzipped the file and checked as suggested. The launch images don't appear to be the issue, all of them combined only come to about 1MB.

It seems to be just one file called 'AppStudioApp' (no extension) which I assume is the actual program files. This file is around 190MB alone.

That's a good tip about the launch images and I'll keep that in mind for future reference!

Any other suggestions for this instance though?

Cheers,

-Paul

0 Kudos
ShobanaSuresh
Esri Contributor

Hi Paul,

AppStudioApp found inside the ipa is a fat binary which includes 32bit and 64bit components.

- App Code ( including the tpk )

- AppFramework libraries statically linked ( Only the plugins used by the app will get included )

- Qt libraries ( Only the Qt modules used by the app will get included )

As a test, can you remove the tpk from the app, rebuild and compare the ipa sizes?

> In ArcGIS Online, the item says it is 21MB. So I'm assuming that it has uploaded the true files and ignored the hidden git >ones.

Yes. AppStudio Upload tool excludes the git hidden files while uploading an app to ArcGIS Online.

> I remember reading somewhere that AppStudio 3.0 I think was dropping support for 32bit iOS devices and would result in > smaller installs - is that correct?

Yes, this is correct. When an app is built using AppStudio 3.0, the AppStudioApp binary inside the ipa will include only 64bit components which will reduce the size of the ipa.

Other useful tips:

- Check if there are any unused 10.2.6 Runtime import statements in the app's code. This will cause both the 10.2.6 and 100.x Runtime libraries to be included in AppStudioApp binary.

- Consider adding an ignore filter in the app's appinfo.json to define a list of file name patterns to be excluded from an app's resources when built. This allows files to be kept in the app item that are useful during development and testing but aren't needed when building an app.

e.g.,

"make": {     
    "ignore": [        
        "*.html",        
        "*.psd",        
        "test*.png",        
        "Folder1/Folder2/",        
        "Folder3/*.qml"    
    ]
}

Ref: Edit appinfo—AppStudio for ArcGIS | ArcGIS 

Thanks

Shobana

View solution in original post

0 Kudos
PaulHaakma
Regular Contributor
Hi Shobana
Thanks for that - some good tips in there to keep in mind!
We replaced the tpk with one that was 8MB (down from 25MB) and re-built. AGOL item size went from 21MB down to 19MB. The built ipa file went from 104MB down to 96MB. I unzipped the ipa file, and the size had reduced from 192MB to 186MB.
I then went one step further, as you suggested, and temporarily removed the tpk altogether. The built ipa file went down to 92MB, and the unzipped ipa to 192MB.
So reducing the tpk size or removing it does reduce the overall size, but not even by as much as the size of the tpk itself!
Maybe the key is in your comments:

AppFramework libraries statically linked ( Only the plugins used by the app will get included )

- Qt libraries ( Only the Qt modules used by the app will get included )

Based on that, is it worth going through all the import statements and removing any unused ones? e.g. I noticed that the template had 'import QtQuick.Window 2.0' but I don't think it's used in the app anywhere.
cheers,
-Paul
0 Kudos
MassimilianoSantini
New Contributor

Hi Paul,

I have the same problem, do you have resolved?

thanks

Massimiliano

0 Kudos
PaulHaakma
Regular Contributor

Hi Massimiliano

I'm not sure I'd say I have it 'resolved', but I think it's ok. It seems that when you submit the ipa to Apple, they use it to create a range of actual installation bundles for targeted devices. So when I looked at the list, there was one "Universal" installer bundle that obviously bundled everything twice (once for 32bit and once for 64) which was around 180MB. But then there were a bunch of smaller (under 100MB) installation bundles for other specific iOS devices.

So yes, I guess some users will end up downloading the large 'universal' one, but most actually will have a much smaller download, so I think that's the best I can expect.

I should mention that it was a conscious decision of ours to bundle the data with the app. If we hadn't done that (and instead had the user download the data after opening the app) then the app would have been much smaller anyway.

That kind of all changes with AppStudio v3.x, as it drops support for 32bit. I haven't had to experience how that works yet.

cheers,

-Paul

0 Kudos
MassimilianoSantini
New Contributor

Hi Paul,

 take a look to this new post and especially the response of Shobana.

https://community.esri.com/thread/215706-appstudio-30-arcgisrt1002-ios-build?sr=inbox&ru=80711 

The ipa so compiled have small dimension 33Mb vs 180Mb compiled with bitcode!

I hope this is useful.

Bye.

Massimiliano

0 Kudos