How to reduce app size in iOS? - ios

I know it has been asked many times, but every answer suggests using compressed images or linking to images from the web instead of the resource bundle.
In my app there is only 1.5 MB of images, but still the app has a size of 20.9 MB.
The other files in my app are the following:
2 frameworks (CoreLocation, CoreBluetooth)
2 pods (Fabric, Crashlytics)
8 xib
2 fonts (254KB)
And some Swift and obj-c files
Could anyone help me optimize the size of my app?
I am wondering why my app is so large if there is only 1.5 MB of images and 254KB of fonts? I have some apps on my iPhone which have the same functionality as my app and they only take up 520 KB and 1.6 MB. Does anyone know how the developers of those apps achieved that?

The Swift runtime is included with every app that is currently using Swift and inflates the app size.
Apple doesn't promise code compatibility - but runtime compatibility is promised.
In order to do that the Swift runtime libraries of your compiled code is included with the app. That takes up some space :)

The App Store size might be smaller than Xcode reports. If you upload your build to TestFlight, TestFlight will report a much smaller size (but then tell you the regular App Store version might be larger). With app thinning and bitcode the size of the binary delivered to your user's phones will be smaller than the "full" app size.
Swift's overhead should go away once Swift 5 (https://github.com/apple/swift-evolution) gains ABI compatibility.
Fabric/Crashlytics add a few MB alone. If you build an Archive, then in Finder right-click on the the app and Show Package Contents. From there you can sort by file size and see the biggest culprits.

Related

How to reduce my ipa build size?

I have exported IPA build from Xcode 9.1 and my file size is 168 MB.
I have enabled and disabled bit code feature from build options in Xcode 9.1, But there is no change in IPA build file size it remains same as 168 MB. I am weird about this.
I will appreciate if anyone can help with this.
I really don't understand the concept of App Thinning.
I guess code size is your smallest problem, therefor you don't see much of a change. If you want to have a smaller .ipa, you need to reduce your media files.
"App thinning" is something that happens on Apple site: Simply speaking, if a user downloads your app on a say iPhone, apple kicks out all stuff that does not match to your device, e.g. images for different resolutions than your phone. Therefore, your .ipa still contains all the data, but just the download for the end user is smaller.

Minimize iOS App Size [duplicate]

This question already has answers here:
App size double on archiving iphone
(3 answers)
Closed 5 years ago.
After archiving the build, the build size is almost doubled that of the build generated by dragging and dropping .app to iTunes. Why the build size is increased while archiving. Appreciate the suggestions.TY
The archive includes your debugging symbols .dsym file. Also see this duplicate post and answer.
In addition: assets are the issue in our case. You can in most cases remove meta data from your assets, it's a few kb per assets but with big quantities it adds up. Make sure to save assets for web, photoshop does this better than e.g Sketch, and there are tools like ImageOptim.
I have had that very same question. To be honest I am not sure. It might have something to do with the version for each device or the assets. Do not worry about the size. Once the app gets put onto the App Store the file size will change. One of my apps was 45mb on my simulator and once it was released onto the App Store the file size went down to 21mb. I honestly would not worry about file size unless you have a lot of pictures or videos.
The file size will decrease a lot once it is on the App Store. But if you are really concerned about the app size, there is a way to compress some of the code.
Click here for stackoverflow question that's shows how to do that
Congratulations on your app!
The archived version of the app includes all the assets and compiled code. If you are using Bitcode the size will be large as it will include all the slices of the app. However the downloaded size will differ from the archive size.
This question from Apple support pages also explains how you can determine more accurate file sizes for what the app will actually equal on the App Store.
https://developer.apple.com/library/content/qa/qa1795/_index.html
You might want to have a look into App Thinning to ensure you optimise the size of your app.
https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppDistributionGuide/AppThinning/AppThinning.html
or here
http://www.imore.com/app-thinning-ios-9-explained
Don't worry about the size. As soon as you upload it to the app store, bitcode will do it work which will make the app a lot smaller.

App size on app store is 7x larger than uploaded app size

When i uploaded my iOS app to app-store, the ipa size was 32 MB. Now my app goes live, now i i checked my app size on app store, it is showing 237 MB on iphone 6, it is showing 252 MB size when i open app link in browser on my PC.
Why this much difference in size of app. Any suggestions?
From Apple:
When your application is approved by Apple to sell on the App Store, it is encrypted for DRM purposes and re-compressed. When the encryption is added, the size of the compressed file will increase. The exact size of the increase will vary from app to app, however, the size increase can be large when the binary contains a lot of contiguous zeros. We are unable to guarantee the size of your file after the encryption has been added.
Source (Expand section View the file sizes of a build (iOS, tvOS):
https://help.apple.com/app-store-connect/?lang=en#/dev3b56ce97c
The current Apple docs on "Reducing Your App’s Size" suggest that
compared to the binary you uploaded, the final size of your app after it’s approved for the App Store may end up being slightly larger. [emphasis added]
A 7x-8x increase seems like an extraordinarily large difference to be explained by simple encryption/recompression, but there are pathological cases. It would be good to know what the uncompressed size of the IPA is, and if there are particular files in the uncompressed version that happen to compress very well, that might compress badly after being encrypted.
If so, compressing those before including them in the IPA and decompressing them at run-time might save significant space -- Apple suggests something like that on their “advanced optimization” page, where they talk about compressing images and audio files.
There's also general advice there and on the “basic optimization” page about using asset catalogs and app thinning to minimize bundling resources that might be unnecessary for a particular device, but that doesn't sound like the problem here.

Archived IPA size for Appstore is larger then Adhoc

I am developing app in swift 2 in xcode 7.3. I used too small images and project is too short it contains only one framework googleMobileAds.framework. My total size of project folder is only 36MB where 31MB is only for googleMobileAds.framework.
Now I want to publish my app on store. but it creates too large ipa with size 31 MB for app store deployment. When i tried to export ipa for adhoc exported IPA file size with 8MB. I searched a lot on google and i got to know that disabling of BITCODE will help I disabled but nothing worked its still 31 MB for App Store Deployement. please tell me how to reduce app size because app is too small thats why I want to reduce app size.
Thanks in advance. :)
App store distribution submissions are uncompressed (and App Store downloads are less compressible than development ipa files), so this is normal and there is nothing you can do (except remove lots of code or data from your app).

Advise me on my iPad app

I want to create an iPad app which holds 8 PDF files (each 5.0 MB) and 100 jpg images.
Is it ok to have a app with this much of content added into the resources?
Looking for your help and advice.
Apple limits the size of an app to 2GB (see iTunes Connect Developers Guide). In order to be distributable over the cell network, it must be under 20MB, I think.

Resources