iOS App Size Optimization: Shrink Your Bundle
Your app's download size directly affects conversion rates. Here's everything you need to know about reducing your iOS app bundle from bloated to lean.
📦 TL;DR - Key Size Limits
- • 200MB: Maximum size for cellular download (users need WiFi above this)
- • 4GB: Maximum total app size in App Store
- • App Thinning automatically reduces what each device downloads
- • Every 10MB reduction can improve conversion by 1-2%
- • On-demand resources let you load assets only when needed
Why App Size Matters
App size isn't just a technical metric—it directly impacts how many people download your app. Research from Google found that for every 6MB increase in app size, install conversion rates drop by 1%. Apple hasn't published similar numbers, but the logic is the same: bigger apps mean more friction.
The 200MB limit is the critical threshold. Above that, users on cellular need to either wait for WiFi or manually allow the download in Settings. Most won't bother. That "Download on WiFi" prompt has killed countless potential installs.
The Real-World Impact
A developer shared on Reddit: "We dropped from 240MB to 180MB. Downloads increased 23% the following month." That's the power of getting under the cellular limit. Even if your users have unlimited data, the friction of waiting for WiFi loses them.
Measure Your App Size First
Before optimizing anything, you need to understand what's actually taking up space. The file size you see in Finder is NOT what users download—Apple applies compression and App Thinning.
Method 1: App Store Connect
The most accurate way to see your real-world size:
- Upload a build to App Store Connect
- Go to TestFlight or the App Store tab
- Click on your build and find "App File Sizes"
- You'll see the compressed download size for each device
Method 2: Xcode App Size Report
For quick local checks:
- Archive your app (Product → Archive)
- Select your archive, click "Distribute App"
- Choose "Development" or "Ad Hoc"
- Check "App Thinning" and select a specific device
- Export—you'll get a size report showing compressed sizes
# Generate app size report from archive
xcodebuild -exportArchive -archivePath MyApp.xcarchive \
-exportPath ./export \
-exportOptionsPlist ExportOptions.plist \
-allowProvisioningUpdates
# Check the App Thinning Size Report.txt in the export folder
Method 3: Analyzing the IPA
To see exactly what's taking up space:
# Rename .ipa to .zip and extract
mv MyApp.ipa MyApp.zip
unzip MyApp.zip -d extracted/
# Find largest files
find extracted -type f -exec ls -la {} \; | sort -k 5 -rn | head -20
# Or use du to see folder sizes
du -sh extracted/Payload/MyApp.app/*
Understanding App Thinning
App Thinning is Apple's umbrella term for three technologies that reduce download size. It's been around since iOS 9, and you get most of it for free.
App Slicing
The App Store delivers only the assets and code that match the user's device. An iPhone 15 user won't download iPad-only assets or @1x images.
Bitcode
Deprecated as of Xcode 14. Previously let Apple recompile your app for specific devices. Now removed—don't worry about it.
On-Demand Resources
Download specific assets only when needed. Perfect for game levels, tutorials, or region-specific content.
App Slicing happens automatically if you're using Asset Catalogs correctly. The key is to never embed device-specific resources directly—always use Asset Catalogs so the App Store knows what can be sliced out.
Asset Optimization
Assets are almost always the biggest culprit for bloated apps. Images, videos, and audio files often account for 60-80% of total app size.
Images
Use Asset Catalogs
Always put images in .xcassets. This enables App Slicing and better compression. Direct file references bypass optimization entirely.
Use Vector PDFs or SVGs
For icons and simple graphics, use PDFs set to "Single Scale" in Asset Catalogs. One file serves all resolutions. Check "Preserve Vector Data" for sharp scaling.
Choose the Right Format
HEIF: Best compression, 50% smaller than JPEG, iOS 11+
PNG: For transparency, lossless
JPEG: Photos without transparency
WebP: Good compression, iOS 14+
Consider dropping @1x assets—no device has used 1x resolution since iPhone 3GS.
Compress Before Adding
Use ImageOptim, TinyPNG, or similar tools before importing. Don't rely on Xcode's compression—pre-optimized assets are always smaller.
Audio & Video
- Audio: Use AAC or MP3 instead of WAV/AIFF. A 44.1kHz stereo WAV is 10MB/minute; AAC at 128kbps is under 1MB/minute.
- Video: Stream from a server instead of bundling. If you must bundle, use HEVC (H.265) for iOS 11+ devices.
- Sound Effects: Use CAF format with IMA4 compression. Perfect for short sounds in games.
Quick Win: Find Duplicate Assets
Run fdupes -r YourProject/ or use a tool like Gemini to find duplicate files. It's common to have the same image imported multiple times with different names.
Code & Dependencies
Compiled code is usually 10-30% of your app, but dependencies can balloon that quickly. A "small" SDK might add 10-50MB.
Build Settings
# In your xcconfig or Build Settings:
# Enable optimizations for Release
SWIFT_OPTIMIZATION_LEVEL = -Osize # Optimize for size over speed
GCC_OPTIMIZATION_LEVEL = s # Same for Objective-C
# Strip debug symbols
STRIP_INSTALLED_PRODUCT = YES
STRIP_STYLE = all
COPY_PHASE_STRIP = YES
# Remove dead code
DEAD_CODE_STRIPPING = YES
# Link-Time Optimization (can significantly reduce size)
LLVM_LTO = YES # or Monolithic for more aggressive
Audit Your Dependencies
Third-party SDKs are often the hidden size killer. Here's a typical example:
| SDK | Typical Size | Notes |
|---|---|---|
| Firebase Analytics | ~5-8MB | Reasonable |
| Firebase Full Suite | ~20-40MB | Only import what you use |
| Facebook SDK | ~10-15MB | Can use lightweight alternatives |
| Google Maps SDK | ~50-80MB | Consider MapKit instead |
| AWS SDK (full) | ~30-50MB | Import only needed modules |
| Realm | ~15-20MB | Consider Core Data for simpler needs |
Before Adding Any SDK, Ask:
- • How much size does it add? (Check their documentation)
- • Can I use a lighter alternative or Apple's built-in APIs?
- • Am I using more than 20% of its features?
- • Can I make it load lazily or on-demand?
Swift-Specific Tips
- Avoid generics abuse: Heavy use of generics causes code duplication in the binary. Sometimes concrete types are better.
- Use @inlinable sparingly: It copies code to every call site, increasing size.
- Prefer static over dynamic dispatch: Using
finalclasses andprivatemethods enables better optimization. - Check for bloated enums: Associated values in enums can unexpectedly increase code size.
On-Demand Resources
On-Demand Resources (ODR) let you host assets on the App Store and download them only when needed. Perfect for apps with content that not every user accesses.
Good Candidates for ODR
Games
- • Later game levels
- • Character/skin packs
- • Tutorial videos
- • Region-specific content
Productivity Apps
- • Template libraries
- • Language packs
- • Advanced feature assets
- • Onboarding videos
Implementation
// 1. In Xcode, select your asset in the Asset Catalog
// 2. In the Attributes Inspector, set "On-Demand Resource Tags"
// 3. Give it a meaningful tag like "level-2" or "premium-templates"
// Request resources in code:
let tags: Set = ["level-2"]
let resourceRequest = NSBundleResourceRequest(tags: tags)
resourceRequest.beginAccessingResources { error in
if let error = error {
print("Failed to download: \(error)")
return
}
// Resources are now available
// Load your assets as normal
let image = UIImage(named: "level-2-background")
}
// When done, release the resources
resourceRequest.endAccessingResources()
ODR Limits
- • Total hosted: 20GB maximum on App Store
- • Initial install tags: Content that downloads with the app, still counts toward app size
- • Prefetch tags: Downloads after install completes
- • Download-only tags: Only downloaded when explicitly requested
Advanced Techniques
1. Dynamic Frameworks vs Static Libraries
Dynamic frameworks add overhead because each framework includes its own copy of the Swift runtime (if Swift is used). For size optimization:
- Prefer static libraries where possible
- If using CocoaPods, add
use_frameworks! :linkage => :staticto your Podfile - For SPM, static linking is the default
2. Remove Unused Architectures
This matters less now with App Slicing, but during development:
# Check architectures in a framework
lipo -info Framework.framework/Framework
# Remove simulator architectures from release builds (if needed)
lipo -remove x86_64 -remove i386 -output Framework Framework
3. Use App Clips for Preview
If your app is large by nature, consider creating an App Clip. App Clips must be under 15MB (50MB for experiences from Safari) and let users try your app before committing to the full download.
4. Lazy Loading of Features
For features most users won't use immediately, consider:
- Loading view controllers lazily instead of in storyboards
- Using container views that load content on demand
- Deferring SDK initialization until the feature is accessed
5. Monitor Size in CI/CD
# After building, check size
APP_SIZE=$(stat -f%z "build/App.ipa" 2>/dev/null || stat -c%s "build/App.ipa")
MAX_SIZE=209715200 # 200MB in bytes
if [ "$APP_SIZE" -gt "$MAX_SIZE" ]; then
echo "WARNING: App size ($APP_SIZE bytes) exceeds 200MB cellular limit"
exit 1
fi
Frequently Asked Questions
What's the difference between "Download Size" and "Install Size"?
Download size is the compressed size users download from the App Store. Install size is the uncompressed size on the device, which is usually 2-3x larger. The 200MB limit applies to download size.
Does Swift bloat my app compared to Objective-C?
Not anymore. Since iOS 12.2, the Swift runtime is included in the OS. Your app no longer bundles Swift libraries. However, Swift can generate more code for generic-heavy designs, so architecture still matters.
Should I use HEIF images everywhere?
HEIF is great for photos and complex images, but for simple graphics and icons, PDFs or PNGs with transparency are often better. HEIF shines for photographs and detailed textures.
Can I use ZIP files to compress assets in my app bundle?
You can, but it rarely helps. The App Store already compresses your IPA. Pre-zipping assets adds decompression overhead and may not reduce download size. Use properly optimized original formats instead.
Do localizations significantly increase app size?
Text localizations are tiny (kilobytes). But localized assets (images with text, different graphics per region) can add up. Use On-Demand Resources for region-specific assets if size is a concern.
How much size does Core ML add?
Core ML models can be huge—anywhere from 1MB to 500MB+. Use model quantization to reduce size (often 4x smaller with minimal accuracy loss). Consider server-side ML for very large models.
Optimize Before You Submit
Our AI Review Toolkit can help identify potential App Store issues before submission. Get your app through review faster—including size-related problems.
Try the AI Toolkit