Shipping Two Apps In One Android
Article Summary
Snapchat shipped two complete Android apps in a single APK to A/B test their rewrite. The engineering challenge? Android wasn't designed to support this at all.
When Snapchat rebuilt their Android app from scratch, they faced a critical question: how do you test a complete rewrite without losing the ability to update your production app? Their solution was technically audacious: bundle both the old and new apps together, let users switch between them, and A/B test at scale. They built a library called Stuffing to make it work.
Key Takeaways
- Stuffing library enables multiple isolated Android apps in one APK
- App switching took 10+ seconds on older devices, requiring special UX
- Combined APK added only 25MB and 20ms startup time overhead
- Easter egg on Snap Map near Bermuda let curious users opt in
- Maintained thin Stuffing layer post-launch to handle backwards compatibility
Critical Insight
Snapchat open-sourced Stuffing, proving you can ship two apps in one APK for proper A/B testing, though the edge cases around data migration, entry points, and app switching add significant complexity.