Search code examples
iosxcodeipaarcgis-runtime

iOS ArcGIS.framework too large, hence large .ipa size


I are maintaining an application with ArcGIS.framework for iOS. I am upgrading from version 10.2~ to 100+. I have prolonged this hoping that at some point the application size problem will be resolved. The application size with the newer framework went up from just 26MB to over 360MB. This will not be accepted by clients. I have been searching for a good and simple way of reducing the app size without using app thinning which requires bitcode to be enable which for some other reasons I can't enable.

Stripping x86_64 and i386 architectures does not reduce the framework size that much.

Are there flags, other compiler or linking settings we can provide Xcode with at compile time?


Solution

  • You can take advantage of App Thinning without having to enable bitcode, and if you're targeting iOS 9 and upwards you will only ever see a Thinned .ipa deployed to any device (although a Universal .ipa will get generated and uploaded to iTunes Connect).

    In practice, that means if you're using Runtime 100.x, your app will use app thinning.

    Here is how we assess this to see what will end up on an iOS 9+ device (required for Runtime 100.2):

    1. In Xcode's menu, select Product -> Archive (make sure you have Generic iOS Device or an actual device selected as the target device).
    2. Once finished, the Organizer window should pop open and you should be able to see the latest archive in the archives tab.
    3. Select the archive and hit the Export button on the right.
    4. Choose Development and hit Next.
    5. Choose a team if asked.
    6. In the App Thinning menu, choose a specific device and hit Next.
    7. Select your signing method and hit Next.
    8. Review the summary, and hit Export.

    You will end up with a folder containing the thinned .ipa and some reports on the thinning process, including what usage to expect to see on the device.

    For example, here is the App Thinning Size Report.txt for a Runtime app targeting iPhone 8 (with bitcode disabled):

    App Thinning Size Report for All Variants of MyRuntime100App
    
    Variant: MyRuntime100App-iPhone 8.ipa
    Supported devices: iPhone 8
    App + On Demand Resources size: 31 MB compressed, 89.7 MB uncompressed
    App size: 31 MB compressed, 89.7 MB uncompressed
    On Demand Resources size: Zero KB compressed, Zero KB uncompressed
    

    So the above app would be an over the air download of 31 MB and would take up 89.7 MB on the device (and that example happens to include a 19.8 MB Mobile Map Package).

    Hope that helps.

    I would also encourage you to post future questions to our iOS Runtime SDK forum if you can.