Title: Hi everyone!<p>We’re Noah and Josh from Emerge (<a href="https:&#x2F;&#x2F;www.emergetools.com" rel="nofollow">https:&#x2F;&#x2F;www.emergetools.com</a>). Our company is building a monitoring and analysis tool to help iOS developers reduce their app’s size.<p>You might have heard about app size challenges faced by large iOS apps, particularly those with Swift codebases. I was an iOS engineer at Airbnb for 4.5 years and personally worked on their size reduction efforts.<p>App size is tricky to quantify. The size users most commonly see (what’s on the App Store page) is the install size thinned for their device. This is the size measured after stripping out assets like images and other media not needed for your screen size, or code that doesn’t run on your device’s architecture. However, this isn’t the only size metric out there, there’s also download and universal size (read more about this in our docs [1]).<p>Our tool makes app size easy to understand by visualizing the size contribution of every file in your app, from localized strings to machine learning models. To better our understanding, we even reverse engineered compiled asset catalogs and Mach-O binaries to show size contributions of original images, source files and Swift modules. With this perspective we often see files that don’t belong or are suspiciously large.<p>While testing our tool we analyzed and learned from over 150 iOS applications and found that keeping app size in check is really hard— even for industry leaders. Here are some of our more interesting findings.<p>Dropbox (<a href="https:&#x2F;&#x2F;www.emergetools.com&#x2F;apps&#x2F;dropbox" rel="nofollow">https:&#x2F;&#x2F;www.emergetools.com&#x2F;apps&#x2F;dropbox</a>)
From the visualization, you can clearly see why Dropbox’s iOS app is 270 MB— it’s 35% localization files. These files are duplicated from the main app into 7 different app extensions and they all include comments that provide translators with context for the strings. Just removing these comments from the production app could save 46 MB.<p>eBay (<a href="https:&#x2F;&#x2F;www.emergetools.com&#x2F;apps&#x2F;ebay" rel="nofollow">https:&#x2F;&#x2F;www.emergetools.com&#x2F;apps&#x2F;ebay</a>)
This is an interesting architecture because although the main app’s executable is only ~150 KB, 86% of the app’s size comes from executables, the biggest one (32 MB) being EbayApp.framework. When building a Swift framework, the binary contains symbols which are not needed in the build uploaded to the App Store. These symbols can be stripped using the method described in our docs [2]. Stripping binary symbols would reduce Ebay’s app size by over 40%. Emerge can generate a script to add to your Xcode build phase to strip symbols for you.<p>Spark (<a href="https:&#x2F;&#x2F;www.emergetools.com&#x2F;apps&#x2F;spark" rel="nofollow">https:&#x2F;&#x2F;www.emergetools.com&#x2F;apps&#x2F;spark</a>)
About 1&#x2F;10th of Spark’s ~230 MB app is font files. 10 MB of those font files are duplicates found in an app extension. After a closer look, the fonts duplicated are all SF-Pro-Text, look familiar? These have been system fonts since iOS 11 (the minimum version for Spark). If the system font was used directly, 10% of the whole app could be deleted!<p>If you want to dive in a bit deeper you can check out our Medium post which goes into detail on some other popular apps [3].<p>Our analysis consistently shows that without guardrails in place, app size can get out of hand very quickly. Emerge wants to help developers reduce their size and keep it that way. Our continuous monitoring and binary size profiling prevents regressions by alerting developers of size changes in their pull requests, helping teams build better, smaller apps.<p>We offer a free Growth plan designed for independent developers and small startups. Our paid plans start at $499&#x2F;month, you can view more details here: <a href="https:&#x2F;&#x2F;www.emergetools.com&#x2F;pricing" rel="nofollow">https:&#x2F;&#x2F;www.emergetools.com&#x2F;pricing</a>.<p>If app size has come up in your development process, we’d love to hear about how you handled it. We’re always looking to improve and grow our product and we’re especially excited to hear feedback from the HN community!<p>Thanks, Noah + Josh<p>[1] <a href="https:&#x2F;&#x2F;docs.emergetools.com&#x2F;docs&#x2F;what-is-app-size" rel="nofollow">https:&#x2F;&#x2F;docs.emergetools.com&#x2F;docs&#x2F;what-is-app-size</a><p>[2] <a href="https:&#x2F;&#x2F;docs.emergetools.com&#x2F;docs&#x2F;strip-binary-symbols" rel="nofollow">https:&#x2F;&#x2F;docs.emergetools.com&#x2F;docs&#x2F;strip-binary-symbols</a><p>[3] <a href="https:&#x2F;&#x2F;medium.com&#x2F;swlh&#x2F;how-7-ios-apps-could-save-you-500mb-of-storage-a828782c973e" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;swlh&#x2F;how-7-ios-apps-could-save-you-500mb-...</a>
Upvote: