4

Following this how to reduce the size of app

My ipa size is 19 MB . Renamed the file with a .zip extension and double click on it. Found the app in the Payload folder and right mouse click on it and choose show package contents. Found exec to be 25MB and some images of large size.How can I reduce the size of exec? because I want to reduce the size of app in store

Any ideas / suggestions would be highly helpful

Community
  • 1
  • 1
Honey
  • 2,840
  • 11
  • 37
  • 71
  • 1
    You can decrease size of your images by reducing quality as needed. – Vijay Masiwal Jun 08 '15 at 12:55
  • Check this : https://developer.apple.com/library/ios/qa/qa1795/_index.html – Mrunal Jun 08 '15 at 12:58
  • Make sure you're using [Asset Catalogs](https://developer.apple.com/library/ios/recipes/xcode_help-image_catalog-1.0/Recipe.html) to store your images in your application. This will allow for faster download times from the App Store. – Daniel Storm Jun 08 '15 at 13:25

2 Answers2

1
  1. You can load high-res images from internet
  2. Optimize splash screen images, remove alpha, make 8bit color
  3. Use pseudo-AJPEG image.png + image_mask.jpg

    #define maskedCacheStorePath [[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:@"maskedImageCache"]
    
    + (UIImage *)maskedImageNamed:(NSString *)imageName useCache:(Boolean)useCache {
        NSString *imageCacheStoreFile = nil;
    
        if (useCache) {
    if (![[NSFileManager defaultManager] fileExistsAtPath:maskedCacheStorePath])
        [[NSFileManager defaultManager] createDirectoryAtPath:maskedCacheStorePath withIntermediateDirectories:YES attributes:nil error:nil];
    imageCacheStoreFile = [maskedCacheStorePath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.png", imageName]];
    if ([[NSFileManager defaultManager] fileExistsAtPath:imageCacheStoreFile])
        return [UIImage imageWithContentsOfFile:imageCacheStoreFile];
        }
    
        UIImage *image = [UIImage imageNamed:[imageName stringByAppendingPathExtension:@"jpg"]];
        UIImage *mask = [UIImage imageNamed:[[imageName stringByAppendingString:@"_mask"] stringByAppendingPathExtension:@"png"]];
    
        CGImageRef ref = CGImageCreateWithMask(image.CGImage, mask.CGImage);
        UIImage *result = [UIImage imageWithCGImage:ref scale:image.scale orientation:image.imageOrientation];
        CGImageRelease(ref);
    
        if (useCache && result)
    [UIImagePNGRepresentation(result) writeToFile:imageCacheStoreFile atomically:YES];
    
        return result;
    }
    

    also look through this question answers

Community
  • 1
  • 1
Mikhail
  • 90
  • 7
0

look at this technical Q&A on Apple Developer site.

It should contain all tips for reduce your ipa size ;)

Below is an excerpt from that document that may get you started:

Measure Your App Before trying any optimizations, you should measure. Some of the techniques in this document are tradeoffs with downsides that must be considered. You must measure their impact to be sure you're making the right tradeoff. Without measuring, you can't know what kind of change you're making.

The app distribution process produces a number of different artifacts, each with its own purpose and size. It's important to understand what each artifact represents and which artifacts to use when measuring your app's size.

  • An app bundle is the .app bundle containing all of the binaries in your app, plus all of your app's resources, such as images. This
    bundle contains everything needed for your app to run on every
    supported device. For the purposes of this document, an app bundle
    only refers to the .app produced by archiving your app.
  • An App Store submission .ipa is created from an Xcode archive when uploading to the App Store or by exporting the archive for iOS App Store Deployment. This .ipa is a compressed directory containing the app bundle and additional resources needed for App Store services, such as .dSYM files for crash reporting and asset packs for On Demand Resources.
  • A universal .ipa is a compressed app bundle that contains all of the resources to run the app on any device. Bitcode has been
    recompiled, and additional resources needed by the App Store, such as .dSYM files and On Demand Resources, are removed. For App Store apps, this .ipa is downloaded to devices running iOS 8 or earlier.
  • A thinned .ipa is a compressed app bundle that contains only the resources needed to run the app on a specific device. Bitcode has
    been recompiled, and additional resources needed by the App Store,
    such as .dSYM files and On Demand Resources, are removed. For App
    Store apps, this .ipa is downloaded to devices running iOS 9 or
    later.
  • A universal app bundle is the decompressed universal .ipa. The installation process decompresses the universal .ipa and installs the universal app bundle.
  • A thinned app bundle is the decompressed thinned .ipa. The installation process decompresses the thinned .ipa and installs the thinned app bundle.
erikrunia
  • 2,371
  • 1
  • 15
  • 22
Massimo Polimeni
  • 4,826
  • 4
  • 27
  • 54