0

The size of my Xamarin.iOS app is >100 mb and I'm trying to reduce it. I have included the Facebook SDK which takes up 70MB on its own. The only part of the SDK that I need is the login functionality.

I have set my Linker to Link SDK assemblies only and have some questions in this regard. Does the linker automatically remove all the unused functions in the Facebook SDK?

Or is it better to go through the source code of Facebook SDK and remove all unnecessary functions like app events and other unnecessary functions and just use the one that is needed for my app?

Demitrian
  • 3,200
  • 1
  • 24
  • 41
TheDeveloper
  • 1,127
  • 1
  • 18
  • 55
  • Did you consider using [`Link all assemblies`](https://developer.xamarin.com/guides/ios/advanced_topics/linker/#Link_all_assemblies)? Choosing to only link the SDK assemblies will just optimise the Xamarin.iOS assemblies. – Demitrian Aug 25 '17 at 16:35
  • Link all is causing the app to crash and I need more time to resolve that. When you say that Link SDK will only optimize the xamarin.iOS assemblies do you mean it will rip off all the unnecessary code in the SDK ? – TheDeveloper Aug 25 '17 at 16:37
  • Yes. It will optimise the parts of the `Xamarin.iOS` SDK that you do not utilise. But not third party assemblies. `Link all assemblies` will handle that for you, but as you mentioned yourself, this may have other side effects. – Demitrian Aug 25 '17 at 16:41
  • Apart from using LLVM complier and using Link all are there any other best practices to reduce app size ? Also, Xamarin.iOS is a third party assembly isn't it ? – TheDeveloper Aug 25 '17 at 16:44
  • 1
    No, those are your best options currently. Of course, reducing the size of your resources (images, etc.) are also something which you should keep in mind. And no, not anymore. `Xamarin.iOS` is a class library in the Mono Framework, which is now directly integrated in Visual Studio. – Demitrian Aug 25 '17 at 16:49

0 Answers0