The iOS App built on Xamarin Forms; the app size is increasing 3 times when uploading to App Store.

Padhy, Niladri 21 Reputation points
2022-04-05T07:57:18.8+00:00

Hi Team,

We have build a mobile with Xamarin Forms. The IPA file size is around 37MB, but when its upload to AppStore the file size is showing 87MB. What is the reason behind this and how can we minimise the file size in App Store?

Thanks
Niladri

Developer technologies | .NET | Xamarin
{count} votes

1 answer

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 36,451 Reputation points Microsoft External Staff
    2022-04-06T03:30:45.237+00:00

    Hello,

    Look at the size of the .ipa or .xcarchive directly is misleading.

    The APP file (the app bundle), The XCARCHIVE bundle that you create when you archive your app, The IPA file that you upload to App Store Connect. Those binaries contain resources and files that aren’t part of the bundles that your users download from the App Store. Refer to https://developer.apple.com/documentation/xcode/reducing-your-app-s-size
    Upload the ipa to App Store Connect, go to https://appstoreconnect.apple.com/, select your app, go to TestFlight, select the version under iOS Builds, under Build Metadata tab, click App Store File Sizes, the Download Size means this is the compressed size of the app downloaded over the air. The Install Size means this is the amount of disk space the app will take up on the customer's device.

    how can we minimise the file size in App Store?

    1. Try to Link all assemblies.
    2. Try to compile for different devices.
    3. Try to optimize your App’s asset files, refer to https://developer.apple.com/documentation/xcode/doing-advanced-optimization-to-further-reduce-your-app-s-size
    4. Try to improve Xamarin.iOS performance, refer to https://learn.microsoft.com/en-us/xamarin/ios/deploy-test/performance?context=xamarin/cross-platform
    5. You also could try to improve Xamarin Forms app performance.
      https://learn.microsoft.com/en-us/xamarin/xamarin-forms/deploy-test/performance

    ------Update------
    The compilation and building methods of android and iOS are different, and the downloaded devices are also different. For example, A devices can download some resources when we download the package, but B devices may only need to download the package.

    The only way to make it really smaller than that is to then use link all assemblies, which basically tries to pull out unused code from all symbologies, not just framework assemblies. But you have to be careful to preserve needed type/methods/etc. (may cause some runtime issue)
    You need to make sure that any code and user assemblies that you need there or third party assemblies that you need to maintain that you're not referencing directly in your code.
    Furthermore, you don't have to worry about it, 87M is well within the guidelines. It won't be that big when it gets downloaded to user's device because it will cut the slices that users' device needed.

    Best Regards,
    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.