Search code examples
iosangularionic2

My App iPA file size is very big compare to android apk file


I am developing one app with ionic angular4 and while I am deploying my app my app size is very big.

My app is very simple informative app and there is only app icon and splash screen are there in my bundle still its goes up to 16-17 MB in iOS iPA while in android same thing will goes up to 3MB only so is there any way to decrese my iPA file size ?

Note : I am using production mode while deploying my app.

While I reverse engineering on iPA file I found below interesting things which may help me out from this issue.

  • www -> 10.9 (almost 65% of iPA size)
  • www/build -> 10.0 MB
  • www/build/vendor.js -> 4.3 MB
  • www/build/vendor.js.map -> 5 MB

May be we can workout on vendor.js will help us to reduce my App size. But not sure how can we reduce this file size ?

Thanks in Advance!


Solution

  • Almost I lose hope that I can resolve this issue and compromised with IPA file size.

    Meanwhile, I developed 4-5 ionic based app with the same issue and in my recent app deploy I fond my IPA file with almost half of the old app size.

    So I compare steps of old and new app deployment and I summarised below the solution is best practice.

    1. Build your app in prod mode by using --prod.

      Build Command : ionic cordova build ios --prod

    2. Compress all your images with the best resolution and without compromising your image quality. (Use some tool to compress and decrease your image size e.g. ImageCompress).

    3. Remove unwanted files which are no more useful in prod ready code like Sample or dummy JSON, String, PDF, Images.

    Following the above steps, My Old APP IPA file size decreased by 60% and now app IPA file size is only 6 MB earlier it was 16 MB.

    This will help to reduce app build size.