Package Size Analysis and Incremental Control for Mobile Apps
The Xianyu app’s package size surged by 43 % on Android and 26 % on iOS in six months, prompting a detailed analysis that classifies resources, parses APKs and iOS link maps, and implements an automated incremental gate requiring justification for any increase over 100 KB, leading to the first size reduction in half a year and ongoing efforts to slim Flutter artifacts and legacy resources.
Background: The package size of the Xianyu app has been increasing rapidly (Android +43%, iOS +26% in six months), threatening download conversion and the iOS 200 MB limit.
Impact: Larger packages reduce download conversion (each 6 MB increase drops conversion by ~1%) and can cause users to delete the app when device storage is low.
Package composition:
Android APK consists of files such as AndroidManifest.xml , resources.arsc , classes.dex , /assets , /res , /lib .
iOS IPA consists of a signature file, resource files, an executable (static and dynamic libraries), and bundle files.
Analysis approach:
Android: classify resources (so libraries, images, dex, xml) and generate size distribution charts. A custom tool parses the APK, ranks files by size, and visualizes the result.
iOS static libraries: parse the link map file to obtain object files and symbols, sum sizes per object to compute library size, excluding dead‑stripped symbols.
#Object files:
[0] linker synthesized
[1] /Users/xy/build/workspace/Pods/MNN/MNN.framework/MNN(MNNReluInt8-24695ca527c0186b07.o)
[2] /Users/xy/build/workspace/Pods/MNN/MNN.framework/MNN(MNNGemmInt16to32_4x4_Unit-416f183fdf349b160b82.o)
[3] /Users/xy/build/workspace/Pods/MNN/MNN.framework/MNN(CPUPermute.o)iOS dynamic libraries: use lipo to extract the arm64 slice and measure the framework folder size.
Incremental automation: The analysis is integrated into the build script. After each successful build, a package report is generated and emailed. Developers can compare the current build with the baseline, previous build, and main‑branch build to see size changes per file/module.
Incremental gate design: Before merging a feature, the package delta is reviewed. If the increase exceeds 100 KB, a justification and manager approval are required. The process includes building a baseline package, merging master before testing, and sending test emails with size information.
Results: Since the gate launched on 2022‑06‑20, iOS version V6.7.40 showed the first decrease in half a year, and developers have become more conscious of slimming packages.
Future work: Continue refining Flutter artifact analysis, cleaning legacy resources, and further reducing the overall app size.
Xianyu Technology
Official account of the Xianyu technology team
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.