How HuoLala Shrunk Its iOS App: Proven Strategies to Cut Package Size
This article details HuoLala's comprehensive iOS app slimming process—covering background metrics, Apple size limits, App Thinning, compiler and resource optimizations, Mach‑O analysis, framework handling, coding guidelines, and CI safeguards—to help developers reduce installation size, improve launch speed, and boost user conversion rates.
Background
HuoLala’s user‑side iOS app grew rapidly, prompting a need to reduce package size because installation size, launch speed, stability, resource consumption and smoothness directly affect user perception and conversion rates.
Why package size matters
Google’s 2019 data show each 6 MB increase reduces download conversion by 1 %; reducing 10 MB can raise global conversion by 1.75 %.
Apple constraints
App Store OTA limits (100 MB → 150 MB → 200 MB with user permission) and __TEXT segment limits (80 MB pre‑iOS 7, 60 MB per architecture iOS 7‑8, 500 MB total after iOS 9) restrict binary size.
App Thinning
Apple provides App Slicing, Bitcode and On‑Demand Resources to deliver only needed assets per device.
Our optimization workflow
We analyzed the package composition (Mach‑O executable, resources, frameworks) and applied multiple techniques:
Compiler optimizations
Removed unused architectures (exclude armv7/armv7s).
Set appropriate optimization levels (‑Os for Release).
Enabled Strip Link Product, dead‑code stripping, LTO (Monolithic/Incremental).
Configured Asset Catalog compiler for space optimization.
Resource optimization
Deleted unused images, fonts, db files using LSUnusedResources and custom shell scripts that locate unreferenced assets.
Compressed PNGs with pngquant --quality=20-30, achieving up to 60 % reduction; converted assets to WebP where possible (iOS support via SDWebImage/WebP).
Mach‑O reduction
Generated LinkMap files to identify dead Objective‑C classes/methods; used runtime class‑initialization flags to track usage and prune unused code.
Framework handling
Prefer static libraries over dynamic frameworks; experiments showed static linking saved ~2.6 MB for three common libraries.
Coding guidelines
Encapsulate and refactor duplicated logic.
Use C functions instead of class methods for internal utilities.
Prefer ivars over properties for private data.
Adopt icon fonts, tint colors, and WebP to shrink icons.
Preventive measures
Integrate resource‑size checks and unused‑resource scans into CI, set thresholds for image size, module growth, and third‑party assets, and enforce code‑review standards.
Conclusion
Combining compiler flags, resource cleaning, image compression, Mach‑O analysis and disciplined coding yielded a total reduction of over 20 MB across components, demonstrating a repeatable process for iOS app slimming.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
