Skip to content

Reducing App Size

Question

How to decrease Xamarin app size?

Short interview answer

Measure the release package first, remove unused dependencies and resources, ship only required native architectures, and enable the platform’s release-time linking or code shrinking with tests that cover reflection and dynamically discovered code.

Detailed answer

An application package includes the app, dependencies, runtime pieces, resources, and native binaries. The safest reduction usually comes from deleting unused features and large assets, then reviewing transitive dependencies rather than enabling an aggressive linker blindly. Xamarin’s linker can remove code that is not directly used, but reflection or dynamically discovered members can be removed unless they are preserved explicitly. Verify the release build on target devices after each size optimization; a smaller package that fails only in a rare screen is not an improvement.

Sources